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);
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) {
startSessionMetadataProbe(session);
@@ -982,12 +982,18 @@ function canBestEffortResumeWithoutDuration(session) {
function isLikelyRecordedMediaUrl(value) {
try {
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 {
return false;
}
}
function isJellyfinRecordedMediaPath(pathname) {
return /^\/items\/[^/]+\/download\/?$/i.test(pathname)
|| /^\/videos\/[^/]+\/stream\/?$/i.test(pathname);
}
function getSessionPlaybackConnectionMode(session) {
if (session.sourceKind === 'local') {
return 'split';