feat: check if album is a concert

This commit is contained in:
geoffrey45
2023-02-07 12:50:50 +03:00
parent bf0073fcf8
commit 7675c0e5c9
+16
View File
@@ -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.