Add MediaElement properties detected_{creators,playlists}

master
Felix Stupp 2 years ago
parent c8d755770f
commit fd7d413fe2
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -669,6 +669,18 @@ class MediaElement(db.Entity, UriHolder, Tagable):
return False
return True
@property
def detected_creators(self) -> Query[MediaCollectionLink]:
return orm.select(
link for link in self.collection_links if link.collection.is_creator
)
@property
def detected_playlists(self) -> Query[MediaCollectionLink]:
return orm.select(
link for link in self.collection_links if link.collection.watch_in_order
)
@property
def assigned_tags(self) -> Set[Tag]:
return set(self.tag_list)

Loading…
Cancel
Save