[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.
This commit is contained in:
ejurgensen 2020-10-19 20:25:01 +02:00
parent 3233aefa8a
commit ce9fbff8f5

View File

@ -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;