mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-04-21 00:04:42 +01:00
wip
This commit is contained in:
@@ -73,7 +73,8 @@ export type Settings = {
|
||||
forwardSkipTime: number;
|
||||
rewindSkipTime: number;
|
||||
optimizedVersionsServerUrl?: string | null;
|
||||
downloadMethod?: "optimized" | "remux";
|
||||
downloadMethod: "optimized" | "remux";
|
||||
autoDownload: boolean;
|
||||
};
|
||||
/**
|
||||
*
|
||||
@@ -110,6 +111,7 @@ const loadSettings = async (): Promise<Settings> => {
|
||||
rewindSkipTime: 10,
|
||||
optimizedVersionsServerUrl: null,
|
||||
downloadMethod: "remux",
|
||||
autoDownload: false,
|
||||
};
|
||||
|
||||
try {
|
||||
|
||||
23
utils/background-tasks.ts
Normal file
23
utils/background-tasks.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import * as BackgroundFetch from "expo-background-fetch";
|
||||
|
||||
export const BACKGROUND_FETCH_TASK = "background-fetch";
|
||||
|
||||
export async function registerBackgroundFetchAsync() {
|
||||
try {
|
||||
BackgroundFetch.registerTaskAsync(BACKGROUND_FETCH_TASK, {
|
||||
minimumInterval: 60 * 1, // 1 minutes
|
||||
stopOnTerminate: false, // android only,
|
||||
startOnBoot: false, // android only
|
||||
});
|
||||
} catch (error) {
|
||||
console.log("Error registering background fetch task", error);
|
||||
}
|
||||
}
|
||||
|
||||
export async function unregisterBackgroundFetchAsync() {
|
||||
try {
|
||||
BackgroundFetch.unregisterTaskAsync(BACKGROUND_FETCH_TASK);
|
||||
} catch (error) {
|
||||
console.log("Error unregistering background fetch task", error);
|
||||
}
|
||||
}
|
||||
@@ -53,6 +53,11 @@ export async function getAllJobsByDeviceId({
|
||||
},
|
||||
});
|
||||
if (statusResponse.status !== 200) {
|
||||
console.error(
|
||||
statusResponse.status,
|
||||
statusResponse.data,
|
||||
statusResponse.statusText
|
||||
);
|
||||
throw new Error("Failed to fetch job status");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user