Enable seeking for Jellyfin downloads
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user