From cf1acebc9925c3e51de50c132ce1a171c9e24675 Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Thu, 19 Jul 2007 15:20:10 +0000 Subject: [PATCH] Work around the fact that iTunes can't properly parse ID3v2.4 numerical genres. git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@689932 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- taglib/mpeg/id3v2/id3v2tag.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/taglib/mpeg/id3v2/id3v2tag.cpp b/taglib/mpeg/id3v2/id3v2tag.cpp index 333e5f60..4a3c7386 100644 --- a/taglib/mpeg/id3v2/id3v2tag.cpp +++ b/taglib/mpeg/id3v2/id3v2tag.cpp @@ -219,12 +219,23 @@ void ID3v2::Tag::setGenre(const String &s) return; } + // iTunes can't handle correctly encoded ID3v2.4 numerical genres. Just use + // strings until iTunes sucks less. + +#ifdef NO_ITUNES_HACKS + int index = ID3v1::genreIndex(s); if(index != 255) setTextFrame("TCON", String::number(index)); else setTextFrame("TCON", s); + +#else + + setTextFrame("TCON", s); + +#endif } void ID3v2::Tag::setYear(uint i)