Improve selects for files table by removing the (f.album <> '' AND

f.album IS NOT NULL) from the where clause for album and artist. These
are unnecessary because forked-daapd makes sure that an artist or album
name exists.
This commit is contained in:
chme 2014-12-27 14:02:32 +01:00 committed by ejurgensen
parent ad48ccb804
commit 46f770b52d

View File

@ -194,6 +194,17 @@ expr returns [ pANTLR3_STRING result, int valid ]
goto STR_result_valid_0; /* ABORT */
}
/* No need to exclude empty artist and album, as forked-daapd makes sure there always exists an artist/album. */
if (neg_op && op == ':'
&& (strcmp((char *)field, "daap.songalbumartist") == 0
|| strcmp((char *)field, "daap.songartist") == 0
|| strcmp((char *)field, "daap.songalbum") == 0))
{
DPRINTF(E_DBG, L_DAAP, "Ignoring clause '\%s\%s\%c'\n", field, (neg_op) ? "!" : "", op);
$result->append8($result, "1 = 1");
goto STR_out;
}
/* Need to check against NULL too */
if (op == ':')
$result->append8($result, "(");