fix: offline playback using player component

This commit is contained in:
Fredrik Burmester
2024-11-24 10:36:06 +01:00
parent 55f8af7069
commit 6a50eb9044
13 changed files with 177 additions and 1328 deletions

View File

@@ -34,13 +34,10 @@ export const useDownloadedFileOpener = () => {
const openFile = useCallback(
async (item: BaseItemDto) => {
try {
const url = await getDownloadedFileUrl(item.Id!);
setOfflineSettings({
item,
});
setPlayUrl(url);
console.log(
"Go to offline movie",
"/player?offline=true&itemId=" + item.Id
);
// @ts-expect-error
router.push("/player?offline=true&itemId=" + item.Id);
} catch (error) {

View File

@@ -71,10 +71,7 @@ export const useRemuxHlsToMp4 = () => {
id: "",
deviceId: "",
inputUrl: "",
item: {
item,
mediaSource,
},
item: item,
itemId: item.Id!,
outputPath: "",
progress: 0,
@@ -119,7 +116,7 @@ export const useRemuxHlsToMp4 = () => {
if (returnCode.isValueSuccess()) {
if (!item) throw new Error("Item is undefined");
await saveDownloadedItemInfo(item, mediaSource);
await saveDownloadedItemInfo(item);
toast.success("Download completed");
writeToLog(
"INFO",