limit big cover art size fetching
This commit is contained in:
parent
8579d5190d
commit
d2d1cee3a6
1 changed files with 2 additions and 1 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue