mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-07-18 18:24:18 +01:00
wip: external subs and cleanup
This commit is contained in:
@@ -174,7 +174,7 @@ function useDownloadProvider() {
|
||||
url: settings?.optimizedVersionsServerUrl,
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
console.error(error);
|
||||
}
|
||||
},
|
||||
[settings?.optimizedVersionsServerUrl, authHeader]
|
||||
@@ -184,7 +184,6 @@ function useDownloadProvider() {
|
||||
async (process: JobStatus) => {
|
||||
if (!process?.item.Id || !authHeader) throw new Error("No item id");
|
||||
|
||||
console.log("[0] Setting process to downloading");
|
||||
setProcesses((prev) =>
|
||||
prev.map((p) =>
|
||||
p.id === process.id
|
||||
@@ -239,7 +238,6 @@ function useDownloadProvider() {
|
||||
})
|
||||
.progress((data) => {
|
||||
const percent = (data.bytesDownloaded / data.bytesTotal) * 100;
|
||||
console.log("Download progress:", percent);
|
||||
setProcesses((prev) =>
|
||||
prev.map((p) =>
|
||||
p.id === process.id
|
||||
@@ -467,7 +465,6 @@ function useDownloadProvider() {
|
||||
if (itemNameWithoutExtension === id) {
|
||||
const filePath = `${directory}${item}`;
|
||||
await FileSystem.deleteAsync(filePath, { idempotent: true });
|
||||
console.log(`Successfully deleted file: ${item}`);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -480,10 +477,6 @@ function useDownloadProvider() {
|
||||
}
|
||||
|
||||
queryClient.invalidateQueries({ queryKey: ["downloadedItems"] });
|
||||
|
||||
console.log(
|
||||
`Successfully deleted file and AsyncStorage entry for ID ${id}`
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
`Failed to delete file and AsyncStorage entry for ID ${id}:`,
|
||||
|
||||
@@ -7,6 +7,7 @@ import old from "@/utils/profiles/old";
|
||||
import {
|
||||
BaseItemDto,
|
||||
MediaSourceInfo,
|
||||
PlaybackInfoResponse,
|
||||
} from "@jellyfin/sdk/lib/generated-client";
|
||||
import { getSessionApi } from "@jellyfin/sdk/lib/utils/api";
|
||||
import { useAtomValue } from "jotai";
|
||||
@@ -30,6 +31,7 @@ export type PlaybackType = {
|
||||
|
||||
type PlaySettingsContextType = {
|
||||
playSettings: PlaybackType | null;
|
||||
mediaSource: MediaSourceInfo | null;
|
||||
setPlaySettings: (
|
||||
dataOrUpdater:
|
||||
| PlaybackType
|
||||
@@ -51,6 +53,7 @@ export const PlaySettingsProvider: React.FC<{ children: React.ReactNode }> = ({
|
||||
children,
|
||||
}) => {
|
||||
const [playSettings, _setPlaySettings] = useState<PlaybackType | null>(null);
|
||||
const [mediaSource, setMediaSource] = useState<MediaSourceInfo | null>(null);
|
||||
const [playUrl, setPlayUrl] = useState<string | null>(null);
|
||||
const [playSessionId, setPlaySessionId] = useState<string | null>(null);
|
||||
|
||||
@@ -109,11 +112,10 @@ export const PlaySettingsProvider: React.FC<{ children: React.ReactNode }> = ({
|
||||
forceDirectPlay: settings.forceDirectPlay,
|
||||
});
|
||||
|
||||
console.log("getStreamUrl ~ ", data?.url);
|
||||
|
||||
_setPlaySettings(newSettings);
|
||||
setPlayUrl(data?.url!);
|
||||
setPlaySessionId(data?.sessionId!);
|
||||
setMediaSource(data?.mediaSource!);
|
||||
|
||||
return data;
|
||||
} catch (error) {
|
||||
@@ -158,6 +160,7 @@ export const PlaySettingsProvider: React.FC<{ children: React.ReactNode }> = ({
|
||||
setMusicPlaySettings,
|
||||
setOfflineSettings,
|
||||
playSessionId,
|
||||
mediaSource,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user