1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add JSDoc comment to getItems helper

In return the comments at each usage are removed.
This commit is contained in:
Merlin Danner 2023-03-29 07:44:21 +02:00
parent d8bbba2dc9
commit 06c4f0f258
5 changed files with 8 additions and 8 deletions

View file

@ -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,

View file

@ -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);
}
}

View file

@ -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);
}
}

View file

@ -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);
}
}

View file

@ -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);