Split software arch desc for easier manintenance. Many fixes related to next video playing and remote playback
🏗️ Build and Test JellyTau / Run Tests (push) Failing after 12s
🏗️ Build and Test JellyTau / Build Android APK (push) Has been skipped
Traceability Validation / Check Requirement Traces (push) Failing after 1s

This commit is contained in:
2026-03-01 19:47:46 +01:00
parent 3a9c126dfe
commit 09780103a7
45 changed files with 5663 additions and 3332 deletions
+27 -9
View File
@@ -255,10 +255,14 @@ function createPlaybackModeStore() {
}
/**
* Monitor remote session for disconnection
* Monitor remote session for disconnection with grace period.
* Requires multiple consecutive misses before declaring disconnection
* to tolerate transient network hiccups.
*/
function initializeSessionMonitoring(): void {
// Subscribe to session changes
let consecutiveMisses = 0;
const DISCONNECT_THRESHOLD = 3; // ~6s at 2s polling interval
selectedSession.subscribe((session) => {
const currentState = get({ subscribe });
@@ -266,14 +270,28 @@ function createPlaybackModeStore() {
// Don't interfere during an active transfer (we intentionally clear the session)
if (currentState.mode === "remote" && currentState.remoteSessionId && !currentState.isTransferring) {
if (!session || session.id !== currentState.remoteSessionId || !session.supportsMediaControl) {
console.warn("[PlaybackMode] Remote session lost or disconnected");
update((s) => ({
...s,
mode: "idle",
remoteSessionId: null,
transferError: "Remote session disconnected",
}));
consecutiveMisses++;
console.warn(`[PlaybackMode] Remote session miss ${consecutiveMisses}/${DISCONNECT_THRESHOLD}`);
if (consecutiveMisses >= DISCONNECT_THRESHOLD) {
console.warn("[PlaybackMode] Remote session lost after sustained disconnection");
consecutiveMisses = 0;
update((s) => ({
...s,
mode: "idle",
remoteSessionId: null,
transferError: "Remote session disconnected",
}));
}
} else {
// Session is healthy, reset counter
if (consecutiveMisses > 0) {
console.log("[PlaybackMode] Remote session recovered after", consecutiveMisses, "misses");
}
consecutiveMisses = 0;
}
} else {
consecutiveMisses = 0;
}
});
}
+11 -6
View File
@@ -228,15 +228,20 @@ export const mergedVolume = derived(
/**
* Should show audio miniplayer - state machine gated
* Only true when:
* 1. Player is in playing or paused state (not idle, loading, error)
* 2. Current media is audio (not video: Movie or Episode)
* 1. In remote mode with an active session playing media, OR
* 2. Player is in playing or paused state (not idle, loading, error)
* AND current media is audio (not video: Movie or Episode)
*/
export const shouldShowAudioMiniPlayer = derived(
[player, currentMedia],
([$player, $media]) => {
const state = $player.state;
[player, currentMedia, isRemoteMode, selectedSession],
([$player, $media, $isRemote, $session]) => {
// In remote mode, show if the remote session has a now-playing item
if ($isRemote && $session?.nowPlayingItem) {
return true;
}
// Only show when actively playing or paused
// Local mode: only show when actively playing or paused
const state = $player.state;
if (state.kind !== "playing" && state.kind !== "paused") {
return false;
}