diff --git a/app/models.py b/app/models.py index 50d2642a..cbf5b15c 100644 --- a/app/models.py +++ b/app/models.py @@ -109,6 +109,7 @@ class Album: is_single: bool = False is_EP: bool = False is_favorite: bool = False + is_live: bool = False genres: list[str] = dataclasses.field(default_factory=list) def __post_init__(self): @@ -126,6 +127,10 @@ class Album: if self.is_soundtrack: return + self.is_live = self.check_is_live_album() + if self.is_live: + return + self.is_compilation = self.check_is_compilation() if self.is_compilation: return @@ -160,6 +165,17 @@ class Album: return False + def check_is_live_album(self): + """ + Checks if the album is a live album. + """ + keywords = ["live from", "live at"] + for keyword in keywords: + if keyword in self.title.lower(): + return True + + return False + def check_is_ep(self) -> bool: """ Checks if the album is an EP.