iobroker.foobar2000 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "foobar2000",
4
- "version": "2.2.0",
4
+ "version": "2.3.0",
5
5
  "news": {
6
+ "2.3.0": {
7
+ "en": "Adapter requires node.js >= 20 now.\nAdapter requires admin >= 7.7.22 now\nAdapter requires js-controller >= 6.0.11 now\nDependencies have been updated.",
8
+ "de": "Adapter benötigt jetzt node.js >= 20.\nAdapter benötigt admin >= 7.7.22 jetzt\nAdapter benötigt jetzt js-controller >= 6.0.11\nAbhängigkeiten wurden aktualisiert.",
9
+ "ru": "Адаптер требует node.js >= 20 сейчас.\nАдаптер требует администратора >= 7.7.22\nАдаптер требует js-контроллер >= 6.0.11\nЗависимости были обновлены.",
10
+ "pt": "O adaptador requer gnod.js >= 20 agora.\nAdaptador requer admin >= 7.7.22 agora\nAdaptador requer js-controlador >= 6.0.11 agora\nAs dependências foram atualizadas.",
11
+ "nl": "Voor de adapter zijn node.js < 20 nu nodig.\nAdapter vereist admin < 7.7.22 nu\nAdapter vereist js-controller > 6,0.11 nu\nAfhankelijkheden zijn bijgewerkt.",
12
+ "fr": "Adaptateur nécessite node.js >= 20 maintenant.\nAdaptateur nécessite admin >= 7.7.22 maintenant\nAdaptateur nécessite js-controller >= 6.0.11 maintenant\nLes dépendances ont été actualisées.",
13
+ "it": "Adattatore richiede node.js >= 20 ora.\nAdattatore richiede admin >= 7.7.22 ora\nAdattatore richiede js-controller >= 6.0.11 ora\nLe dipendenze sono state aggiornate.",
14
+ "es": "Adaptador requiere node.js >= 20 ahora.\nEl adaptador requiere admin= 7.7.22 ahora\nAdaptador requiere js-controller >= 6.0.11\nSe han actualizado las dependencias.",
15
+ "pl": "Adapter wymaga node.js > = 20 teraz.\nAdapter wymaga admin > = 7.7.22\nAdapter wymaga sterownika js- > = 6.0.11\nZaktualizowano zależność.",
16
+ "uk": "Адаптер вимагає node.js >= 20 тепер.\nАдаптер вимагає адмін >= 7.7.22 тепер\nАдаптер вимагає js-controller >=6.0.11 тепер\nОновлено залежність.",
17
+ "zh-cn": "适配器需要节点.js >= 20 现在.\n适任者需要管理员 \\ 7.7.22 现在\n适配器需要js控制器 现在6.0.11\n附属关系已经更新."
18
+ },
6
19
  "2.2.0": {
7
20
  "en": "Adapter requires node.js 18 and js-controller >= 5 now\nDependencies have been updated",
8
21
  "de": "Adapter benötigt node.js 18 und js-controller >= 5 jetzt\nAbhängigkeiten wurden aktualisiert",
@@ -52,7 +65,8 @@
52
65
  "it": "fixed error",
53
66
  "es": "fixed error",
54
67
  "pl": "fixed error",
55
- "zh-cn": "fixed error"
68
+ "zh-cn": "fixed error",
69
+ "uk": "виправлена ​​помилка"
56
70
  },
57
71
  "2.0.3": {
58
72
  "en": "fixed admin error",
@@ -64,7 +78,8 @@
64
78
  "it": "fixed admin error",
65
79
  "es": "fixed admin error",
66
80
  "pl": "fixed admin error",
67
- "zh-cn": "fixed admin error"
81
+ "zh-cn": "fixed admin error",
82
+ "uk": "виправлена ​​помилка адміністратора"
68
83
  },
69
84
  "2.0.0": {
70
85
  "en": "Completely rewritten",
@@ -76,7 +91,8 @@
76
91
  "it": "Completely rewritten",
77
92
  "es": "Completely rewritten",
78
93
  "pl": "Completely rewritten",
79
- "zh-cn": "Completely rewritten"
94
+ "zh-cn": "Completely rewritten",
95
+ "uk": "Повністю переписано"
80
96
  }
81
97
  },
82
98
  "titleLang": {
@@ -118,7 +134,6 @@
118
134
  "type": "free"
119
135
  },
120
136
  "platform": "Javascript/Node.js",
121
- "main": "foobar2000.js",
122
137
  "icon": "foobar2000.png",
123
138
  "enabled": false,
124
139
  "extIcon": "https://raw.githubusercontent.com/iobroker-community-adapters/ioBroker.foobar2000/master/admin/foobar2000.png",
@@ -133,12 +148,12 @@
133
148
  "materialize": true,
134
149
  "dependencies": [
135
150
  {
136
- "js-controller": ">=5.0.19"
151
+ "js-controller": ">=6.0.11"
137
152
  }
138
153
  ],
139
154
  "globalDependencies": [
140
155
  {
141
- "admin": ">=6.13.16"
156
+ "admin": ">=7.7.22"
142
157
  }
143
158
  ]
144
159
  },
package/package.json CHANGED
@@ -1,20 +1,11 @@
1
1
  {
2
2
  "name": "iobroker.foobar2000",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "ioBroker Foobar2000 player adapter",
5
- "author": {
6
- "name": "instalator",
7
- "email": "vvvalt@mail.ru"
8
- },
5
+ "author": "instalator <vvvalt@mail.ru>",
9
6
  "contributors": [
10
- {
11
- "name": "instalator",
12
- "email": "vvvalt@mail.ru"
13
- },
14
- {
15
- "name": "iobroker-community-adapters",
16
- "email": "mcm57@gmx.at"
17
- }
7
+ "instalator <vvvalt@mail.ru>",
8
+ "iobroker-community-adapters <mcm57@gmx.at>"
18
9
  ],
19
10
  "homepage": "https://github.com/iobroker-community-adapters/ioBroker.foobar2000",
20
11
  "license": "MIT",
@@ -29,37 +20,22 @@
29
20
  "url": "https://github.com/iobroker-community-adapters/ioBroker.foobar2000.git"
30
21
  },
31
22
  "engines": {
32
- "node": ">=18"
23
+ "node": ">=20"
33
24
  },
34
25
  "dependencies": {
35
- "@iobroker/adapter-core": "^3.1.0"
26
+ "@iobroker/adapter-core": "^3.3.2"
36
27
  },
37
28
  "devDependencies": {
38
- "@alcalzone/release-script": "^3.7.0",
39
- "@alcalzone/release-script-plugin-iobroker": "^3.7.0",
40
- "@alcalzone/release-script-plugin-license": "^3.7.0",
41
- "@alcalzone/release-script-plugin-manual-review": "^3.7.0",
42
- "@iobroker/adapter-dev": "^1.3.0",
43
- "@iobroker/testing": "^4.1.3",
44
- "@tsconfig/node14": "^14.1.2",
45
- "@types/chai": "^4.3.11",
46
- "@types/chai-as-promised": "^7.1.6",
47
- "@types/mocha": "^10.0.6",
48
- "@types/node": "^20.12.7",
49
- "@types/proxyquire": "^1.3.31",
50
- "@types/sinon": "^17.0.3",
51
- "@types/sinon-chai": "^3.2.12",
52
- "chai": "^4.4.1",
53
- "chai-as-promised": "^7.1.1",
54
- "eslint": "^8.57.0",
55
- "eslint-config-prettier": "^8.9.0",
56
- "eslint-plugin-prettier": "^4.2.1",
57
- "mocha": "^10.4.0",
58
- "prettier": "^3.2.5",
59
- "proxyquire": "^2.1.3",
60
- "sinon": "^17.0.1",
61
- "sinon-chai": "^3.7.0",
62
- "typescript": "~5.4.5"
29
+ "@alcalzone/release-script": "^5.1.1",
30
+ "@alcalzone/release-script-plugin-iobroker": "^5.1.2",
31
+ "@alcalzone/release-script-plugin-license": "^5.1.1",
32
+ "@alcalzone/release-script-plugin-manual-review": "^5.1.1",
33
+ "@iobroker/adapter-dev": "^1.5.0",
34
+ "@iobroker/eslint-config": "^2.2.0",
35
+ "@iobroker/testing": "^5.2.2",
36
+ "@tsconfig/node14": "^14.1.8",
37
+ "@types/node": "^24.12.0",
38
+ "typescript": "~5.9.3"
63
39
  },
64
40
  "main": "foobar2000.js",
65
41
  "scripts": {
@@ -68,7 +44,7 @@
68
44
  "test:integration": "mocha test/integration --exit",
69
45
  "test": "npm run test:js && npm run test:package",
70
46
  "check": "tsc --noEmit -p tsconfig.check.json",
71
- "lint": "eslint .",
47
+ "lint": "eslint -c eslint.config.mjs .",
72
48
  "translate": "translate-adapter",
73
49
  "release": "release-script"
74
50
  },
package/.eslintignore DELETED
@@ -1,2 +0,0 @@
1
- **/.eslintrc.js
2
- admin/words.js
package/.prettierrc.js DELETED
@@ -1,9 +0,0 @@
1
- module.exports = {
2
- semi: true,
3
- trailingComma: 'all',
4
- singleQuote: true,
5
- printWidth: 120,
6
- useTabs: false,
7
- tabWidth: 4,
8
- endOfLine: 'lf',
9
- };
package/lib/tools.js DELETED
@@ -1,99 +0,0 @@
1
- const axios = require('axios');
2
-
3
- /**
4
- * Tests whether the given variable is a real object and not an Array
5
- * @param {any} it The variable to test
6
- * @returns {it is Record<string, any>}
7
- */
8
- function isObject(it) {
9
- // This is necessary because:
10
- // typeof null === 'object'
11
- // typeof [] === 'object'
12
- // [] instanceof Object === true
13
- return Object.prototype.toString.call(it) === '[object Object]';
14
- }
15
-
16
- /**
17
- * Tests whether the given variable is really an Array
18
- * @param {any} it The variable to test
19
- * @returns {it is any[]}
20
- */
21
- function isArray(it) {
22
- if (typeof Array.isArray === 'function') return Array.isArray(it);
23
- return Object.prototype.toString.call(it) === '[object Array]';
24
- }
25
-
26
- /**
27
- * Translates text to the target language. Automatically chooses the right translation API.
28
- * @param {string} text The text to translate
29
- * @param {string} targetLang The target languate
30
- * @param {string} [yandexApiKey] The yandex API key. You can create one for free at https://translate.yandex.com/developers
31
- * @returns {Promise<string>}
32
- */
33
- async function translateText(text, targetLang, yandexApiKey) {
34
- if (targetLang === 'en') {
35
- return text;
36
- } else if (!text) {
37
- return '';
38
- }
39
- if (yandexApiKey) {
40
- return translateYandex(text, targetLang, yandexApiKey);
41
- } else {
42
- return translateGoogle(text, targetLang);
43
- }
44
- }
45
-
46
- /**
47
- * Translates text with Yandex API
48
- * @param {string} text The text to translate
49
- * @param {string} targetLang The target languate
50
- * @param {string} apiKey The yandex API key. You can create one for free at https://translate.yandex.com/developers
51
- * @returns {Promise<string>}
52
- */
53
- async function translateYandex(text, targetLang, apiKey) {
54
- if (targetLang === 'zh-cn') {
55
- targetLang = 'zh';
56
- }
57
- try {
58
- const url = `https://translate.yandex.net/api/v1.5/tr.json/translate?key=${apiKey}&text=${encodeURIComponent(text)}&lang=en-${targetLang}`;
59
- const response = await axios({url, timeout: 15000});
60
- if (response.data && response.data.text && isArray(response.data.text)) {
61
- return response.data.text[0];
62
- }
63
- throw new Error('Invalid response for translate request');
64
- } catch (e) {
65
- throw new Error(`Could not translate to "${targetLang}": ${e}`);
66
- }
67
- }
68
-
69
- /**
70
- * Translates text with Google API
71
- * @param {string} text The text to translate
72
- * @param {string} targetLang The target languate
73
- * @returns {Promise<string>}
74
- */
75
- async function translateGoogle(text, targetLang) {
76
- try {
77
- const url = `http://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=${targetLang}&dt=t&q=${encodeURIComponent(text)}&ie=UTF-8&oe=UTF-8`;
78
- const response = await axios({url, timeout: 15000});
79
- if (isArray(response.data)) {
80
- // we got a valid response
81
- return response.data[0][0][0];
82
- }
83
- throw new Error('Invalid response for translate request');
84
- } catch (e) {
85
- if (e.response && e.response.status === 429) {
86
- throw new Error(
87
- `Could not translate to "${targetLang}": Rate-limited by Google Translate`
88
- );
89
- } else {
90
- throw new Error(`Could not translate to "${targetLang}": ${e}`);
91
- }
92
- }
93
- }
94
-
95
- module.exports = {
96
- isArray,
97
- isObject,
98
- translateText
99
- };