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