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
This commit is contained in:
Lukáš Lalinský 2010-04-03 16:58:03 +00:00
parent 6612abce72
commit e76466097b
3 changed files with 18 additions and 2 deletions

View File

@ -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);

BIN
tests/data/id3v22-tda.mp3 Normal file

Binary file not shown.

View File

@ -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);