diff --git a/server/index.js b/server/index.js index cee92d5..03b1e58 100644 --- a/server/index.js +++ b/server/index.js @@ -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';