diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-06-01 10:28:06 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-06-01 10:28:06 +0000 |
commit | 199ad37e22ac9e3e801506793f3c0897ed62bc68 (patch) | |
tree | 837d7452072ace239cac857d396b80622c6b4361 /src/tag.c | |
parent | decce92949d7a35f1e27804df45fa61568e69548 (diff) | |
download | mpd-199ad37e22ac9e3e801506793f3c0897ed62bc68.tar.gz mpd-199ad37e22ac9e3e801506793f3c0897ed62bc68.tar.xz mpd-199ad37e22ac9e3e801506793f3c0897ed62bc68.zip |
more efficient of updating of metadata
git-svn-id: https://svn.musicpd.org/mpd/trunk@1277 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/tag.c')
-rw-r--r-- | src/tag.c | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -184,4 +184,26 @@ MpdTag * mpdTagDup(MpdTag * tag) { return ret; } -/* vim:set shiftwidth=4 tabstop=8 expandtab: */ + +int mpdTagStringsAreEqual(char * s1, char * s2) { + if(s1 && s2) { + if(strcmp(s1, s2)) return 0; + } + else if(s1 || s2) return 0; + + return 1; +} + +int mpdTagsAreEqual(MpdTag * tag1, MpdTag * tag2) { + if(tag1 == NULL && tag2 == NULL) return 1; + else if(!tag1 || ! !tag2) return 0; + + if(tag1->time != tag2->time) return 0; + + if(!mpdTagStringsAreEqual(tag1->artist, tag2->artist)) return 0; + if(!mpdTagStringsAreEqual(tag1->album, tag2->album)) return 0; + if(!mpdTagStringsAreEqual(tag1->track, tag2->track)) return 0; + if(!mpdTagStringsAreEqual(tag1->title, tag2->title)) return 0; + + return 1; +} |