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 00000000..d89ae1c4 Binary files /dev/null and b/tests/data/id3v22-tda.mp3 differ 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);