Add AAC/M4A support to tag parsing (#3004)
authorOzGav <gavnosp@hotmail.com>
Mon, 26 Jan 2026 11:39:22 +0000 (22:39 +1100)
committerGitHub <noreply@github.com>
Mon, 26 Jan 2026 11:39:22 +0000 (12:39 +0100)
commit54a510b29bb1a5190d29f853fd65a7d003f62aff
treef6bfee641a7ef68d506a0d8c4569a8e74c43be8b
parent7eea22d3a818df62979ae14afdbb13965941cc5d
Add AAC/M4A support to tag parsing (#3004)

Fix AAC/M4A tag parsing in parse_tags_mutagen

Add comprehensive MP4/AAC tag parsing support to the mutagen fallback parser.
Previously only ID3 tags were handled, leaving M4A/AAC files with missing metadata.

Changes:
- Add _parse_mp4_tags() function to handle MP4Tags format
- Support basic tags: title, artist, album, albumartist, genre
- Support sort tags: titlesort, artistsort, albumsort, albumartistsort
- Support MusicBrainz IDs via freeform tags (----:com.apple.iTunes:*)
- Support track/disc numbers with totals stored separately
- Support date, lyrics, compilation flag, album type, and ReplayGain tags
- Add helper functions for decoding MP4 freeform tags (bytes to strings)
- Add M4A test fixture and test_parse_metadata_from_mp4tags test

Co-authored-by: Claude <noreply@anthropic.com>
music_assistant/helpers/tags.py
pyproject.toml
tests/core/test_tags.py
tests/fixtures/MyArtist - MyTitle.m4a [new file with mode: 0644]