add route to save folder as playlist

+ modify playlist table sql
This commit is contained in:
mungai-njoroge
2023-07-27 13:37:07 +03:00
parent d4a1a6ee1a
commit a0c51d5f82
6 changed files with 124 additions and 44 deletions
+6 -3
View File
@@ -12,11 +12,10 @@ class Playlist:
id: int
artisthashes: str | list[str]
banner_pos: int
has_gif: str | bool
image: str
last_updated: str
name: str
settings: str | dict
trackhashes: str | list[str]
thumb: str = ""
@@ -29,10 +28,14 @@ class Playlist:
self.trackhashes = json.loads(str(self.trackhashes))
# self.artisthashes = json.loads(str(self.artisthashes))
# commentted until we need it 👆
self.artisthashes = []
self.count = len(self.trackhashes)
self.has_gif = bool(int(self.has_gif))
if isinstance(self.settings, str):
self.settings = json.loads(self.settings)
self.has_image = (
Path(settings.Paths.get_playlist_img_path()) / str(self.image)
).exists()