From 8a069cd51fb268ca249c5bef2b011a7b8dd84b4f Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Mon, 16 Dec 2024 09:15:09 +0000 Subject: [PATCH 1/2] Feat: setup.sh: Allow overriding which Python binary to use for venv Debian systems do not have Python3 as `python`. With this change developers on that platform can use: ```console $ PYTHON=python3 ./scripts/setup.sh ``` --- scripts/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setup.sh b/scripts/setup.sh index 43837c983..79750bdf8 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -13,7 +13,7 @@ if [ -d "$env_name" ]; then echo "Virtual environment '$env_name' already exists." else echo "Creating Virtual environment..." - python -m venv .venv + ${PYTHON:-python} -m venv .venv fi echo "Activating virtual environment..." source .venv/bin/activate From a631d3099ac8c10f5791c46dfefc2842869b079e Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Sat, 21 Dec 2024 10:21:34 +0000 Subject: [PATCH 2/2] Fix: Limit images to 512x512 My Chromecast Ultra crashes when presented with cover images on the order of 5000x5000 pixels (I've not determined the actual limit, 2048x2048 is ok though). This sets the default size in the player queue to 512x512 which affects all players, as well as a chromecast specific codepath. Of the other callers of `get_image_url` airplay already sets a size of 500x500 while the slimproto and sonos players do not set any limit. Fixes: https://github.com/music-assistant/hass-music-assistant/issues/3285 --- music_assistant/controllers/player_queues.py | 2 +- music_assistant/providers/chromecast/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/music_assistant/controllers/player_queues.py b/music_assistant/controllers/player_queues.py index eb52f897e..48498ba25 100644 --- a/music_assistant/controllers/player_queues.py +++ b/music_assistant/controllers/player_queues.py @@ -1261,7 +1261,7 @@ def player_media_from_queue_item(self, queue_item: QueueItem, flow_mode: bool) - album.name if (album := getattr(queue_item.media_item, "album", None)) else "" ) if queue_item.image: - media.image_url = self.mass.metadata.get_image_url(queue_item.image) + media.image_url = self.mass.metadata.get_image_url(queue_item.image, size=512) return media async def get_artist_tracks(self, artist: Artist) -> list[Track]: diff --git a/music_assistant/providers/chromecast/__init__.py b/music_assistant/providers/chromecast/__init__.py index fdd5ff549..b206bde92 100644 --- a/music_assistant/providers/chromecast/__init__.py +++ b/music_assistant/providers/chromecast/__init__.py @@ -675,7 +675,7 @@ async def update_flow_metadata(self, castplayer: CastPlayer) -> None: # update metadata of current item chromecast if media_controller.status.media_custom_data["queue_item_id"] != current_item.queue_item_id: image_url = ( - self.mass.metadata.get_image_url(current_item.image) + self.mass.metadata.get_image_url(current_item.image, size=512) if current_item.image else MASS_LOGO_ONLINE )