From: Marcel van der Veldt Date: Thu, 16 Jun 2022 16:17:23 +0000 (+0200) Subject: Update librespot binaries (#371) X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=ad66ad697485e922308d50b54e8e3ecaae4ec4b9;p=music-assistant-server.git Update librespot binaries (#371) * update librespot binaries * add exception when streaming from spotify fails * don't send analyze job if stream failed --- diff --git a/music_assistant/helpers/audio.py b/music_assistant/helpers/audio.py index e70f7c8e..a9d7af02 100644 --- a/music_assistant/helpers/audio.py +++ b/music_assistant/helpers/audio.py @@ -433,7 +433,11 @@ async def get_media_stream( ) finally: # send analyze job to background worker - if streamdetails.loudness is None: + if ( + streamdetails.loudness is None + and prev_chunk + and streamdetails.media_type in (MediaType.TRACK, MediaType.RADIO) + ): mass.add_job( analyze_audio(mass, streamdetails), f"Analyze audio for {streamdetails.uri}", diff --git a/music_assistant/music_providers/librespot/linux/librespot-aarch64 b/music_assistant/music_providers/librespot/linux/librespot-aarch64 index 5359098f..5e42d14f 100755 Binary files a/music_assistant/music_providers/librespot/linux/librespot-aarch64 and b/music_assistant/music_providers/librespot/linux/librespot-aarch64 differ diff --git a/music_assistant/music_providers/librespot/linux/librespot-armv7 b/music_assistant/music_providers/librespot/linux/librespot-armv7 index 0a792b2e..1db6879f 100755 Binary files a/music_assistant/music_providers/librespot/linux/librespot-armv7 and b/music_assistant/music_providers/librespot/linux/librespot-armv7 differ diff --git a/music_assistant/music_providers/librespot/linux/librespot-x86_64 b/music_assistant/music_providers/librespot/linux/librespot-x86_64 index e025abdb..bbbbe9ce 100755 Binary files a/music_assistant/music_providers/librespot/linux/librespot-x86_64 and b/music_assistant/music_providers/librespot/linux/librespot-x86_64 differ diff --git a/music_assistant/music_providers/librespot/osx/librespot b/music_assistant/music_providers/librespot/osx/librespot index c1b37543..915bff88 100755 Binary files a/music_assistant/music_providers/librespot/osx/librespot and b/music_assistant/music_providers/librespot/osx/librespot differ diff --git a/music_assistant/music_providers/spotify.py b/music_assistant/music_providers/spotify.py index 56912c1e..31b4b8c4 100644 --- a/music_assistant/music_providers/spotify.py +++ b/music_assistant/music_providers/spotify.py @@ -20,7 +20,7 @@ from music_assistant.helpers.cache import use_cache from music_assistant.helpers.process import AsyncProcess from music_assistant.helpers.util import parse_title_and_version from music_assistant.models.enums import ProviderType -from music_assistant.models.errors import LoginFailed, MediaNotFoundError +from music_assistant.models.errors import AudioError, LoginFailed, MediaNotFoundError from music_assistant.models.media_items import ( Album, AlbumType, @@ -305,9 +305,16 @@ class SpotifyProvider(MusicProvider): ] if seek_position: args += ["--start-position", str(int(seek_position))] + bytes_sent = 0 async with AsyncProcess(args) as librespot_proc: async for chunk in librespot_proc.iterate_chunks(): yield chunk + bytes_sent += len(chunk) + # TEMP: diagnose issues with librespot dump details + if bytes_sent < 100: + async with AsyncProcess(args, use_stderr=True) as librespot_proc: + _, stderr = await librespot_proc.communicate() + raise AudioError(f"Error getting stream from librespot: {stderr.decode()}") async def _parse_artist(self, artist_obj): """Parse spotify artist object to generic layout."""