diff --git a/server/app.py b/server/app.py index 2d0d91b..43763b6 100644 --- a/server/app.py +++ b/server/app.py @@ -225,21 +225,21 @@ def dashboard(): # config pinned_limit = 16 media_limit = 24 + already_listed = set[MediaElement]() # for links from pinned collections pinned_collections: Iterable[MediaCollection] = orm.select( m for m in MediaCollection if m.pinned and not m.ignored ).order_by(MediaCollection.release_date, MediaCollection.title, MediaCollection.id) links_from_pinned_collections: List[MediaCollectionLink] = list() - episodes_from_pinned_collections: Set[MediaElement] = set() for coll in pinned_collections: next_link = coll.next_episode if ( next_link is not None - and next_link.element not in episodes_from_pinned_collections + and next_link.element not in already_listed and next_link.element.can_considered ): links_from_pinned_collections.append(next_link) - episodes_from_pinned_collections.add(next_link.element) + already_listed.add(next_link.element) if len(links_from_pinned_collections) >= pinned_limit: break # for media