From 8510f7e5f2248b339909d62a4e9b6a1d24859234 Mon Sep 17 00:00:00 2001 From: chme Date: Sat, 18 Apr 2020 11:20:02 +0200 Subject: [PATCH] [artwork] Only try embedded artwork if dbmfi has ARTWORK_EMBEDDED flag --- src/artwork.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/artwork.c b/src/artwork.c index b20c553c..7df225f7 100644 --- a/src/artwork.c +++ b/src/artwork.c @@ -1421,8 +1421,19 @@ source_item_cache_get(struct artwork_ctx *ctx) static int source_item_embedded_get(struct artwork_ctx *ctx) { + int artwork; + DPRINTF(E_SPAM, L_ART, "Trying embedded artwork in %s\n", ctx->dbmfi->path); + if (safe_atoi32(ctx->dbmfi->artwork, &artwork) < 0) + { + DPRINTF(E_LOG, L_ART, "Error converting dbmfi artwork to number for '%s'\n", ctx->dbmfi->path); + return ART_E_ERROR; + } + + if (artwork != ARTWORK_EMBEDDED) + return ART_E_NONE; + snprintf(ctx->path, sizeof(ctx->path), "%s", ctx->dbmfi->path); return artwork_get(ctx->evbuf, ctx->path, NULL, ctx->max_w, ctx->max_h, true, ctx->data_kind);