Deezer: Fix Playback (#1404)
authormicha91 <michael.harbarth@gmx.de>
Mon, 24 Jun 2024 08:13:40 +0000 (10:13 +0200)
committerGitHub <noreply@github.com>
Mon, 24 Jun 2024 08:13:40 +0000 (10:13 +0200)
fix: deezer playback was broken due to wrong seek implementation

music_assistant/server/providers/deezer/__init__.py

index 3ae16b4457539db740cd909bd2ba7acd11511b42..c49aff7f598d16d9dfc68e40c08a13fc65adc759 100644 (file)
@@ -488,12 +488,12 @@ class DeezerProvider(MusicProvider):  # pylint: disable=W0223
             async for chunk in resp.content.iter_chunked(2048):
                 buffer += chunk
                 if len(buffer) >= 2048:
-                    if chunk_index >= skip_chunks:
-                        continue
-                    if chunk_index % 3 > 0:
-                        yield bytes(buffer[:2048])
-                    else:
-                        yield self.decrypt_chunk(bytes(buffer[:2048]), blowfish_key)
+                    if chunk_index >= skip_chunks or chunk_index == 0:
+                        if chunk_index % 3 > 0:
+                            yield bytes(buffer[:2048])
+                        else:
+                            yield self.decrypt_chunk(bytes(buffer[:2048]), blowfish_key)
+
                     chunk_index += 1
                     del buffer[:2048]
         yield bytes(buffer)