From e76466097b281a31fc344f8cc6c62048eaf4845c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Sat, 3 Apr 2010 16:58:03 +0000 Subject: [PATCH] Don't upgrade ID3v2.2 TDA frame when upgrading to TRCD We already do this for TDAT. Using both parts, the year and the date, would be better we the code currently doesn't have enough context to do that. BUG:228968 git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1110552 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- taglib/mpeg/id3v2/id3v2framefactory.cpp | 4 ++-- tests/data/id3v22-tda.mp3 | Bin 0 -> 8192 bytes tests/test_id3v2.cpp | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tests/data/id3v22-tda.mp3 diff --git a/taglib/mpeg/id3v2/id3v2framefactory.cpp b/taglib/mpeg/id3v2/id3v2framefactory.cpp index e412cb30..1d39a713 100644 --- a/taglib/mpeg/id3v2/id3v2framefactory.cpp +++ b/taglib/mpeg/id3v2/id3v2framefactory.cpp @@ -282,7 +282,8 @@ bool FrameFactory::updateFrame(Frame::Header *header) const frameID == "LNK" || frameID == "RVA" || frameID == "TIM" || - frameID == "TSI") + frameID == "TSI" || + frameID == "TDA") { debug("ID3v2.4 no longer supports the frame type " + String(frameID) + ". It will be discarded from the tag."); @@ -310,7 +311,6 @@ bool FrameFactory::updateFrame(Frame::Header *header) const convertFrame("TCM", "TCOM", header); convertFrame("TCO", "TCON", header); convertFrame("TCR", "TCOP", header); - convertFrame("TDA", "TDRC", header); convertFrame("TDY", "TDLY", header); convertFrame("TEN", "TENC", header); convertFrame("TFT", "TFLT", header); diff --git a/tests/data/id3v22-tda.mp3 b/tests/data/id3v22-tda.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..d89ae1c4473cfeec3d8c9a1ecf8c2fe0f4570506 GIT binary patch literal 8192 zcmeHLbyQSeyFLRm*9KD=fjr_fIbPcotR+0ate{P6N z{Ii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JtE5*>K3-UIX*>v$sqk z{Dbc2Xqiba25#(i=r>sqIUCyty~;i-Oa@0@FqH^PX6_k%$tS9U1!;z(wz>6N98Z*bzhsmJ zZczs%@)VM=yXL+rJG9c@UDREBdAD!j^({!8`(mfQ)$5(iQDiM-OGe zC`)}$EBvj!qJ3vmO&}Rc#klAM%w>h0tcVbj=xn_a9a_HHgT`H|oaB z=YNcqn(_(WmUcGt45~mwf8Y&DTsnJdt=vm&oV>VZiN4KAlPUPN<<%FNU#zSIml~YL zb9Tw})h9$WX5**=)-WoxwLfKZU)|R8B7#Ko9QZEm@DNOR&1C5{mi}E3HSz z_;pC-p=0Hiqyt`>3uwQ6y4NpJ&Chc>r%zVy5oIv6Xf}fvWf2<;wiWRVE<9$ggf8B= gmDHtvN}cDCqAKF<0a+$?5x+?`8dJRcf}i@o0H*sZg#Z8m literal 0 HcmV?d00001 diff --git a/tests/test_id3v2.cpp b/tests/test_id3v2.cpp index 64f6461f..860e9119 100644 --- a/tests/test_id3v2.cpp +++ b/tests/test_id3v2.cpp @@ -59,6 +59,8 @@ class TestID3v2 : public CppUnit::TestFixture CPPUNIT_TEST(testUpdateGenre23_1); CPPUNIT_TEST(testUpdateGenre23_2); CPPUNIT_TEST(testUpdateGenre24); + CPPUNIT_TEST(testUpdateDate22); + // CPPUNIT_TEST(testUpdateFullDate22); TODO TYE+TDA should be upgraded to TDRC together CPPUNIT_TEST_SUITE_END(); public: @@ -439,6 +441,20 @@ public: CPPUNIT_ASSERT_EQUAL(String("R&B Eurodisco"), tag.genre()); } + void testUpdateDate22() + { + MPEG::File f("data/id3v22-tda.mp3", false); + CPPUNIT_ASSERT(f.tag()); + CPPUNIT_ASSERT_EQUAL(TagLib::uint(2010), f.tag()->year()); + } + + void testUpdateFullDate22() + { + MPEG::File f("data/id3v22-tda.mp3", false); + CPPUNIT_ASSERT(f.tag()); + CPPUNIT_ASSERT_EQUAL(String("2010-04-03"), f.ID3v2Tag()->frameListMap()["TDRC"].front()->toString()); + } + }; CPPUNIT_TEST_SUITE_REGISTRATION(TestID3v2); -- 2.40.0