models: Rewrite MediaElement.ignored_recursive to use fast SQL request to count

master
Felix Stupp 3 years ago
parent bf548f13ad
commit f989f75806
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -347,8 +347,7 @@ class MediaElement(db.Entity, Tagable):
@property
def ignored_recursive(self) -> bool:
links = orm.select(link for link in MediaCollectionLink if link.episode == self and link.collection.ignored == True)
return len(links) > 0
return orm.count(link for link in MediaCollectionLink if link.episode == self and link.collection.ignored == True) > 0
@property
def ignored_any(self) -> bool:

Loading…
Cancel
Save