From 7dc8bfc806187ff78d0d3f0484bb5a5f32d9a009 Mon Sep 17 00:00:00 2001 From: Urs Fleisch Date: Sat, 23 Dec 2023 16:02:49 +0100 Subject: [PATCH] Fix property mappings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For MP4 map ENCODEDBY to ©enc instead of ©too, which is now mapped to ENCODING. For ASF, add new properties ENCODINGTIME (WM/EncodingTime) and FILEWEBPAGE (WM/AudioFileURL). --- CHANGELOG.md | 7 +++++-- taglib/asf/asftag.cpp | 2 ++ taglib/mp4/mp4itemfactory.cpp | 3 ++- taglib/toolkit/propertymapping.dox | 12 ++++++------ tests/test_asf.cpp | 2 ++ tests/test_mp4.cpp | 3 ++- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9dac2f5..7f24051c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,8 @@ TagLib 2.0 (Jan 24, 2024) - The stream operator for String uses UTF-8 instead of ISO-8859-1 encoding. - MP4 property ORIGINALDATE is mapped to "----:com.apple.iTunes:ORIGINALDATE" instead of "----:com.apple.iTunes:originaldate". + - MP4 property ENCODEDBY is mapped to "©enc" instead of "©too", which is now + mapped to ENCODING. * Unified interface for complex properties like pictures. * Simplified the unified properties interface by providing its methods on FileRef. @@ -97,8 +99,9 @@ TagLib 2.0 (Jan 24, 2024) * Build system: Fixed PackageConfig to support both relative and absolute paths. * Build system: utf8cpp is no longer included, it can be provided via a system package or a Git submodule. - * ASF: Support additional properties ARTISTWEBPAGE, ENCODING, INITIALKEY, - ORIGINALALBUM, ORIGINALARTIST, ORIGINALFILENAME, ORIGINALLYRICIST. + * ASF: Support additional properties ARTISTWEBPAGE, ENCODING, ENCODINGTIME, + FILEWEBPAGE, INITIALKEY, ORIGINALALBUM, ORIGINALARTIST, ORIGINALFILENAME, + ORIGINALLYRICIST. * ID3v2: Fixed extensibility of FrameFactory, use it also for WAV and AIFF files. * MP4: Support additional properties OWNER, RELEASEDATE. diff --git a/taglib/asf/asftag.cpp b/taglib/asf/asftag.cpp index 93fac8b6..f6ec38e1 100644 --- a/taglib/asf/asftag.cpp +++ b/taglib/asf/asftag.cpp @@ -259,6 +259,8 @@ namespace std::pair("WM/Barcode", "BARCODE"), std::pair("WM/EncodedBy", "ENCODEDBY"), std::pair("WM/EncodingSettings", "ENCODING"), + std::pair("WM/EncodingTime", "ENCODINGTIME"), + std::pair("WM/AudioFileURL", "FILEWEBPAGE"), std::pair("WM/AlbumSortOrder", "ALBUMSORT"), std::pair("WM/AlbumArtistSortOrder", "ALBUMARTISTSORT"), std::pair("WM/ArtistSortOrder", "ARTISTSORT"), diff --git a/taglib/mp4/mp4itemfactory.cpp b/taglib/mp4/mp4itemfactory.cpp index e89e5844..da92d63f 100644 --- a/taglib/mp4/mp4itemfactory.cpp +++ b/taglib/mp4/mp4itemfactory.cpp @@ -329,7 +329,8 @@ Map ItemFactory::namePropertyMap() const {"tmpo", "BPM"}, {"cprt", "COPYRIGHT"}, {"\251lyr", "LYRICS"}, - {"\251too", "ENCODEDBY"}, + {"\251too", "ENCODING"}, + {"\251enc", "ENCODEDBY"}, {"soal", "ALBUMSORT"}, {"soaa", "ALBUMARTISTSORT"}, {"soar", "ARTISTSORT"}, diff --git a/taglib/toolkit/propertymapping.dox b/taglib/toolkit/propertymapping.dox index 7a87f612..67450af8 100644 --- a/taglib/toolkit/propertymapping.dox +++ b/taglib/toolkit/propertymapping.dox @@ -36,12 +36,12 @@ | DISCNUMBER | TPOS | | disk | DISC | WM/PartOfSet | | DISCSUBTITLE | TSST | PRT1 | \----:com.apple.iTunes:DISCSUBTITLE | | WM/SetSubTitle | | DJMIXER | | | \----:com.apple.iTunes:DJMIXER | | | -| ENCODEDBY | TENC | ITCH | ©too | | WM/EncodedBy | -| ENCODING | TSSE | ISFT | | | WM/EncodingSettings | -| ENCODINGTIME | TDEN | IDIT | | | | +| ENCODEDBY | TENC | ITCH | ©enc | | WM/EncodedBy | +| ENCODING | TSSE | ISFT | ©too | | WM/EncodingSettings | +| ENCODINGTIME | TDEN | IDIT | | | WM/EncodingTime | | ENGINEER | | | \----:com.apple.iTunes:ENGINEER | | | | FILETYPE | TFLT | | | | | -| FILEWEBPAGE | WOAF | | | | | +| FILEWEBPAGE | WOAF | | | | WM/AudioFileURL | | GAPLESSPLAYBACK | | | pgap | | | | GENRE | TCON | IGNR | ©gen | | WM/Genre | | GROUPING | GRP1 | | ©grp | | | @@ -50,9 +50,9 @@ | ISRC | TSRC | ISRC | \----:com.apple.iTunes:ISRC | | WM/ISRC | | LABEL | TPUB | IPUB | \----:com.apple.iTunes:LABEL | | WM/Publisher | | LANGUAGE | TLAN | ILNG | \----:com.apple.iTunes:LANGUAGE | | WM/Language | -| LENGTH | TLEN | | \----:com.apple.iTunes:LYRICIST | | | +| LENGTH | TLEN | | | | | | LICENSE | | | \----:com.apple.iTunes:LICENSE | | | -| LYRICIST | TEXT | IWRI | | | WM/Writer | +| LYRICIST | TEXT | IWRI | \----:com.apple.iTunes:LYRICIST | | WM/Writer | | LYRICS | USLT | | ©lyr | | WM/Lyrics | | MEDIA | TMED | IMED | \----:com.apple.iTunes:MEDIA | | WM/Media | | MIXER | | | \----:com.apple.iTunes:MIXER | | | diff --git a/tests/test_asf.cpp b/tests/test_asf.cpp index bd330c6c..538fd7ee 100644 --- a/tests/test_asf.cpp +++ b/tests/test_asf.cpp @@ -331,6 +331,8 @@ public: tags["DISCSUBTITLE"] = StringList("Disc Subtitle"); tags["ENCODEDBY"] = StringList("Encoded by"); tags["ENCODING"] = StringList("Encoding"); + tags["ENCODINGTIME"] = StringList("2021-01-03 11:52:19"); + tags["FILEWEBPAGE"] = StringList("File Webpage"); tags["GENRE"] = StringList("Genre"); tags["WORK"] = StringList("Grouping"); tags["INITIALKEY"] = StringList("Initial Key"); diff --git a/tests/test_mp4.cpp b/tests/test_mp4.cpp index c83210fb..47c88c6d 100644 --- a/tests/test_mp4.cpp +++ b/tests/test_mp4.cpp @@ -480,6 +480,7 @@ public: tags["DISCSUBTITLE"] = StringList("Disc Subtitle"); tags["DJMIXER"] = StringList("DJ Mixer"); tags["ENCODEDBY"] = StringList("Encoded by"); + tags["ENCODING"] = StringList("Encoding"); tags["ENGINEER"] = StringList("Engineer"); tags["GAPLESSPLAYBACK"] = StringList("1"); tags["GENRE"] = StringList("Genre"); @@ -732,7 +733,7 @@ public: PropertyMap properties = f.properties(); CPPUNIT_ASSERT_EQUAL(StringList("Test Artist!!!!"), properties["ARTIST"]); - CPPUNIT_ASSERT_EQUAL(StringList("FAAC 1.24"), properties["ENCODEDBY"]); + CPPUNIT_ASSERT_EQUAL(StringList("FAAC 1.24"), properties["ENCODING"]); } }