From: Marcel van der Veldt Date: Tue, 25 Feb 2025 22:36:00 +0000 (+0100) Subject: Fix: preview stream X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=2ded55b354063e397415edb3bfaadf2f21638290;p=music-assistant-server.git Fix: preview stream --- diff --git a/music_assistant/helpers/audio.py b/music_assistant/helpers/audio.py index 5e2393c1..482ab8e8 100644 --- a/music_assistant/helpers/audio.py +++ b/music_assistant/helpers/audio.py @@ -871,12 +871,13 @@ async def get_file_stream( async def get_preview_stream( mass: MusicAssistant, provider_instance_id_or_domain: str, - track_id: str, + item_id: str, + media_type: MediaType = MediaType.TRACK, ) -> AsyncGenerator[bytes, None]: """Create a 30 seconds preview audioclip for the given streamdetails.""" if not (music_prov := mass.get_provider(provider_instance_id_or_domain)): raise ProviderUnavailableError - streamdetails = await music_prov.get_stream_details(track_id) + streamdetails = await music_prov.get_stream_details(item_id, media_type) async for chunk in get_ffmpeg_stream( audio_input=music_prov.get_audio_stream(streamdetails, 30) if streamdetails.stream_type == StreamType.CUSTOM