iobroker.squeezeboxrpc 1.3.15 → 1.3.16

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/README.md CHANGED
@@ -201,6 +201,10 @@ For more information visit the CLI-documentation:
201
201
  Placeholder for the next version (at the beginning of the line):
202
202
  ### **WORK IN PROGRESS**
203
203
  -->
204
+ ### 1.3.16 (2024-10-23)
205
+
206
+ - fixed icons of the favorites widget
207
+
204
208
  ### 1.3.15 (2024-08-09)
205
209
 
206
210
  - due to a adapter checker issue i have to remove the release 1.3.13 from npm.
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "squeezeboxrpc",
4
- "version": "1.3.15",
4
+ "version": "1.3.16",
5
5
  "news": {
6
+ "1.3.16": {
7
+ "en": "fixed icons of the favorites widget",
8
+ "de": "feste symbole der favoriten widget",
9
+ "ru": "фиксированные иконы любимого виджета",
10
+ "pt": "ícones fixos do widget favorito",
11
+ "nl": "vaste pictogrammen van de favorieten widget",
12
+ "fr": "icônes fixes du widget favori",
13
+ "it": "icone fisse del widget preferiti",
14
+ "es": "iconos fijos de los favoritos widget",
15
+ "pl": "stałe ikony ulubionego widgetu",
16
+ "uk": "фіксовані ікони улюбленого віджету",
17
+ "zh-cn": "最爱部件的固定图标"
18
+ },
6
19
  "1.3.15": {
7
20
  "en": "- due to a adapter checker issue i have to remove the release 1.3.13 from npm.\n but changes from 1.3.13 are included in 1.3.14",
8
21
  "de": "- wegen eines adapter-checker-problems muss ich das release 1.3.13 von npm entfernen.\nänderungen von 1.3.13 sind in 1.3.14 enthalten",
@@ -80,19 +93,6 @@
80
93
  "pl": "* napraw błąd przy usuwaniu ulubionych * napraw błędny typ punktu danych",
81
94
  "uk": "* виправити помилку з видаленням вибраного * виправити неправильний тип точки даних",
82
95
  "zh-cn": "* 修复删除收藏夹时的错误 * 修复数据点的错误类型"
83
- },
84
- "1.3.8": {
85
- "en": "* fix object forward btn widget",
86
- "de": "* Objekt-Weiterleitungs-BTN-Widget korrigiert",
87
- "ru": "* исправлен виджет кнопки вперед объекта",
88
- "pt": "* corrigir widget de btn de encaminhamento de objeto",
89
- "nl": "* fix object voorwaartse btn-widget",
90
- "fr": "* Correction du widget btn de transfert d'objet",
91
- "it": "* corretto il widget oggetto forward btn",
92
- "es": "* arreglar el widget btn de reenvío de objetos",
93
- "pl": "* napraw widget btn do przesyłania obiektów",
94
- "uk": "* виправити віджет btn для пересилання об’єктів",
95
- "zh-cn": "* 修复对象转发 btn 小部件"
96
96
  }
97
97
  },
98
98
  "titleLang": {
package/lib/iosbserver.js CHANGED
@@ -479,11 +479,26 @@ function IoSbServer(adapter) {
479
479
  if (Object.prototype.hasOwnProperty.call(favorite, key)) {
480
480
  if (key == "id") favorite["id"] = oid;
481
481
  if (key == "image") {
482
- const regex = /imageproxy\/(.*)\/[^/]/gm;
483
- const m = regex.exec(favorite[key]);
484
- if (m && m.index > 0) {
485
- favorite[key] = decodeURIComponent(m[1]);
482
+ let result = "http://" + this.adapter.config.server + ":" + this.adapter.config.port + "/html/images/favorites.png";
483
+ if (/music\/(.*)\/cover.png/gm.test(favorite[key])) {
484
+ result = "http://" + this.adapter.config.server + ":" + this.adapter.config.port + "/" + favorite[key];
486
485
  }
486
+ else if (/imageproxy\/(.*)\/[^/]/gm.test(favorite[key])) {
487
+ const m = /imageproxy\/(.*)\/[^/]/gm.exec(favorite[key]);
488
+ if (m && m[1]) {
489
+ result = decodeURIComponent(m[1] || "");
490
+ }
491
+ }
492
+ else if (favorite[key] === "html/images/radio.png") {
493
+ result = "http://" + this.adapter.config.server + ":" + this.adapter.config.port + "/html/images/radio.png";
494
+ }
495
+ else if (favorite[key] === "html/images/cover.png") {
496
+ result = "http://" + this.adapter.config.server + ":" + this.adapter.config.port + "/html/images/cover.png";
497
+ }
498
+ else if (favorite[key] === "html/images/favorites.png") {
499
+ result = "http://" + this.adapter.config.server + ":" + this.adapter.config.port + "/html/images/favorites.png";
500
+ }
501
+ favorite[key] = result;
487
502
  }
488
503
  const stateTemplate = this.sbFavoritesState[key];
489
504
  await this.createFolder(id, this.FavoritesStatePath);
@@ -497,49 +512,6 @@ function IoSbServer(adapter) {
497
512
  );
498
513
  }
499
514
  };
500
- /* this.newgetFavorites = function () {
501
- this.logsilly("newgetFavorites");
502
- this.newgetFavoritesDP(
503
- (states) => this.newdelFavoritesDP(states,
504
- () => this.newgetFavoritesLMS("",
505
- (result) => this.setFavoritesDP(result)
506
- )
507
- )
508
- );
509
- }; */
510
- /* this.newdelFavorites = function () {
511
- this.logsilly("newgetFavorites");
512
- this.newgetFavoritesDP(
513
- (states) => this.newdelFavoritesDP(states)
514
- );
515
- }; */
516
- /* this.newgetFavoritesDP = function (callback) {
517
- this.logsilly("newgetFavoritesDPs");
518
-
519
- const id = this.FavoritesStatePath;
520
- this.adapter.getStates(id + "*", (err, states) => {
521
- if (!err) {
522
- callback(states);
523
- } else this.log.info(err);
524
- });
525
- };
526
-
527
- this.newdelFavoritesDP = (states, callback) => {
528
- const that = this;
529
- this.logsilly("newdelFavoritesDP");
530
- const promises = [];
531
- for (const id in states) {
532
- this.logdebug(`Start to delete object => ${id}`);
533
- promises.push(new Promise(function (resolve) {
534
- that.delObject(id, false, false, resolve);
535
- }.bind(this)));
536
- }
537
- Promise.all(promises).then(function () {
538
- that.logdebug(`All favorite objects deleted`);
539
- if (callback) callback();
540
- }.bind(this));
541
- }; */
542
-
543
515
  this.getFavId = function (id, replace = true) {
544
516
  let ret;
545
517
  if (id.indexOf(".") == 8) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.squeezeboxrpc",
3
- "version": "1.3.15",
3
+ "version": "1.3.16",
4
4
  "description": "ioBroker Logitech Squeezebox Adapter over JSON/RPC-Protocol",
5
5
  "author": {
6
6
  "name": "oweitman",
@@ -51,7 +51,7 @@
51
51
  "eslint": "^8.57.0",
52
52
  "eslint-config-prettier": "^9.1.0",
53
53
  "eslint-plugin-prettier": "^5.2.1",
54
- "mocha": "^10.5.2",
54
+ "mocha": "^10.7.3",
55
55
  "prettier": "^3.3.3",
56
56
  "proxyquire": "^2.1.3",
57
57
  "sinon": "^18.0.0",