From d2d1cee3a6f08596c75a386e44b9ff66690a0d83 Mon Sep 17 00:00:00 2001 From: Erica Z Date: Sun, 24 Nov 2024 17:43:01 +0100 Subject: [PATCH] limit big cover art size fetching --- src/ui/window.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/window.rs b/src/ui/window.rs index 8b4121d..43db767 100644 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -746,13 +746,14 @@ mod imp { self.mpris_player_playback_status_changed(); let window = self.obj().clone(); + let scale_factor = self.obj().scale_factor().try_into().unwrap_or(1); let song_id = song.id(); if let Some(handle) = self .loading_cover_handle .replace(Some(glib::spawn_future_local(async move { let api = window.imp().api.borrow().as_ref().unwrap().clone(); let image = match api - .cover_art(&song_id, None) // full size + .cover_art(&song_id, Some(800 * scale_factor)) // 800px times ui scale .await { Ok(image) => image,