From a42377991d164e1b5cb37e185ada143f7415df50 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Sun, 5 Jan 2014 14:20:42 +0100 Subject: [PATCH] Use songartistid instead of album_artist for playlist query --- src/player.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/player.c b/src/player.c index 97ebd962..d0535be0 100644 --- a/src/player.c +++ b/src/player.c @@ -706,6 +706,7 @@ player_queue_make_daap(struct player_source **head, const char *query, const cha struct db_media_file_info dbmfi; uint32_t id; int64_t albumid; + int64_t artistid; int plid; int idx; int ret; @@ -726,15 +727,19 @@ player_queue_make_daap(struct player_source **head, const char *query, const cha id = 0; - if (quirk && dbmfi.album_artist) + if (quirk && dbmfi.songartistid) { safe_atou32(dbmfi.id, &id); qp.sort = S_ALBUM; qp.type = Q_ITEMS; - s = db_escape_string(dbmfi.album_artist); - if (!s) - return -1; - snprintf(buf, sizeof(buf), "f.album_artist = '%s'", s); + ret = safe_atoi64(dbmfi.songartistid, &artistid); + if (ret < 0) + { + DPRINTF(E_LOG, L_PLAYER, "User requested song from artist list, but artistid is not a valid number!\n"); + + return -1; + } + snprintf(buf, sizeof(buf), "f.songartistid = %" PRIi64, artistid); qp.filter = strdup(buf); } else if (queuefilter)