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);
|
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';
|
||||||
|
|||||||
Reference in New Issue
Block a user