iobroker.squeezeboxrpc 1.3.12 → 1.3.15
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 +13 -0
- package/io-package.json +27 -27
- package/lib/iosbplayer.js +82 -37
- package/lib/iosbserver.js +340 -322
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -201,6 +201,19 @@ 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.15 (2024-08-09)
|
|
205
|
+
|
|
206
|
+
- due to a adapter checker issue i have to remove the release 1.3.13 from npm.
|
|
207
|
+
but changes from 1.3.13 are included in 1.3.14
|
|
208
|
+
|
|
209
|
+
### 1.3.14 (2024-08-05)
|
|
210
|
+
|
|
211
|
+
- fix formatting
|
|
212
|
+
|
|
213
|
+
### 1.3.13 (2024-08-05)
|
|
214
|
+
|
|
215
|
+
- revert the fix for artist handling due to negative effect of spotify
|
|
216
|
+
|
|
204
217
|
### 1.3.12 (2024-08-05)
|
|
205
218
|
|
|
206
219
|
- improve cmdGoto handling by kairauer, close PR #74
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "squeezeboxrpc",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.15",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.3.15": {
|
|
7
|
+
"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
|
+
"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",
|
|
9
|
+
"ru": "- из-за проблемы с адаптером, я должен удалить выпуск 1.3.13 из npm.\nно изменения от 1.3.13 включены в подраздел 1.3.14",
|
|
10
|
+
"pt": "- devido a um problema do verificador do adaptador eu tenho que remover a liberação 1.3.13 da npm.\nmas as alterações de 1.3.13 estão incluídas em 1.3.14",
|
|
11
|
+
"nl": "- vanwege een probleem met de adaptercontrole moet ik de release 1.3.13 van npm verwijderen.\nmaar wijzigingen van 1.3.13 zijn opgenomen in 1.3.14",
|
|
12
|
+
"fr": "- en raison d'un problème d'adaptateur, je dois supprimer la version 1.3.13 de npm.\nmais les changements par rapport au 1.3.13 sont inclus dans le 1.3.14",
|
|
13
|
+
"it": "- a causa di un problema dell'adattatore checker devo rimuovere il rilascio 1.3.13 da npm.\nma le modifiche da 1.3.13 sono incluse in 1.3.14",
|
|
14
|
+
"es": "- debido a un problema de control de adaptador tengo que eliminar la liberación 1.3.13 de npm.\npero los cambios de 1.3.13 se incluyen en 1.3.14",
|
|
15
|
+
"pl": "- ze względu na problem sprawdzania adaptera muszę usunąć zwolnienie 1.3.13 z npm.\nale zmiany z 1.3.13 są zawarte w 1.3.14",
|
|
16
|
+
"uk": "- через проблему перевірки адаптера я повинен видалити реліз 1.3.13 з npm.\nале зміни від 1.3.13 включені в 1.3.14",
|
|
17
|
+
"zh-cn": "- 因为适配器检查器的问题,我不得不从npm中移除1.3.13的发布.\n但从1.3.13到1.3.14的变动已包括在内"
|
|
18
|
+
},
|
|
19
|
+
"1.3.14": {
|
|
20
|
+
"en": "fix formatting",
|
|
21
|
+
"de": "fixe formatierung",
|
|
22
|
+
"ru": "форматирование фиксации",
|
|
23
|
+
"pt": "corrigir formatação",
|
|
24
|
+
"nl": "formatteren herstellen",
|
|
25
|
+
"fr": "corriger le formatage",
|
|
26
|
+
"it": "correzione della formattazione",
|
|
27
|
+
"es": "arreglar formato",
|
|
28
|
+
"pl": "naprawić formatowanie",
|
|
29
|
+
"uk": "фіксувати форматування",
|
|
30
|
+
"zh-cn": "固定格式化"
|
|
31
|
+
},
|
|
6
32
|
"1.3.12": {
|
|
7
33
|
"en": "improve cmdGoto handling by kairauer, close PR #74\nfix issues from adapter checker\nintegrate squeezenode lib",
|
|
8
34
|
"de": "verbessern cmd Goto Handling von kairauer, close PR #74\nprobleme von adapter checker beheben\npressnode lib integrieren",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "* napraw widget btn do przesyłania obiektów",
|
|
68
94
|
"uk": "* виправити віджет btn для пересилання об’єктів",
|
|
69
95
|
"zh-cn": "* 修复对象转发 btn 小部件"
|
|
70
|
-
},
|
|
71
|
-
"1.3.7": {
|
|
72
|
-
"en": "* fix object creation of states in player modul",
|
|
73
|
-
"de": "* Objekterstellung von Zuständen im Player-Modul behoben",
|
|
74
|
-
"ru": "* исправлено создание объектов состояний в модуле плеера",
|
|
75
|
-
"pt": "* corrigir a criação de objetos de estados no módulo do player",
|
|
76
|
-
"nl": "* probleem met het maken van statussen in de spelermodule",
|
|
77
|
-
"fr": "* Correction de la création d'objets d'états dans le module joueur",
|
|
78
|
-
"it": "* corretta la creazione di oggetti di stati nel modulo del lettore",
|
|
79
|
-
"es": "* Corregir la creación de objetos de estados en el módulo del reproductor.",
|
|
80
|
-
"pl": "* naprawiono tworzenie stanów obiektów w module odtwarzacza",
|
|
81
|
-
"uk": "* виправлено створення об'єктів станів у модулі гравця",
|
|
82
|
-
"zh-cn": "*修复玩家模块中状态的对象创建"
|
|
83
|
-
},
|
|
84
|
-
"1.3.6": {
|
|
85
|
-
"en": "* fix object creation of states",
|
|
86
|
-
"de": "* Objekterstellung von Zuständen behoben",
|
|
87
|
-
"ru": "* исправлено создание объектов состояний",
|
|
88
|
-
"pt": "* corrigir a criação de estados de objetos",
|
|
89
|
-
"nl": "* probleem met het maken van statussen voor objecten",
|
|
90
|
-
"fr": "* Correction de la création d'objets d'états",
|
|
91
|
-
"it": "* corretta la creazione degli stati da parte degli oggetti",
|
|
92
|
-
"es": "* arreglar la creación de objetos de estados",
|
|
93
|
-
"pl": "* naprawiono tworzenie obiektów w stanach",
|
|
94
|
-
"uk": "* виправити створення об'єктів станів",
|
|
95
|
-
"zh-cn": "* 修复状态的对象创建"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
package/lib/iosbplayer.js
CHANGED
|
@@ -499,9 +499,11 @@ function ioSBPlayer(server, playerdata) {
|
|
|
499
499
|
|
|
500
500
|
}
|
|
501
501
|
};
|
|
502
|
-
this.init = function (playerdata) {
|
|
502
|
+
this.init = async function (playerdata) {
|
|
503
503
|
this.doPlayerStatus(playerdata);
|
|
504
504
|
this.logdebug("New Player found: " + this.playername + " with id " + this.playerid);
|
|
505
|
+
await this.createFolder(this.statePath);
|
|
506
|
+
await this.createDevice(this.playername, this.statePath);
|
|
505
507
|
const delay = this.playerindex || 0;
|
|
506
508
|
setTimeout(this.doObserverPlayer.bind(this), delay * 190);
|
|
507
509
|
};
|
|
@@ -585,48 +587,45 @@ function ioSBPlayer(server, playerdata) {
|
|
|
585
587
|
value = decodeURIComponent(m[1]);
|
|
586
588
|
}
|
|
587
589
|
}
|
|
588
|
-
this.artisthandling = true;
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
if (Object.prototype.hasOwnProperty.call(playerdata, "artist")) {
|
|
592
|
-
value = playerdata["artist"];
|
|
593
|
-
}
|
|
594
|
-
if (Object.prototype.hasOwnProperty.call(playerdata, "composer")) {
|
|
595
|
-
value = playerdata["composer"];
|
|
596
|
-
}
|
|
597
|
-
if (Object.prototype.hasOwnProperty.call(playerdata, "conductor")) {
|
|
598
|
-
value = playerdata["conductor"];
|
|
599
|
-
}
|
|
600
|
-
if (Object.prototype.hasOwnProperty.call(playerdata, "band")) {
|
|
601
|
-
value = playerdata["band"];
|
|
602
|
-
}
|
|
603
|
-
if (Object.prototype.hasOwnProperty.call(playerdata, "albumartist")) {
|
|
604
|
-
value = playerdata["albumartist"];
|
|
605
|
-
}
|
|
606
|
-
if (Object.prototype.hasOwnProperty.call(playerdata, "trackartist")) {
|
|
607
|
-
value = playerdata["trackartist"];
|
|
608
|
-
}
|
|
609
|
-
playerdata["artisthandling"] = true;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
|
|
590
|
+
/* this.artisthandling = true;
|
|
591
|
+
if (key == "artist" && !playerdata["artisthandling"] && this.artisthandling == true) {
|
|
613
592
|
|
|
593
|
+
if (Object.prototype.hasOwnProperty.call(playerdata, "artist")) {
|
|
594
|
+
value = playerdata["artist"];
|
|
595
|
+
}
|
|
596
|
+
if (Object.prototype.hasOwnProperty.call(playerdata, "composer")) {
|
|
597
|
+
value = playerdata["composer"];
|
|
598
|
+
}
|
|
599
|
+
if (Object.prototype.hasOwnProperty.call(playerdata, "conductor")) {
|
|
600
|
+
value = playerdata["conductor"];
|
|
601
|
+
}
|
|
602
|
+
if (Object.prototype.hasOwnProperty.call(playerdata, "band")) {
|
|
603
|
+
value = playerdata["band"];
|
|
604
|
+
}
|
|
605
|
+
if (Object.prototype.hasOwnProperty.call(playerdata, "albumartist")) {
|
|
606
|
+
value = playerdata["albumartist"];
|
|
607
|
+
}
|
|
608
|
+
if (Object.prototype.hasOwnProperty.call(playerdata, "trackartist")) {
|
|
609
|
+
value = playerdata["trackartist"];
|
|
610
|
+
}
|
|
611
|
+
playerdata["artisthandling"] = true;
|
|
612
|
+
} */
|
|
614
613
|
|
|
615
614
|
this.setState(this.sbPlayerStatusLoop[key].name, this.convertState(this.sbPlayerStatusLoop[key], value), this.statePath, this.playername);
|
|
616
615
|
} else {
|
|
617
616
|
if (key == "remote_title" && this.remote == 0) {
|
|
618
617
|
value = "";
|
|
619
618
|
}
|
|
620
|
-
if (key == "artist" && (Object.prototype.hasOwnProperty.call(playerdata, "albumartist") || "") == "") {
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
619
|
+
/* if (key == "artist" && (Object.prototype.hasOwnProperty.call(playerdata, "albumartist") || "") == "") {
|
|
620
|
+
value = "";
|
|
621
|
+
} else {
|
|
622
|
+
value = playerdata["albumartist"];
|
|
623
|
+
}
|
|
624
|
+
if (key == "albumartist" && (Object.prototype.hasOwnProperty.call(playerdata, "artist") || "") == "") {
|
|
625
|
+
value = "";
|
|
626
|
+
} else {
|
|
627
|
+
value = playerdata["artist"];
|
|
628
|
+
} */
|
|
630
629
|
if (fullStatus) this.setState(this.sbPlayerStatusLoop[key].name, this.convertState(this.sbPlayerStatusLoop[key], value), this.statePath, this.playername);
|
|
631
630
|
}
|
|
632
631
|
}
|
|
@@ -824,7 +823,7 @@ function ioSBPlayer(server, playerdata) {
|
|
|
824
823
|
};
|
|
825
824
|
this.createState = function (stateTemplate, level1path = false, level2path = false) {
|
|
826
825
|
const name = (level1path ? level1path + "." : "") + (level2path ? level2path + "." : "") + stateTemplate.name;
|
|
827
|
-
this.logsilly("Create
|
|
826
|
+
this.logsilly("Create state " + name);
|
|
828
827
|
if (!this.currentStates[name]) this.adapter.createState(level1path, level2path, stateTemplate.name, stateTemplate);
|
|
829
828
|
stateTemplate.exist = true;
|
|
830
829
|
return stateTemplate;
|
|
@@ -863,6 +862,52 @@ function ioSBPlayer(server, playerdata) {
|
|
|
863
862
|
this.adapter.setState(name, value, true);
|
|
864
863
|
}
|
|
865
864
|
};
|
|
865
|
+
this.createFolder = async function (foldername, level1path, level2path) {
|
|
866
|
+
const id = (level1path ? level1path + "." : "") + (level2path ? level2path + "." : "") + foldername;
|
|
867
|
+
this.logsilly("createFolder " + id);
|
|
868
|
+
if (await this.existsObjectAsync(id)) {
|
|
869
|
+
this.logsilly("Folder exists: " + id);
|
|
870
|
+
} else {
|
|
871
|
+
const obj = {
|
|
872
|
+
type: "folder",
|
|
873
|
+
common: {
|
|
874
|
+
name: foldername
|
|
875
|
+
},
|
|
876
|
+
native: {}
|
|
877
|
+
};
|
|
878
|
+
this.adapter.setObject(id, obj);
|
|
879
|
+
}
|
|
880
|
+
};
|
|
881
|
+
this.createDevice = async function (devicename, level1path, level2path) {
|
|
882
|
+
const id = (level1path ? level1path + "." : "") + (level2path ? level2path + "." : "") + devicename;
|
|
883
|
+
this.logsilly("createDevice " + id);
|
|
884
|
+
if (await this.existsObjectAsync(id)) {
|
|
885
|
+
this.logsilly("Device exists: " + id);
|
|
886
|
+
} else {
|
|
887
|
+
const obj = {
|
|
888
|
+
type: "device",
|
|
889
|
+
common: {
|
|
890
|
+
name: devicename
|
|
891
|
+
},
|
|
892
|
+
native: {}
|
|
893
|
+
};
|
|
894
|
+
this.adapter.setObject(id, obj);
|
|
895
|
+
}
|
|
896
|
+
};
|
|
897
|
+
this.existsObjectAsync = function (id) {
|
|
898
|
+
return new Promise((resolve, reject) => {
|
|
899
|
+
id = this.adapter.namespace + "." + id;
|
|
900
|
+
|
|
901
|
+
this.adapter.getForeignObject(id, (err, obj) => {
|
|
902
|
+
if (err) {
|
|
903
|
+
reject(err);
|
|
904
|
+
} else {
|
|
905
|
+
resolve(!!obj);
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
});
|
|
909
|
+
});
|
|
910
|
+
};
|
|
866
911
|
this.convertState = function (stateTemplate, value) {
|
|
867
912
|
if (stateTemplate.type == "string") return String(value);
|
|
868
913
|
if (stateTemplate.type == "number") return Number(value);
|