Fix: some very minor fixes
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 15 Jan 2025 13:23:26 +0000 (14:23 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 15 Jan 2025 13:23:26 +0000 (14:23 +0100)
music_assistant/controllers/player_queues.py
music_assistant/helpers/audio.py

index 2401abbcca305751044c77679e99790ba5963ad3..5b84227ca0a72cd662cf7ae52b7915a4e37bf101 100644 (file)
@@ -1048,7 +1048,9 @@ class PlayerQueuesController(CoreController):
                             else None,
                             "image_url": self.mass.metadata.get_image_url(
                                 prev_item.media_item.image, size=512
-                            ),
+                            )
+                            if prev_item.media_item.image
+                            else None,
                             "duration": getattr(prev_item.media_item, "duration", 0),
                             "mbid": getattr(prev_item.media_item, "mbid", None),
                         },
index 85aa5afe2aca6df07bd678964905978c720cb3ae..0534b144ea63b1fad67ba8747c79b6f87820b364 100644 (file)
@@ -325,8 +325,8 @@ async def get_media_stream(
         async for chunk in TimedAsyncGenerator(
             ffmpeg_proc.iter_chunked(pcm_format.pcm_sample_size), timeout=30
         ):
-            # for radio streams we just yield all chunks directly
-            if streamdetails.media_type == MediaType.RADIO:
+            # for non-tracks we just yield all chunks directly
+            if streamdetails.media_type != MediaType.TRACK:
                 yield chunk
                 bytes_sent += len(chunk)
                 continue