From ce9fbff8f575574f160ef8c64a8ee188d27970d0 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Mon, 19 Oct 2020 20:25:01 +0200 Subject: [PATCH] [artwork] Use cache stash to avoid making repeated requests E.g. for an album we would for each track request artwork from Spotify, even though the requests are similar and the first one didn't give a result. --- src/artwork.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/artwork.c b/src/artwork.c index 9c69d78d..3630b48c 100644 --- a/src/artwork.c +++ b/src/artwork.c @@ -923,8 +923,11 @@ artwork_get_byurl(struct evbuffer *artwork, const char *url, int max_w, int max_ CHECK_NULL(L_ART, raw = evbuffer_new()); ret = cache_artwork_read(raw, url, &format); - if (ret == 0 && format > 0) + if (ret == 0) { + if (format <= 0) + goto error; + ret = artwork_evbuf_rescale(artwork, raw, max_w, max_h); if (ret < 0) goto error;