port: artist page

This commit is contained in:
cwilvx
2024-06-24 22:08:05 +03:00
parent 3593b205eb
commit 54a1b85d8b
7 changed files with 187 additions and 119 deletions
+1
View File
@@ -20,6 +20,7 @@ class Album:
id: int
albumartists: list[dict[str, str]]
albumhash: str
artisthashes: list[str]
base_title: str
color: str
created_date: int
+12 -26
View File
@@ -31,33 +31,19 @@ class ArtistMinimal:
@dataclass(slots=True)
class Artist(ArtistMinimal):
class Artist:
"""
Artist class
"""
name: str = ""
trackcount: int = 0
albumcount: int = 0
duration: int = 0
colors: list[str] = dataclasses.field(default_factory=list)
is_favorite: bool = False
created_date: float = 0.0
def __post_init__(self):
super(Artist, self).__init__(self.name)
def set_trackcount(self, count: int):
self.trackcount = count
def set_albumcount(self, count: int):
self.albumcount = count
def set_duration(self, duration: int):
self.duration = duration
def set_colors(self, colors: list[str]):
self.colors = colors
def set_created_date(self, created_date: float):
self.created_date = created_date
id: str
name: str
albumcount: int
artisthash: str
created_date: int
date: int
duration: int
genres: list[dict[str, str]]
name: str
trackcount: int
is_favorite: bool
+3
View File
@@ -27,6 +27,7 @@ class Track:
album: str
albumartists: list[dict[str, str]]
albumhash: str
artisthashes: list[str]
artists: str
bitrate: int
copyright: str
@@ -44,9 +45,11 @@ class Track:
trackhash: str
extra: dict
is_favorite: bool = False
_pos: int = 0
_ati: str = ""
# album: str
# albumartists: str | list[ArtistMinimal]
# albumhash: str