MediaElement.can_considered: Only request data for ordered collections

master
Felix Stupp 3 years ago committed by Felix Stupp
parent cc8cb6b072
commit a923d99e82
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -485,9 +485,13 @@ class MediaElement(db.Entity, Tagable):
return False return False
if self.release_date > datetime.now(): if self.release_date > datetime.now():
return False return False
for link in self.collection_links: ordered_collections: Query[MediaCollection] = orm.select(
if link.collection.watch_in_order: l.collection
next = link.collection.next_episode for l in self.collection_links
if l.collection.watch_in_order
)
for collection in ordered_collections:
next = collection.next_episode
if next is not None and self != next.element: if next is not None and self != next.element:
return False return False
return True return True

Loading…
Cancel
Save