mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
port: artist page
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user