Skip to content

Commit

Permalink
Use foreach for recently added sections
Browse files Browse the repository at this point in the history
  • Loading branch information
thornbill committed Oct 5, 2023
1 parent 47213c4 commit 5a0a19b
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/components/homesections/sections/recentlyAdded.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -161,5 +154,5 @@ export function loadRecentlyAdded(
elem.appendChild(frag);

renderLatestSection(frag, apiClient, user, item, options);
}
});
}

0 comments on commit 5a0a19b

Please sign in to comment.