You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
528 B

class Source:
def __init__(self,
source: str = None,
name: str = None,
artist: str = None,
length: int = None,
watched: int = None,
status: str = None
):
self.source = (source or "Unknown Source").strip()
self.name = (name or "N/A").strip()
self.artist = artist
self.length = length or 1
self.watched = watched or 0
self.watched_percent = min(max(self.watched / self.length, 0), 1)
self.status = status or "Playing"