This commit is contained in:
Fredrik Burmester
2024-10-06 13:03:16 +02:00
parent cc242a971f
commit 0233862fc1
13 changed files with 941 additions and 391 deletions

View File

@@ -133,7 +133,7 @@ const saveSettings = async (settings: Settings) => {
};
// Create an atom to store the settings in memory
const settingsAtom = atom<Settings | null>(null);
export const settingsAtom = atom<Settings | null>(null);
// A hook to manage settings, loading them on initial mount and providing a way to update them
export const useSettings = () => {

View File

@@ -1,15 +1,12 @@
import ios from "@/utils/profiles/ios";
import iosFmp4 from "@/utils/profiles/iosFmp4";
import { Api } from "@jellyfin/sdk";
import {
BaseItemDto,
MediaSourceInfo,
PlaybackInfoResponse,
} from "@jellyfin/sdk/lib/generated-client/models";
import { getMediaInfoApi } from "@jellyfin/sdk/lib/utils/api";
import { getAuthHeaders } from "../jellyfin";
import iosFmp4 from "@/utils/profiles/iosFmp4";
import { getItemsApi, getMediaInfoApi } from "@jellyfin/sdk/lib/utils/api";
import { isPlainObject } from "lodash";
import { Alert } from "react-native";
export const getStreamUrl = async ({
api,
@@ -64,14 +61,7 @@ export const getStreamUrl = async ({
},
}
);
const mediaSourceId = res0.data.MediaSources?.[0].Id;
const liveStreamId = res0.data.MediaSources?.[0].LiveStreamId;
const transcodeUrl = res0.data.MediaSources?.[0].TranscodingUrl;
console.log("transcodeUrl", transcodeUrl);
if (transcodeUrl) return `${api.basePath}${transcodeUrl}`;
}
@@ -131,7 +121,9 @@ export const getStreamUrl = async ({
url = `${api.basePath}${mediaSource.TranscodingUrl}`;
}
if (!url) throw new Error("No url");
if (!url) {
return null;
}
return url;
};