From 2c546867a81bb4a78f17df2fc2ac6d0a47edb25a Mon Sep 17 00:00:00 2001 From: Alexander Welsing Date: Wed, 18 Feb 2026 03:45:31 +0100 Subject: [PATCH] change "Fields" query parameter to array (#1733) * change "Fields" query parameter to array * platformToTarget.key() -> to array --- scripts/after-all-artifact-build.mjs | 6 +-- .../api/jellyfin/jellyfin-controller.ts | 41 +++++++++++++++---- src/shared/api/jellyfin/jellyfin-types.ts | 6 +-- 3 files changed, 38 insertions(+), 15 deletions(-) diff --git a/scripts/after-all-artifact-build.mjs b/scripts/after-all-artifact-build.mjs index 69e9f3f04..4882e8431 100644 --- a/scripts/after-all-artifact-build.mjs +++ b/scripts/after-all-artifact-build.mjs @@ -15,9 +15,9 @@ const __dirname = path.dirname(__filename); // eslint-disable-next-line @typescript-eslint/explicit-function-return-type export default async function afterAllArtifactBuild(buildResult) { // Check if this build includes Linux as a target - const isLinux = buildResult.platformToTargets - .keys() - .some((platform) => platform.name === 'linux'); + const isLinux = Array.from(buildResult.platformToTargets.keys()).some( + (platform) => platform.name === 'linux', + ); if (isLinux) { const updateScriptPath = path.join(__dirname, 'update-app-stream.mjs'); diff --git a/src/renderer/api/jellyfin/jellyfin-controller.ts b/src/renderer/api/jellyfin/jellyfin-controller.ts index aaa37852b..1c4bb0e48 100644 --- a/src/renderer/api/jellyfin/jellyfin-controller.ts +++ b/src/renderer/api/jellyfin/jellyfin-controller.ts @@ -54,15 +54,38 @@ const VERSION_INFO: VersionInfo = [ ]; const JF_FIELDS = { - ALBUM_ARTIST_DETAIL: 'Genres, Overview, SortName, ProviderIds', - ALBUM_ARTIST_LIST: 'Genres, DateCreated, ExternalUrls, Overview, SortName, ProviderIds', - ALBUM_DETAIL: 'Genres, DateCreated, ChildCount, People, Tags, ProviderIds', - ALBUM_LIST: 'People, Tags, Studios, SortName, UserData, ProviderIds, ChildCount', - FOLDER: 'Genres, DateCreated, MediaSources, UserData, ParentId', - GENRE: 'ItemCounts', - PLAYLIST_DETAIL: 'Genres, DateCreated, MediaSources, ChildCount, ParentId, SortName', - PLAYLIST_LIST: 'ChildCount, Genres, DateCreated, ParentId, Overview', - SONG: 'Genres, DateCreated, MediaSources, ParentId, People, Tags, SortName, UserData, ProviderIds', + ALBUM_ARTIST_DETAIL: ['Genres', 'Overview', 'SortName', 'ProviderIds'], + ALBUM_ARTIST_LIST: [ + 'Genres', + 'DateCreated', + 'ExternalUrls', + 'Overview', + 'SortName', + 'ProviderIds', + ], + ALBUM_DETAIL: ['Genres', 'DateCreated', 'ChildCount', 'People', 'Tags', 'ProviderIds'], + ALBUM_LIST: ['People', 'Tags', 'Studios', 'SortName', 'ProviderIds', 'ChildCount'], + FOLDER: ['Genres', 'DateCreated', 'MediaSources', 'ParentId'], + GENRE: ['ItemCounts'], + PLAYLIST_DETAIL: [ + 'Genres', + 'DateCreated', + 'MediaSources', + 'ChildCount', + 'ParentId', + 'SortName', + ], + PLAYLIST_LIST: ['ChildCount', 'Genres', 'DateCreated', 'ParentId', 'Overview'], + SONG: [ + 'Genres', + 'DateCreated', + 'MediaSources', + 'ParentId', + 'People', + 'Tags', + 'SortName', + 'ProviderIds', + ], } as const; export const JellyfinController: InternalControllerEndpoint = { diff --git a/src/shared/api/jellyfin/jellyfin-types.ts b/src/shared/api/jellyfin/jellyfin-types.ts index ea35b07c1..7a02f3997 100644 --- a/src/shared/api/jellyfin/jellyfin-types.ts +++ b/src/shared/api/jellyfin/jellyfin-types.ts @@ -107,7 +107,7 @@ const baseParameters = z.object({ ExcludeArtistIds: z.string().optional(), ExcludeItemIds: z.string().optional(), ExcludeItemTypes: z.string().optional(), - Fields: z.string().optional(), + Fields: z.array(z.string()).readonly().optional(), FolderId: z.string().optional(), ImageTypeLimit: z.number().optional(), IncludeArtists: z.boolean().optional(), @@ -757,7 +757,7 @@ const serverInfo = z.object({ }); const similarSongsParameters = z.object({ - Fields: z.string().optional(), + Fields: z.array(z.string()).readonly().optional(), Limit: z.number().optional(), UserId: z.string().optional(), }); @@ -806,7 +806,7 @@ const folderList = pagination.extend({ }); const folderParameters = z.object({ - Fields: z.string().optional(), + Fields: z.array(z.string()).readonly().optional(), ParentId: z.string().optional(), SortBy: z.string().optional(), SortOrder: z.enum(sortOrderValues).optional(),