fix: sync queue insert/append to native Android player

Both 'Als Nächstes einfügen' and 'Am Ende der Queue' updated S.queue in JS
but never called NSBridge, so the native ExoPlayer ignored the change and
kept playing the original next item.

- Export nativeInsertAt(song, position) from player.js
- Call it in showCtxMenu with the exact splice index for insert-next
  and -1 (append) for add-to-end

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-18 22:27:25 +02:00
1 parent e893b7cc12
commit 68bec67880
2 files changed
+13 -3

No files matched your search

+6
View File
@@ -49,6 +49,12 @@ function _pushQueueIfBridge() {
} catch (e) { console.warn('NSBridge.setQueue failed', e); }
}
// Insert a single song into the native queue at the given index (-1 = append).
export function nativeInsertAt(song, position) {
if (!HAS_BRIDGE) return;
try { window.NSBridge.addToQueue(JSON.stringify(_trackToNative(song)), position); } catch(_) {}
}
// Convert a single Navidrome song to the NSBridge Track schema (used for addToQueue).
function _trackToNative(s) {
return {