Fix MP4 ID3 sort tag mapping

The ID3 tags are documented here:
https://wiki.hydrogenaud.io/index.php?title=Foobar2000:ID3_Tag_Mapping

The MP4 fourcc types are documented here:
https://mutagen.readthedocs.io/en/latest/api/mp4.html#mutagen.mp4.MP4Tags

From the field definitions at the top of this file:

* `TYPE_SORT_ALBUM = 0x736f616c = 'soal'`
* `TYPE_SORT_ARTIST = 0x736f6172 = 'soar'`
* `TYPE_SORT_ALBUM_ARTIST = 0x736f6161 = 'soaa'`

Issue: androidx/media#1302

#minor-release

PiperOrigin-RevId: 627486902
This commit is contained in:
ibaker 2024-04-23 13:26:15 -07:00 committed by Copybara-Service
parent 124c70ac26
commit 3322092070
2 changed files with 7 additions and 3 deletions

View File

@ -21,6 +21,10 @@
* Video:
* Text:
* Metadata:
* Fix mapping of MP4 to ID3 sort tags. Previously the 'album sort'
(`soal`), 'artist sort' (`soar`) and 'album artist sort' (`soaa`) MP4
tags were wrongly mapped to the `TSO2`, `TSOA` and `TSOP` ID3 tags
([#1302](https://github.com/androidx/media/issues/1302)).
* Image:
* DRM:
* Allow setting a `LoadErrorHandlingPolicy` on

View File

@ -387,11 +387,11 @@ import com.google.common.collect.ImmutableList;
} else if (type == TYPE_SORT_TRACK_NAME) {
return parseTextAttribute(type, "TSOT", ilst);
} else if (type == TYPE_SORT_ALBUM) {
return parseTextAttribute(type, "TSO2", ilst);
} else if (type == TYPE_SORT_ARTIST) {
return parseTextAttribute(type, "TSOA", ilst);
} else if (type == TYPE_SORT_ALBUM_ARTIST) {
} else if (type == TYPE_SORT_ARTIST) {
return parseTextAttribute(type, "TSOP", ilst);
} else if (type == TYPE_SORT_ALBUM_ARTIST) {
return parseTextAttribute(type, "TSO2", ilst);
} else if (type == TYPE_SORT_COMPOSER) {
return parseTextAttribute(type, "TSOC", ilst);
} else if (type == TYPE_RATING) {