Don't attempt to create smart fade analysis when smart fade is disabled
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Fri, 3 Oct 2025 00:10:53 +0000 (02:10 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Fri, 3 Oct 2025 00:10:53 +0000 (02:10 +0200)
music_assistant/helpers/smart_fades.py

index 34f41c11dd71158d84ede4d00ecf8f70fd193c97..a91023d508de48564bb43f7d9c47cb5191988945 100644 (file)
@@ -253,6 +253,15 @@ class SmartFadesMixer:
         mode: SmartFadesMode = SmartFadesMode.SMART_FADES,
     ) -> bytes:
         """Apply crossfade with internal state management and smart/standard fallback logic."""
+        if mode == SmartFadesMode.STANDARD_CROSSFADE:
+            # crossfade with standard crossfade
+            return await self._default_crossfade(
+                fade_in_part,
+                fade_out_part,
+                pcm_format,
+                standard_crossfade_duration,
+            )
+        # Attempt smart crossfade with analysis data
         fade_out_analysis: SmartFadesAnalysis | None
         if stored_analysis := await self.mass.music.get_smart_fades_analysis(
             fade_out_streamdetails.item_id,