[spotify] Fix commit 5e7bf182 to avoid picking too large images

This commit is contained in:
ejurgensen 2022-12-21 23:29:44 +01:00
parent 5e7bf1826c
commit b70188f4b8
1 changed files with 3 additions and 1 deletions

View File

@ -703,8 +703,10 @@ get_album_image(json_object *jsonalbum, int max_w)
if (max_w == 0 || candidate_width == 0)
use_image = (width > candidate_width);
else if (candidate_width > max_w)
use_image = (width < candidate_width);
else
use_image = (width <= max_w && width > candidate_width) || (max_w < width && width < candidate_width);
use_image = (candidate_width < width && width <= max_w);
if (!use_image)
continue;