roonpipe 1.0.2 → 1.0.3
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/dist/mpris.js +1 -0
- package/dist/roon.js +21 -6
- package/package.json +1 -1
package/dist/mpris.js
CHANGED
package/dist/roon.js
CHANGED
|
@@ -32,10 +32,11 @@ function initRoon(callbacks) {
|
|
|
32
32
|
const roon = new node_roon_api_1.default({
|
|
33
33
|
extension_id: "com.bluemancz.roonpipe",
|
|
34
34
|
display_name: "RoonPipe",
|
|
35
|
-
display_version: "1.0.
|
|
35
|
+
display_version: "1.0.3",
|
|
36
36
|
publisher: "BlueManCZ",
|
|
37
37
|
email: "your@email.com",
|
|
38
38
|
website: "https://github.com/bluemancz/roonpipe",
|
|
39
|
+
log_level: "none",
|
|
39
40
|
core_paired: (core) => {
|
|
40
41
|
coreInstance = core;
|
|
41
42
|
const transport = core.services.RoonApiTransport;
|
|
@@ -59,7 +60,7 @@ function initRoon(callbacks) {
|
|
|
59
60
|
}
|
|
60
61
|
if (data.zones_seek_changed) {
|
|
61
62
|
const seekUpdate = data.zones_seek_changed.find((z) => z.zone_id === (zone === null || zone === void 0 ? void 0 : zone.zone_id));
|
|
62
|
-
if (seekUpdate && zone) {
|
|
63
|
+
if (seekUpdate && (zone === null || zone === void 0 ? void 0 : zone.now_playing)) {
|
|
63
64
|
zone.now_playing.seek_position = seekUpdate.seek_position;
|
|
64
65
|
callbacks.onSeekChanged(seekUpdate.seek_position * 1000000);
|
|
65
66
|
}
|
|
@@ -135,7 +136,6 @@ function searchRoon(query) {
|
|
|
135
136
|
title: item.title || "Unknown",
|
|
136
137
|
subtitle: item.subtitle || "",
|
|
137
138
|
item_key: item.item_key,
|
|
138
|
-
image_key: item.image_key,
|
|
139
139
|
image: cachedImages.get(item.image_key) || null,
|
|
140
140
|
hint: item.hint,
|
|
141
141
|
sessionKey: sessionKey,
|
|
@@ -169,12 +169,27 @@ function skipToNext() {
|
|
|
169
169
|
});
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* Check if there's an active queue (something is playing or paused)
|
|
174
|
+
*/
|
|
175
|
+
function hasActiveQueue() {
|
|
176
|
+
if (!zone)
|
|
177
|
+
return false;
|
|
178
|
+
return zone.now_playing && (zone.state === "playing" || zone.state === "paused");
|
|
179
|
+
}
|
|
172
180
|
function playItem(itemKey_1, sessionKey_1) {
|
|
173
181
|
return __awaiter(this, arguments, void 0, function* (itemKey, sessionKey, action = "play") {
|
|
174
|
-
// "playNow" =
|
|
182
|
+
// "playNow" = preserve the queue if possible.
|
|
175
183
|
if (action === "playNow") {
|
|
176
|
-
|
|
177
|
-
|
|
184
|
+
if (hasActiveQueue()) {
|
|
185
|
+
// If the queue exists: add next + skip to it
|
|
186
|
+
yield playItemInternal(itemKey, sessionKey, "addNext");
|
|
187
|
+
yield skipToNext();
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
// If no queue: use the regular "Play now" action
|
|
191
|
+
yield playItemInternal(itemKey, sessionKey, "play");
|
|
192
|
+
}
|
|
178
193
|
return;
|
|
179
194
|
}
|
|
180
195
|
return playItemInternal(itemKey, sessionKey, action);
|