From 4d4d96e1bbc25f8bba215f7f79e3739d45e7054c Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Thu, 3 Nov 2011 00:48:14 +0000 Subject: [PATCH] * Separate album containers with different artists. --- scanner.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scanner.c b/scanner.c index 75ac7b2..e35f7e1 100644 --- a/scanner.c +++ b/scanner.c @@ -88,11 +88,13 @@ insert_container(const char * item, const char * rootParent, const char * refID, int ret = 0; sqlite_int64 detailID = 0; - result = sql_get_text_field(db, "SELECT OBJECT_ID from OBJECTS" - " where PARENT_ID = '%s'" - " and NAME like '%q'" - " and CLASS = 'container.%s' limit 1", - rootParent, item, class); + result = sql_get_text_field(db, "SELECT OBJECT_ID from OBJECTS o " + "left join DETAILS d on (o.DETAIL_ID = d.ID)" + " where o.PARENT_ID = '%s'" + " and o.NAME like '%q'" + " and d.ARTIST %s %Q" + " and o.CLASS = 'container.%s' limit 1", + rootParent, item, artist?"like":"is", artist, class); if( result ) { base = strrchr(result, '$');