From ad4113a7e955887a0fde32bb5699bc68be3f6a14 Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Mon, 6 Jan 2025 01:47:28 +0100 Subject: [PATCH] plugins: image viewer: respect album art setting Displaying large embedded album art in the image viewer requires playback to be stopped, which is pretty disruptive, so respecting the system setting here may make sense Change-Id: I479466bf26d85c3305d6c81e2c1818b2c2b2cbdb --- apps/plugins/imageviewer/imageviewer.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/apps/plugins/imageviewer/imageviewer.c b/apps/plugins/imageviewer/imageviewer.c index 3ae4220721..cddc35c5fc 100644 --- a/apps/plugins/imageviewer/imageviewer.c +++ b/apps/plugins/imageviewer/imageviewer.c @@ -1066,14 +1066,20 @@ static bool find_album_art(int *offset, int *filesize, int *status) (*status) = IMAGE_JPEG; break; default: - if (rb->search_albumart_files(current_track, "", np_file, MAX_PATH)) - { - (*status) = get_image_type(np_file, false); - return true; - } else - { - return false; - } + (*status) = IMAGE_UNKNOWN; + } + + if (IMAGE_UNKNOWN == *status + || AA_PREFER_IMAGE_FILE == rb->global_settings->album_art) + { + if (rb->search_albumart_files(current_track, "", np_file, MAX_PATH)) + { + (*status) = get_image_type(np_file, false); + return true; + } + + if (*status == IMAGE_UNKNOWN) + return false; } rb->strcpy(np_file, current_track->path); (*offset) = current_track->albumart.pos;