minor edits

This commit is contained in:
cwilvx
2024-10-29 01:57:01 +03:00
parent f6373292aa
commit 2ee501cc64
3 changed files with 20 additions and 17 deletions
+4 -2
View File
@@ -13,7 +13,6 @@ class Mix:
title: str
description: str
tracks: list[str]
image: dict
timestamp: int = field(default_factory=lambda: int(time.time()))
extra: dict = field(default_factory=dict)
@@ -25,7 +24,10 @@ class Mix:
_dict = asdict(self)
_dict["tracks"] = serialized_tracks
_dict["images"] = get_first_4_images(tracks)
if not self.extra.get("image"):
_dict["images"] = get_first_4_images(tracks)
_dict["duration"] = seconds_to_time_string(sum(t.duration for t in tracks))
_dict["trackcount"] = len(tracks)