From 4b3463ab9978891364863953d5ff2a4191d588fe Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Tue, 1 Apr 2025 09:18:46 +0200 Subject: [PATCH] Fix radio stream playback (#2090) --- music_assistant/controllers/streams.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/music_assistant/controllers/streams.py b/music_assistant/controllers/streams.py index 261c8046..23eda6e9 100644 --- a/music_assistant/controllers/streams.py +++ b/music_assistant/controllers/streams.py @@ -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 -- 2.34.1