diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index 13c4ffd8da..2d11691e95 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -131,8 +131,6 @@ function onLibraryChanged(data, apiClient) { newItems.length = 12; } - // call getItems from jellyfin-apiclient/getItems.ts instead of apiClient.getItems() - // to split up into multiple requests if necessary (URL might get too long) getItems(apiClient, apiClient.getCurrentUserId(), { Recursive: true, diff --git a/src/components/playback/playbackmanager.js b/src/components/playback/playbackmanager.js index 0d0434c972..14c841bea5 100644 --- a/src/components/playback/playbackmanager.js +++ b/src/components/playback/playbackmanager.js @@ -128,8 +128,6 @@ function getItemsForPlayback(serverId, query) { query.EnableTotalRecordCount = false; query.CollapseBoxSetItems = false; - // call getItems from jellyfin-apiclient/getItems.ts instead of apiClient.getItems() - // to split up into multiple requests if necessary (URL might get too long) return getItems(apiClient, apiClient.getCurrentUserId(), query); } } diff --git a/src/plugins/chromecastPlayer/plugin.js b/src/plugins/chromecastPlayer/plugin.js index d4aca76a3d..a656337d63 100644 --- a/src/plugins/chromecastPlayer/plugin.js +++ b/src/plugins/chromecastPlayer/plugin.js @@ -483,8 +483,6 @@ function getItemsForPlayback(apiClient, query) { query.ExcludeLocationTypes = 'Virtual'; query.EnableTotalRecordCount = false; - // call getItems from jellyfin-apiclient/getItems.ts instead of apiClient.getItems() - // to split up into multiple requests if necessary (URL might get too long) return getItems(apiClient, userId, query); } } diff --git a/src/plugins/syncPlay/core/Helper.js b/src/plugins/syncPlay/core/Helper.js index 364217e980..47f25578a3 100644 --- a/src/plugins/syncPlay/core/Helper.js +++ b/src/plugins/syncPlay/core/Helper.js @@ -89,8 +89,6 @@ export function getItemsForPlayback(apiClient, query) { query.EnableTotalRecordCount = false; query.CollapseBoxSetItems = false; - // call getItems from jellyfin-apiclient/getItems.ts instead of apiClient.getItems() - // to split up into multiple requests if necessary (URL might get too long) return getItems(apiClient, apiClient.getCurrentUserId(), query); } } diff --git a/src/utils/jellyfin-apiclient/getItems.ts b/src/utils/jellyfin-apiclient/getItems.ts index c47e707cca..03f242ac0d 100644 --- a/src/utils/jellyfin-apiclient/getItems.ts +++ b/src/utils/jellyfin-apiclient/getItems.ts @@ -49,6 +49,14 @@ function mergeResults(results: BaseItemDtoQueryResult[]) { return merged; } +/** + * Transparently handles the call to apiClient.getItems splitting the + * call into multiple ones if the URL might get too long. + * @param apiClient The ApiClient to use + * @param userId User id to pass to actual getItems call + * @param options Options object to specify getItems option. This includes a possibly long Items list that will be split up. + * @returns A promise that resolves to the merged result of all getItems calls + */ export function getItems(apiClient: ApiClient, userId: string, options?: any) { if (options.Ids?.split(',').length <= ITEMS_PER_REQUEST_LIMIT) { return apiClient.getItems(apiClient.getCurrentUserId(), options);