Compare commits

..

2 Commits

Author SHA1 Message Date
lance chant
b39eb35795 Merge branch 'develop' into jellyfin-12-fixes 2026-07-15 08:36:40 +02:00
Simon Eklundh
fbeb025d73 fix: jellyfin 12 fixes 2026-07-14 16:13:49 +02:00
8 changed files with 37 additions and 32 deletions

View File

@@ -85,8 +85,7 @@ configureReanimatedLogger({
if (!Platform.isTV) { if (!Platform.isTV) {
Notifications.setNotificationHandler({ Notifications.setNotificationHandler({
handleNotification: async () => ({ handleNotification: async () => ({
shouldShowBanner: true, shouldShowAlert: true,
shouldShowList: true,
shouldPlaySound: true, shouldPlaySound: true,
shouldSetBadge: false, shouldSetBadge: false,
}), }),
@@ -351,12 +350,9 @@ function Layout() {
notificationListener.current = notificationListener.current =
Notifications?.addNotificationReceivedListener( Notifications?.addNotificationReceivedListener(
(notification: Notification) => { (notification: Notification) => {
// Log only the title — serializing the whole notification touches
// the deprecated dataString getter (deprecation warning) and dumps
// noisy payloads into the console.
console.log( console.log(
"Notification received while app running:", "Notification received while app running",
notification.request.content.title, notification,
); );
}, },
); );

View File

@@ -221,22 +221,33 @@ const HomeMobile = () => {
queryKey, queryKey,
queryFn: async ({ pageParam = 0 }) => { queryFn: async ({ pageParam = 0 }) => {
if (!api) return []; if (!api) return [];
// getLatestMedia doesn't support startIndex, so we fetch all and slice client-side // Use getItems (not getLatestMedia) so we get item-level results
const allData = // filtered by type from a specific library. getLatestMedia is
( // episode-oriented and groups results, which drops Series when
await getUserLibraryApi(api).getLatestMedia({ // combined with a parentId + includeItemTypes filter.
userId: user?.Id, //
limit: 10, // The specific reason for this is jellyfin 12.0 returns episodes, seasons, or shows,
fields: ["PrimaryImageAspectRatio"], // but we only handle shows in our recently added in [shows] section. So we need to filter by type at the item level.
imageTypeLimit: 1, //
enableImageTypes: ["Primary", "Backdrop", "Thumb"], // For Series we sort by DateLastContentAdded so shows bubble up when
includeItemTypes, // a new episode is added (series cards for new episodes, matching how
parentId, // Jellyfin's "Latest" row worked pre-12.0). Movies use DateCreated.
}) const response = await getItemsApi(api).getItems({
).data || []; userId: user?.Id,
parentId,
// Simulate pagination by slicing includeItemTypes,
return allData.slice(pageParam, pageParam + pageSize); recursive: true,
sortBy: includeItemTypes.includes("Series")
? ["DateLastContentAdded"]
: ["DateCreated"],
sortOrder: ["Descending"],
startIndex: pageParam,
limit: pageSize,
fields: ["PrimaryImageAspectRatio"],
imageTypeLimit: 1,
enableImageTypes: ["Primary", "Backdrop", "Thumb"],
});
return response.data.Items || [];
}, },
type: "InfiniteScrollingCollectionList", type: "InfiniteScrollingCollectionList",
pageSize, pageSize,
@@ -250,9 +261,7 @@ const HomeMobile = () => {
const latestMediaViews = collections.map((c) => { const latestMediaViews = collections.map((c) => {
const includeItemTypes: BaseItemKind[] = const includeItemTypes: BaseItemKind[] =
c.CollectionType === "tvshows" || c.CollectionType === "movies" c.CollectionType === "tvshows" ? ["Series"] : ["Movie"];
? []
: ["Movie"];
const title = t("home.recently_added_in", { libraryName: c.Name }); const title = t("home.recently_added_in", { libraryName: c.Name });
const queryKey: string[] = [ const queryKey: string[] = [
"home", "home",

View File

@@ -173,7 +173,7 @@ export const WebSocketProvider = ({ children }: WebSocketProviderProps) => {
const protocol = api.basePath.includes("https") ? "wss" : "ws"; const protocol = api.basePath.includes("https") ? "wss" : "ws";
const url = `${protocol}://${api.basePath const url = `${protocol}://${api.basePath
.replace("https://", "") .replace("https://", "")
.replace("http://", "")}/socket?api_key=${ .replace("http://", "")}/socket?ApiKey=${
api.accessToken api.accessToken
}&deviceId=${deviceId}`; }&deviceId=${deviceId}`;

View File

@@ -52,7 +52,7 @@ export const getAudioStreamUrl = async (
container: mediaSource?.Container || "mp3", container: mediaSource?.Container || "mp3",
mediaSourceId: mediaSource?.Id || "", mediaSourceId: mediaSource?.Id || "",
deviceId: api.deviceInfo.id, deviceId: api.deviceInfo.id,
api_key: api.accessToken, ApiKey: api.accessToken,
userId, userId,
}); });

View File

@@ -50,7 +50,7 @@ export const getDownloadUrl = async ({
if (maxBitrate.key === "Max" && !streamDetails?.mediaSource?.TranscodingUrl) { if (maxBitrate.key === "Max" && !streamDetails?.mediaSource?.TranscodingUrl) {
console.log("Downloading item directly"); console.log("Downloading item directly");
return { return {
url: `${api.basePath}/Items/${mediaSource.Id}/Download?api_key=${api.accessToken}`, url: `${api.basePath}/Items/${mediaSource.Id}/Download?ApiKey=${api.accessToken}`,
mediaSource: streamDetails?.mediaSource ?? null, mediaSource: streamDetails?.mediaSource ?? null,
}; };
} }

View File

@@ -40,7 +40,7 @@ export const getPlaybackUrl = async (
const queryParams = new URLSearchParams({ const queryParams = new URLSearchParams({
deviceId: api.deviceInfo?.id || "", deviceId: api.deviceInfo?.id || "",
api_key: api.accessToken || "", ApiKey: api.accessToken || "",
Tag: ETag || "", Tag: ETag || "",
MediaSourceId: Id || "", MediaSourceId: Id || "",
}); });

View File

@@ -73,7 +73,7 @@ const getPlaybackUrl = (
subtitleStreamIndex: params.subtitleStreamIndex?.toString() || "", subtitleStreamIndex: params.subtitleStreamIndex?.toString() || "",
audioStreamIndex: params.audioStreamIndex?.toString() || "", audioStreamIndex: params.audioStreamIndex?.toString() || "",
deviceId: params.deviceId || api.deviceInfo.id, deviceId: params.deviceId || api.deviceInfo.id,
api_key: api.accessToken, ApiKey: api.accessToken,
startTimeTicks: params.startTimeTicks?.toString() || "0", startTimeTicks: params.startTimeTicks?.toString() || "0",
maxStreamingBitrate: params.maxStreamingBitrate?.toString() || "", maxStreamingBitrate: params.maxStreamingBitrate?.toString() || "",
userId: params.userId, userId: params.userId,

View File

@@ -61,5 +61,5 @@ export const generateTrickplayUrl = (item: BaseItemDto, sheetIndex: number) => {
const api = store.get(apiAtom); const api = store.get(apiAtom);
const resolution = getTrickplayInfo(item)?.resolution; const resolution = getTrickplayInfo(item)?.resolution;
if (!resolution || !api) return null; if (!resolution || !api) return null;
return `${api.basePath}/Videos/${item.Id}/Trickplay/${resolution}/${sheetIndex}.jpg?api_key=${api.accessToken}`; return `${api.basePath}/Videos/${item.Id}/Trickplay/${resolution}/${sheetIndex}.jpg?ApiKey=${api.accessToken}`;
}; };