From dea1f32ea23c39fbda2d24e42f4e25d062dc6a04 Mon Sep 17 00:00:00 2001 From: "craig.p.drummond@gmail.com" Date: Tue, 26 Jun 2012 11:23:35 +0000 Subject: [PATCH] Fix noticing of tag chages when MPD database is updated. When comparing songs need to check all fields - not just filename! --- ChangeLog | 2 ++ mpd/song.cpp | 38 +++++++++++++++++++++++++++----------- mpd/song.h | 3 ++- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4f916b0bc..c48cfff32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -76,6 +76,8 @@ workaround applied - revert this before requesting data. 48. When reading mpd.conf file, if bind_to_address is set to "any", then use default of "locahost". +49. Fix noticing of tag chages when MPD database is updated. When comparing + songs need to check all fields - not just filename! 0.7.1 ----- diff --git a/mpd/song.cpp b/mpd/song.cpp index 5bad9078c..8c09c58f8 100644 --- a/mpd/song.cpp +++ b/mpd/song.cpp @@ -75,41 +75,57 @@ Song & Song::operator=(const Song &s) bool Song::operator==(const Song &o) const { - return file == o.file; + return 0==compareTo(o); } bool Song::operator<(const Song &o) const +{ + return compareTo(o)<0; +} + +int Song::compareTo(const Song &o) const { bool sortDateBeforeAlbum=MusicLibraryItemAlbum::showDate(); int compare=albumArtist().localeAwareCompare(o.albumArtist()); if (0!=compare) { - return compare<0; + return compare; } if (sortDateBeforeAlbum && year!=o.year) { - return year