dashboard(): rename & replace already_listed var

master
Felix Stupp 2 years ago
parent 47d823d56f
commit c2eb7a3d6a
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -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

Loading…
Cancel
Save