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:
parent
d8bbba2dc9
commit
06c4f0f258
5 changed files with 8 additions and 8 deletions
|
@ -131,8 +131,6 @@ function onLibraryChanged(data, apiClient) {
|
||||||
newItems.length = 12;
|
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(), {
|
getItems(apiClient, apiClient.getCurrentUserId(), {
|
||||||
|
|
||||||
Recursive: true,
|
Recursive: true,
|
||||||
|
|
|
@ -128,8 +128,6 @@ function getItemsForPlayback(serverId, query) {
|
||||||
query.EnableTotalRecordCount = false;
|
query.EnableTotalRecordCount = false;
|
||||||
query.CollapseBoxSetItems = 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);
|
return getItems(apiClient, apiClient.getCurrentUserId(), query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -483,8 +483,6 @@ function getItemsForPlayback(apiClient, query) {
|
||||||
query.ExcludeLocationTypes = 'Virtual';
|
query.ExcludeLocationTypes = 'Virtual';
|
||||||
query.EnableTotalRecordCount = false;
|
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);
|
return getItems(apiClient, userId, query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,8 +89,6 @@ export function getItemsForPlayback(apiClient, query) {
|
||||||
query.EnableTotalRecordCount = false;
|
query.EnableTotalRecordCount = false;
|
||||||
query.CollapseBoxSetItems = 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);
|
return getItems(apiClient, apiClient.getCurrentUserId(), query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,14 @@ function mergeResults(results: BaseItemDtoQueryResult[]) {
|
||||||
return merged;
|
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) {
|
export function getItems(apiClient: ApiClient, userId: string, options?: any) {
|
||||||
if (options.Ids?.split(',').length <= ITEMS_PER_REQUEST_LIMIT) {
|
if (options.Ids?.split(',').length <= ITEMS_PER_REQUEST_LIMIT) {
|
||||||
return apiClient.getItems(apiClient.getCurrentUserId(), options);
|
return apiClient.getItems(apiClient.getCurrentUserId(), options);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue