limit big cover art size fetching

This commit is contained in:
Erica Z 2024-11-24 17:43:01 +01:00
parent 8579d5190d
commit d2d1cee3a6

View file

@ -746,13 +746,14 @@ mod imp {
self.mpris_player_playback_status_changed(); self.mpris_player_playback_status_changed();
let window = self.obj().clone(); let window = self.obj().clone();
let scale_factor = self.obj().scale_factor().try_into().unwrap_or(1);
let song_id = song.id(); let song_id = song.id();
if let Some(handle) = self if let Some(handle) = self
.loading_cover_handle .loading_cover_handle
.replace(Some(glib::spawn_future_local(async move { .replace(Some(glib::spawn_future_local(async move {
let api = window.imp().api.borrow().as_ref().unwrap().clone(); let api = window.imp().api.borrow().as_ref().unwrap().clone();
let image = match api let image = match api
.cover_art(&song_id, None) // full size .cover_art(&song_id, Some(800 * scale_factor)) // 800px times ui scale
.await .await
{ {
Ok(image) => image, Ok(image) => image,