iobroker.squeezeboxrpc 1.3.15 → 1.3.17

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,14 @@ 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.17 (2024-10-23)
205
+
206
+ - add edit button to the vie index field of favorites widget
207
+
208
+ ### 1.3.16 (2024-10-23)
209
+
210
+ - fixed icons of the favorites widget
211
+
204
212
  ### 1.3.15 (2024-08-09)
205
213
 
206
214
  - 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,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "squeezeboxrpc",
4
- "version": "1.3.15",
4
+ "version": "1.3.17",
5
5
  "news": {
6
+ "1.3.17": {
7
+ "en": "add edit button to the vie index field of favorites widget",
8
+ "de": "fügen sie edit-taste in das vie-index-feld der favoriten widget",
9
+ "ru": "добавить редактирующую кнопку в поле индекса vie",
10
+ "pt": "adicionar botão de edição para o campo de índice vie de widget favorito",
11
+ "nl": "bewerken knop toevoegen aan het vie index veld van favorieten widget",
12
+ "fr": "ajouter le bouton d'édition au champ d'index de vie des favoris widget",
13
+ "it": "aggiungere il pulsante di modifica al campo indice vie di widget preferiti",
14
+ "es": "añadir botón de edición al campo índice vie de favoritos widget",
15
+ "pl": "dodaj przycisk edycji do pola indeksu vie ulubionych widget",
16
+ "uk": "додати кнопку редагування в vie index поле улюблених віджетів",
17
+ "zh-cn": "在最爱部件的vie索引字段中添加编辑按钮"
18
+ },
19
+ "1.3.16": {
20
+ "en": "fixed icons of the favorites widget",
21
+ "de": "feste symbole der favoriten widget",
22
+ "ru": "фиксированные иконы любимого виджета",
23
+ "pt": "ícones fixos do widget favorito",
24
+ "nl": "vaste pictogrammen van de favorieten widget",
25
+ "fr": "icônes fixes du widget favori",
26
+ "it": "icone fisse del widget preferiti",
27
+ "es": "iconos fijos de los favoritos widget",
28
+ "pl": "stałe ikony ulubionego widgetu",
29
+ "uk": "фіксовані ікони улюбленого віджету",
30
+ "zh-cn": "最爱部件的固定图标"
31
+ },
6
32
  "1.3.15": {
7
33
  "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
34
  "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",
@@ -67,32 +93,6 @@
67
93
  "pl": "* getalbumartist jako artysta, jeśli ustawienia TPE2/TPE3 w LMS zostaną zmienione",
68
94
  "uk": "* getalbumartist як виконавець, якщо налаштування TPE2/TPE3 у LMS змінено",
69
95
  "zh-cn": "* 如果 LMS 中的 TPE2/TPE3 设置发生更改,则将 albumartist 作为艺术家"
70
- },
71
- "1.3.9": {
72
- "en": "* fix error with deleting favorites * fix wrong type for datapoint",
73
- "de": "* Fehler beim Löschen von Favoriten behoben * Falscher Typ für Datenpunkt behoben",
74
- "ru": "* исправить ошибку при удалении избранного * исправить неправильный тип точки данных",
75
- "pt": "* corrigir erro ao excluir favoritos * corrigir tipo errado de ponto de dados",
76
- "nl": "* fout repareren bij het verwijderen van favorieten * foutief type voor datapunt repareren",
77
- "fr": "* Correction d'une erreur lors de la suppression des favoris * Correction du mauvais type de point de données",
78
- "it": "* corretto l'errore con l'eliminazione dei preferiti * corretto il tipo errato di datapoint",
79
- "es": "* corregir error al eliminar favoritos * corregir tipo incorrecto para punto de datos",
80
- "pl": "* napraw błąd przy usuwaniu ulubionych * napraw błędny typ punktu danych",
81
- "uk": "* виправити помилку з видаленням вибраного * виправити неправильний тип точки даних",
82
- "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.17",
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",
@@ -32,7 +32,7 @@
32
32
  type="text/ejs"
33
33
  class="vis-tpl"
34
34
  data-vis-prev='<img style="display: block;margin-left: auto;margin-right: auto;width: 50%;" src="widgets/squeezeboxrpc/img/favorites.png"></img>'
35
- data-vis-attrs="widgetPlayer/custom,squeezeboxrpc.attrSelect;viewindex//checkViewIndex;bCount/hidden;editmodehelper[true]/checkbox;"
35
+ data-vis-attrs="widgetPlayer/custom,squeezeboxrpc.attrSelect;viewindex/text/checkViewIndex;bCount/hidden;editmodehelper[true]/checkbox;"
36
36
  data-vis-attrs0="group.buttonsettings;picWidth[50]/number;picHeight[50]/number;opacity[0.5]/slider,0,1,0.05;borderwidth[2px]/number/editDimension;borderstyle[solid]/nselect,,none,hidden,dotted,dashed,solid,double,groove,ridge,inset,outset,initial,inherit;bordercolornormal[#2e2e2e]/color;bordercoloractive[#87ceeb]/color;borderradius[5px]/number/editDimension;buttonbkcolor[#000000]/color;buttonmargin[0px]/number/editDimension;"
37
37
  data-vis-attrs1="group.buttons/byindex;buttonsImage(1-bCount)/image;buttonsText(1-bCount);"
38
38
  data-vis-set="squeezeboxrpc"