Enable seeking for Jellyfin downloads

This commit is contained in:
2026-07-11 14:50:03 -07:00
parent 06760a46b9
commit 91e96894b7

View File

@@ -227,7 +227,7 @@ app.post('/api/session', async (request, response) => {
sessions.set(id, session); sessions.set(id, session);
logInfo(`session created id=${shortId(id)} source=${source.kind} mode=${getSessionPlaybackConnectionMode(session)} fps=${options.fps} width=${options.width} quality=${options.quality}`); logInfo(`session created id=${shortId(id)} source=${source.kind} mode=${getSessionPlaybackConnectionMode(session)} metadata=${metadataStatus} fps=${options.fps} width=${options.width} quality=${options.quality}`);
if (shouldProbeMetadata) { if (shouldProbeMetadata) {
startSessionMetadataProbe(session); startSessionMetadataProbe(session);
@@ -982,12 +982,18 @@ function canBestEffortResumeWithoutDuration(session) {
function isLikelyRecordedMediaUrl(value) { function isLikelyRecordedMediaUrl(value) {
try { try {
const parsed = new URL(value); const parsed = new URL(value);
return RECORDED_MEDIA_EXTENSIONS.has(path.extname(parsed.pathname).toLowerCase()); return RECORDED_MEDIA_EXTENSIONS.has(path.extname(parsed.pathname).toLowerCase())
|| isJellyfinRecordedMediaPath(parsed.pathname);
} catch { } catch {
return false; return false;
} }
} }
function isJellyfinRecordedMediaPath(pathname) {
return /^\/items\/[^/]+\/download\/?$/i.test(pathname)
|| /^\/videos\/[^/]+\/stream\/?$/i.test(pathname);
}
function getSessionPlaybackConnectionMode(session) { function getSessionPlaybackConnectionMode(session) {
if (session.sourceKind === 'local') { if (session.sourceKind === 'local') {
return 'split'; return 'split';