add routes to get all albums and artists with sort

+ rewrite load all albums + artist logic with itertools.groupby
+ add a function to convert seconds to string
This commit is contained in:
mungai-njoroge
2023-12-08 09:20:51 +03:00
parent 7f87cde96c
commit 336360d509
12 changed files with 265 additions and 29 deletions
+4
View File
@@ -36,6 +36,7 @@ class Artist(ArtistMinimal):
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)
@@ -51,3 +52,6 @@ class Artist(ArtistMinimal):
def set_colors(self, colors: list[str]):
self.colors = colors
def set_created_date(self, created_date: float):
self.created_date = created_date