[artwork] Only try embedded artwork if dbmfi has ARTWORK_EMBEDDED flag

This commit is contained in:
chme 2020-04-18 11:20:02 +02:00 committed by ejurgensen
parent 946853fdf4
commit 8510f7e5f2
1 changed files with 11 additions and 0 deletions

View File

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