mirror of
https://github.com/taglib/taglib.git
synced 2025-07-19 05:24:25 -04:00
More support for the unified dictionary interface.
Addded fromDict() function to ID3v2Tag. Added fromDict() and toDict() functions to the TagUnion class (uses the first non-empty tag). Added fromDict() and toDict() functions for the generic Tag class, only handling common tags without duplicates. Addded preliminary mp3 test case. Python3 bindings now available on my github site.
This commit is contained in:
BIN
tests/data/rare_frames.mp3
Normal file
BIN
tests/data/rare_frames.mp3
Normal file
Binary file not shown.
@ -554,7 +554,7 @@ public:
|
||||
string newname = copy.fileName();
|
||||
MPEG::File f(newname.c_str());
|
||||
TagDict dict = f.ID3v2Tag(false)->toDict();
|
||||
CPPUNIT_ASSERT_EQUAL(uint(7), dict.size());
|
||||
CPPUNIT_ASSERT_EQUAL(uint(6), dict.size());
|
||||
CPPUNIT_ASSERT_EQUAL(String("userTextData1"), dict["USERTEXTDESCRIPTION1"][0]);
|
||||
CPPUNIT_ASSERT_EQUAL(String("userTextData2"), dict["USERTEXTDESCRIPTION1"][1]);
|
||||
CPPUNIT_ASSERT_EQUAL(String("userTextData1"), dict["USERTEXTDESCRIPTION2"][0]);
|
||||
@ -566,8 +566,6 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(String("http://a.user.url"), dict["USERURL"][0]);
|
||||
CPPUNIT_ASSERT_EQUAL(String("http://a.user.url/with/empty/description"), dict["URL"][0]);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(String("12345678 [supermihi@web.de]"), dict["UNIQUEIDENTIFIER"][0]);
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(String("A COMMENT"), dict["COMMENT"][0]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user