Fixing "find any" and "list * any" to actually find matches.

git-svn-id: https://svn.musicpd.org/mpd/trunk@5137 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
J. Alexander Treuman 2006-12-11 19:52:05 +00:00
parent f597dd0235
commit a26582e991
1 changed files with 6 additions and 2 deletions

View File

@ -247,17 +247,21 @@ static int tagItemFoundAndMatches(Song * song, int type, char *str)
{ {
int i; int i;
if (type == LOCATE_TAG_FILE_TYPE) { if (type == LOCATE_TAG_FILE_TYPE || type == LOCATE_TAG_ANY_TYPE) {
if (0 == strcmp(str, getSongUrl(song))) if (0 == strcmp(str, getSongUrl(song)))
return 1; return 1;
if (type == LOCATE_TAG_FILE_TYPE)
return 0;
} }
if (!song->tag) if (!song->tag)
return 0; return 0;
for (i = 0; i < song->tag->numOfItems; i++) { for (i = 0; i < song->tag->numOfItems; i++) {
if (song->tag->items[i].type != type) if (type != LOCATE_TAG_ANY_TYPE &&
song->tag->items[i].type != type) {
continue; continue;
}
if (0 == strcmp(str, song->tag->items[i].value)) if (0 == strcmp(str, song->tag->items[i].value))
return 1; return 1;