mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-01 19:48:28 +01:00
Sync subtitle and audio indexes between server and offline
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { useCallback } from "react";
|
||||
import useRouter from "@/hooks/useAppRouter";
|
||||
import { getDownloadedItemById } from "@/providers/Downloads/database";
|
||||
import { usePlaySettings } from "@/providers/PlaySettingsProvider";
|
||||
import { writeToLog } from "@/utils/log";
|
||||
|
||||
@@ -15,9 +16,14 @@ export const useDownloadedFileOpener = () => {
|
||||
console.error("Attempted to open a file without an ID.");
|
||||
return;
|
||||
}
|
||||
const downloadedItem = getDownloadedItemById(item.Id);
|
||||
const queryParams = new URLSearchParams({
|
||||
itemId: item.Id,
|
||||
offline: "true",
|
||||
audioIndex:
|
||||
downloadedItem?.userData?.audioStreamIndex?.toString() ?? "",
|
||||
subtitleIndex:
|
||||
downloadedItem?.userData?.subtitleStreamIndex?.toString() ?? "-1",
|
||||
playbackPosition:
|
||||
item.UserData?.PlaybackPositionTicks?.toString() ?? "0",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user