round durations to int
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Fri, 22 Jul 2022 23:24:46 +0000 (01:24 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Fri, 22 Jul 2022 23:24:46 +0000 (01:24 +0200)
music_assistant/helpers/tags.py

index 3063c2f54e6fbf1cadefdb7ab45d5f3f5b6bc67a..5872a8ddaca8168e23ef7f648fd27560c18a7968 100644 (file)
@@ -41,7 +41,7 @@ class AudioTags:
     bits_per_sample: int
     format: str
     bit_rate: int
-    duration: Optional[float]
+    duration: Optional[int]
     tags: Dict[str, str]
     has_cover_image: bool
     filename: str
@@ -169,7 +169,7 @@ class AudioTags:
             ),
             format=raw["format"]["format_name"],
             bit_rate=int(raw["format"].get("bit_rate", 320)),
-            duration=float(raw["format"].get("duration", 0)) or None,
+            duration=int(raw["format"].get("duration", 0)) or None,
             tags=tags,
             has_cover_image=has_cover_image,
             filename=raw["format"]["filename"],