Skip to content

Commit

Permalink
Fix MP4 ID3 sort tag mapping
Browse files Browse the repository at this point in the history
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: #1302

#minor-release

PiperOrigin-RevId: 627486902
  • Loading branch information
icbaker authored and Copybara-Service committed Apr 23, 2024
1 parent 124c70a commit 3322092
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,11 @@ public static Metadata.Entry parseIlstElement(ParsableByteArray ilst) {
} 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) {
Expand Down

0 comments on commit 3322092

Please sign in to comment.