Escape didl image url and disable throttling. (#561)
authorMarvin Schenkel <marvinschenkel@gmail.com>
Wed, 22 Mar 2023 16:20:16 +0000 (17:20 +0100)
committerGitHub <noreply@github.com>
Wed, 22 Mar 2023 16:20:16 +0000 (17:20 +0100)
music_assistant/server/controllers/streams.py
music_assistant/server/helpers/didl_lite.py

index a1d665c88d8ada5453e13afc589d1f6e7245ada8..152321d22c498012fc5c513a8ab8d3728e5ab23c 100644 (file)
@@ -421,13 +421,14 @@ class StreamsController:
                     await resp.write(chunk)
                     bytes_streamed += len(chunk)
 
+                    # DISABLE FOR NOW TO AVOID ISSUES WITH SONOS ICW YOUTUBE MUSIC
                     # do not allow the player to prebuffer more than 30 seconds
-                    seconds_streamed = int(bytes_streamed / stream_job.pcm_sample_size)
-                    if (
-                        seconds_streamed > 30
-                        and (seconds_streamed - player.corrected_elapsed_time) > 30
-                    ):
-                        await asyncio.sleep(1)
+                    seconds_streamed = int(bytes_streamed / stream_job.pcm_sample_size)
+                    if (
+                        seconds_streamed > 30
+                        and (seconds_streamed - player.corrected_elapsed_time) > 30
+                    ):
+                        await asyncio.sleep(1)
 
                     if not enable_icy:
                         continue
index 7c1f5149a1a2375eb9bfefdc939e0cc51a1d44dd..d5be2943f3f88e4f8d6d6a285e408da7228b4739 100644 (file)
@@ -39,7 +39,7 @@ def create_didl_metadata(url: str, queue_item: QueueItem, flow_mode: bool = Fals
             '<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dlna="urn:schemas-dlna-org:metadata-1-0/">'
             f'<item id="{queue_item.queue_item_id}" parentID="0" restricted="1">'
             f"<dc:title>{_escape_str(queue_item.name)}</dc:title>"
-            f"<upnp:albumArtURI>{queue_item.image_url}</upnp:albumArtURI>"
+            f"<upnp:albumArtURI>{_escape_str(queue_item.image_url)}</upnp:albumArtURI>"
             f"<dc:queueItemId>{image}</dc:queueItemId>"
             "<upnp:class>object.item.audioItem.audioBroadcast</upnp:class>"
             f"<upnp:mimeType>audio/{ext}</upnp:mimeType>"