diff options
author | jmarshallnz <jcmarsha@gmail.com> | 2014-02-28 08:05:31 +1300 |
---|---|---|
committer | jmarshallnz <jcmarsha@gmail.com> | 2014-02-28 08:05:31 +1300 |
commit | 9e268dce6c6738ad56cc1222c94c00574b3cd8d0 (patch) | |
tree | f8cd4f515e735c3d685e19072d3314b1b766e8e6 | |
parent | f2646d961f413251cd5e5a112fe676e643798bf3 (diff) | |
parent | 5cd1b86f867fdce16db5dde52958ed3dab6528c2 (diff) |
Merge pull request #4253 from jmarshallnz/shouty_tags
[id3v2] some apps write TXXX tags using UPPERCASE and some with lowercase.
-rw-r--r-- | xbmc/music/tags/TagLoaderTagLib.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/xbmc/music/tags/TagLoaderTagLib.cpp b/xbmc/music/tags/TagLoaderTagLib.cpp index 36e4592c2f..9497413c57 100644 --- a/xbmc/music/tags/TagLoaderTagLib.cpp +++ b/xbmc/music/tags/TagLoaderTagLib.cpp @@ -396,16 +396,17 @@ bool CTagLoaderTagLib::ParseID3v2Tag(ID3v2::Tag *id3v2, EmbeddedArt *art, CMusic // First field is the same as the description StringList stringList = frame->fieldList(); stringList.erase(stringList.begin()); - if (frame->description() == "MusicBrainz Artist Id") tag.SetMusicBrainzArtistID(StringListToVectorString(stringList)); - else if (frame->description() == "MusicBrainz Album Id") tag.SetMusicBrainzAlbumID(stringList.front().to8Bit(true)); - else if (frame->description() == "MusicBrainz Album Artist Id") tag.SetMusicBrainzAlbumArtistID(StringListToVectorString(stringList)); - else if (frame->description() == "MusicBrainz Album Artist") SetAlbumArtist(tag, StringListToVectorString(stringList)); - else if (frame->description() == "replaygain_track_gain") tag.SetReplayGainTrackGain((int)(atof(stringList.front().toCString(true)) * 100 + 0.5)); - else if (frame->description() == "replaygain_album_gain") tag.SetReplayGainAlbumGain((int)(atof(stringList.front().toCString(true)) * 100 + 0.5)); - else if (frame->description() == "replaygain_track_peak") tag.SetReplayGainTrackPeak((float)atof(stringList.front().toCString(true))); - else if (frame->description() == "replaygain_album_peak") tag.SetReplayGainAlbumPeak((float)atof(stringList.front().toCString(true))); - else if (frame->description() == "ALBUMARTIST") SetAlbumArtist(tag, StringListToVectorString(stringList)); - else if (frame->description() == "ALBUM ARTIST") SetAlbumArtist(tag, StringListToVectorString(stringList)); + String desc = frame->description().upper(); + if (desc == "MUSICBRAINZ ARTIST ID") tag.SetMusicBrainzArtistID(StringListToVectorString(stringList)); + else if (desc == "MUSICBRAINZ ALBUM ID") tag.SetMusicBrainzAlbumID(stringList.front().to8Bit(true)); + else if (desc == "MUSICBRAINZ ALBUM ARTIST ID") tag.SetMusicBrainzAlbumArtistID(StringListToVectorString(stringList)); + else if (desc == "MUSICBRAINZ ALBUM ARTIST") SetAlbumArtist(tag, StringListToVectorString(stringList)); + else if (desc == "REPLAYGAIN_TRACK_GAIN") tag.SetReplayGainTrackGain((int)(atof(stringList.front().toCString(true)) * 100 + 0.5)); + else if (desc == "REPLAYGAIN_ALBUM_GAIN") tag.SetReplayGainAlbumGain((int)(atof(stringList.front().toCString(true)) * 100 + 0.5)); + else if (desc == "REPLAYGAIN_TRACK_PEAK") tag.SetReplayGainTrackPeak((float)atof(stringList.front().toCString(true))); + else if (desc == "REPLAYGAIN_ALBUM_PEAK") tag.SetReplayGainAlbumPeak((float)atof(stringList.front().toCString(true))); + else if (desc == "ALBUMARTIST") SetAlbumArtist(tag, StringListToVectorString(stringList)); + else if (desc == "ALBUM ARTIST") SetAlbumArtist(tag, StringListToVectorString(stringList)); else if (g_advancedSettings.m_logLevel == LOG_LEVEL_MAX) CLog::Log(LOGDEBUG, "unrecognized user text tag detected: TXXX:%s", frame->description().toCString(true)); } |