Fix radio stream playback (#2090)
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Tue, 1 Apr 2025 07:18:46 +0000 (09:18 +0200)
committerGitHub <noreply@github.com>
Tue, 1 Apr 2025 07:18:46 +0000 (09:18 +0200)
music_assistant/controllers/streams.py

index 261c8046dfdfea169059bc076c46abbdd34e6eb3..23eda6e98d6fd6a61cd197e007684d42e260818f 100644 (file)
@@ -1222,8 +1222,14 @@ class StreamsController(CoreController):
         )
         if not next_item:
             return False
+        # check if next item is a track
+        if next_item.media_type != MediaType.TRACK:
+            self.logger.debug("Skipping crossfade: next item is not a track")
+            return False
         if (
-            queue_item.media_item
+            queue_item.MediaType == MediaType.TRACK
+            and next_item.MediaType == MediaType.TRACK
+            and queue_item.media_item
             and queue_item.media_item.album
             and next_item.media_item
             and next_item.media_item.album
@@ -1234,10 +1240,7 @@ class StreamsController(CoreController):
             # for now we just never crossfade between tracks of the same album
             self.logger.debug("Skipping crossfade: next item is part of the same album")
             return False
-        # check if next item is a track
-        if next_item.media_type != MediaType.TRACK:
-            self.logger.debug("Skipping crossfade: next item is not a track")
-            return False
+
         # check if next item sample rate matches
         if (
             not flow_mode