mirror of
https://git.wetfence.xyz/RandyTheSilly/jellyPod.git
synced 2026-10-26 15:29:57 -04:00
Queue 100 songs at a time
This commit is contained in:
1 parent
1fb2b35b75
commit
f8ef8b5667
1 file changed
+8
-1
+8
-1
@@ -222,6 +222,13 @@ function payloadGet(payload, name) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function ringSlice(arr, start, end) {
|
||||
const n = arr.length;
|
||||
if (n === 0) return [];
|
||||
const count = Math.max(0, end + 1 - start);
|
||||
return Array.from({ length: count }, (_, k) => arr[(((start + k) % n) + n) % n]);
|
||||
}
|
||||
|
||||
Pebble.addEventListener("appmessage", function (dict) {
|
||||
//console.log("payload", JSON.stringify(dict.payload));
|
||||
//console.log("expected NAV_SCOPE key", keys.BIDIR_MENU_NAV_SCOPE);
|
||||
@@ -231,7 +238,7 @@ Pebble.addEventListener("appmessage", function (dict) {
|
||||
const seqId = payloadGet(dict.payload, "OUT_PLAY_SEQ_ID");
|
||||
|
||||
if (seqId !== undefined) {
|
||||
callAPI("POST", cfg.PRIV_BASE_URL + "/Sessions/" + jfSessionId + "/Playing?playCommand=PlayNow&itemIds=" + allJfIds[seqId], null);
|
||||
callAPI("POST", cfg.PRIV_BASE_URL + "/Sessions/" + jfSessionId + "/Playing?playCommand=PlayNow&itemIds=" + ringSlice(allJfIds, seqId, seqId+99), null);
|
||||
}
|
||||
|
||||
if (scope !== undefined) {
|
||||
|
||||
Reference in new issue
Block a user