mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
implement pinning playlists
+ update migrations to add pinned attr to plalist + misc
This commit is contained in:
@@ -22,13 +22,15 @@ class Playlist:
|
||||
duration: int = 0
|
||||
has_image: bool = False
|
||||
images: list[str] = dataclasses.field(default_factory=list)
|
||||
pinned: bool = False
|
||||
|
||||
def __post_init__(self):
|
||||
self.trackhashes = json.loads(str(self.trackhashes))
|
||||
self.count = len(self.trackhashes)
|
||||
|
||||
if isinstance(self.settings, str):
|
||||
self.settings = json.loads(self.settings)
|
||||
self.settings = dict(json.loads(self.settings))
|
||||
self.pinned = self.settings.get("pinned", False)
|
||||
|
||||
self.has_image = (
|
||||
Path(settings.Paths.get_playlist_img_path()) / str(self.image)
|
||||
|
||||
Reference in New Issue
Block a user