diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-11-10 01:09:03 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-11-10 01:09:03 +0000 |
commit | 92a75471505391edd2f8f9af23188b4f7b17bbcb (patch) | |
tree | 7cf738d5c40637942fe09c6a2edd98e34314ad5b /src/directory.c | |
parent | 598db0d296a8c16e181b488040a324f9ae20cc33 (diff) | |
download | mpd-92a75471505391edd2f8f9af23188b4f7b17bbcb.tar.gz mpd-92a75471505391edd2f8f9af23188b4f7b17bbcb.tar.xz mpd-92a75471505391edd2f8f9af23188b4f7b17bbcb.zip |
begining of metadata rewrite:
now we support genre and date metadata, along with multiple metadata entries
for each type
git-svn-id: https://svn.musicpd.org/mpd/branches/r2562-metadata-handling-rewrite@2567 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/directory.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/directory.c b/src/directory.c index 0fa5e85f6..5ac94c534 100644 --- a/src/directory.c +++ b/src/directory.c @@ -1189,17 +1189,15 @@ int printSongInDirectory(FILE * fp, Song * song, void * data) { } static inline int strstrSearchTag(Song * song, int type, char * str) { - MpdTagItem * item; + int i; char * dup; if(!song->tag) return 0; - for(item = song->tag->tagItems; item && item->type!=TAG_ITEM_END; - item++) - { - if(item->type != type) continue; + for(i = 0; i < song->tag->numOfItems; i++) { + if(song->tag->items[i].type != type) continue; - dup = strDupToUpper(item->value); + dup = strDupToUpper(song->tag->items[i].value); if(strstr(dup, str)) return 1; free(dup); } @@ -1263,16 +1261,14 @@ int searchForSongsIn(FILE * fp, char * name, char * item, char * string) { } static inline int tagItemFoundAndMatches(Song * song, int type, char * str) { - MpdTagItem * item; + int i; if(!song->tag) return 0; - for(item = song->tag->tagItems; item && item->type != TAG_ITEM_END; - item++) - { - if(item->type != type) continue; + for(i = 0; i < song->tag->numOfItems; i++) { + if(song->tag->items[i].type != type) continue; - if( 0 == strcmp(str, item->value)) return 1; + if(0 == strcmp(str, song->tag->items[i].value)) return 1; } return 0; |