Jellyfin end to end: per-viewer playback, progress, episodes, swap browser

- Host/swap send refs only; pasted Jellyfin links become refs; the host
  hands the relay its own app-obtained credential.
- Each viewer resolves with their own account (token in a header) or
  via the relay, else a clear blocked card with Link account.
- Per-account progress reporting (Playing/Progress/Stopped), 401 marks
  the account expired.
- Previous/next episode in the controls (< > / Shift+P/N), floating
  Next episode pill near the end, auto-advance countdown (one
  designated swapper), track carry-over per series.
- Swap panel uses the shared MediaPicker; browser location remembered
  per server and opens on the current series.
- Fix: states are applied one at a time (a stale pause could land
  after a newer play).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
foxyzandClaude Opus 5.5 committed 2026-10-07 02:38:24 +03:00
1 parent 773a04369e
commit ae4edc29e8
33 files changed
+3541 -175

No files matched your search

@@ -131,6 +131,27 @@ class ServerIsolate {
if (!_stopping) crash?.call(_lastError ?? 'the server stopped unexpectedly');
}
/// Makes [path] the hosted file (the in-session File swap). Returns its
/// name and size for the `swap` that puts it up, or null when the file
/// is missing or the server is gone.
Future<({String name, int size})?> setFile(String path,
{Duration timeout = const Duration(seconds: 5)}) async {
if (_exited.isCompleted) return null;
final reply = ReceivePort('server file');
try {
_stop.send({'t': 'file', 'path': path, 'reply': reply.sendPort});
final msg = await reply.first.timeout(timeout);
if (msg is Map && msg['ok'] == true) {
return (name: msg['name'] as String, size: msg['size'] as int);
}
return null;
} catch (_) {
return null;
} finally {
reply.close();
}
}
/// Asks the server to close its sockets and exit; kills the isolate if it
/// has not exited within [timeout].
Future<void> stop({Duration timeout = const Duration(seconds: 3)}) async {