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

Use foreach for recently added sections

This commit is contained in:
Bill Thornton 2023-10-05 08:55:19 -04:00
parent 8149076fc5
commit 81c3a43601

View file

@ -139,20 +139,13 @@ export function loadRecentlyAdded(
const excludeViewTypes = ['playlists', 'livetv', 'boxsets', 'channels'];
const userExcludeItems = user.Configuration?.LatestItemsExcludes ?? [];
for (let i = 0, length = userViews.length; i < length; i++) {
const item = userViews[i];
if (
!item.Id
|| userExcludeItems.indexOf(item.Id) !== -1
) {
continue;
userViews.forEach(item => {
if (!item.Id || userExcludeItems.indexOf(item.Id) !== -1) {
return;
}
if (
!item.CollectionType
|| excludeViewTypes.indexOf(item.CollectionType) !== -1
) {
continue;
if (!item.CollectionType || excludeViewTypes.indexOf(item.CollectionType) !== -1) {
return;
}
const frag = document.createElement('div');
@ -161,5 +154,5 @@ export function loadRecentlyAdded(
elem.appendChild(frag);
renderLatestSection(frag, apiClient, user, item, options);
}
});
}