As pointed out in #54 , the metadata for .m4a files with E-AC3 codec was a bit wonky, due to using .mka as the intermediate container when re-ordering the audio and cover image streams. This pull request fixes this, as well as a few other things.
Additionally, for all files, but most pertinently to Dolby Atmos files, the process for adding metadata pertaining to a track's mixer and engineer has changed. To wit, the engineer tag for either .flac or .m4a looks for the following values, in a chain of if-not-exists-then-try-the-next-one:
self.engineer: Optional[Tuple[str]] = \
self.get_contributors("Engineer") or \
self.get_contributors("Mastering Engineer") or \
self.get_contributors("Immersive Mastering Engineer")
Similarly for mixer tag:
self.mixer: Optional[Tuple[str]] = \
self.get_contributors("Mixer") or \
self.get_contributors("Mix Engineer") or \
self.get_contributors("Mixing Engineer") or \
self.get_contributors("Atmos Mixing Engineer")
TIDAL's API is inconsistent on which variation is offered on a track-by-track basis, even within the same album!
Most importantly, however, this pull request changes the order of operations in getting and setting a track's metadata and its supporting files. Now, the order is the following:
Get track's metadata track.Track.get_metadata()
Check track.Track.metadata.media_metadata.tags against the selected audio format
Get the track's album, unless it's being passed in by the album.Album.get_tracks() process
If track's album is not None, execute track.Track.set_album_dir()
track.Track.save_artist_image()
track.Track.save_artist_bio()
track.Track.get_credits()
track.Track.get_stream()
track.Track.set_manifest()
track.Track.set_filename()
track.Track.set_outfile()
track.Track.get_lyrics()
track.Track.set_urls()
track.Track.download(), which uses either track.Track.download_url() or track.Track.download_urls() depending on the number of URLs (i.e., DASH versus TIDAL's JSON)
track.Track.set_mutagen()
track.Track.save_album_cover() if album cover was returned by the API and the album cover file successfully was written
track.Track.set_cover_image_tag()
If the track has an album cover stream as well as the audio stream, track.Track.reorder_streams()
As pointed out in #54 , the metadata for .m4a files with E-AC3 codec was a bit wonky, due to using .mka as the intermediate container when re-ordering the audio and cover image streams. This pull request fixes this, as well as a few other things.
Additionally, for all files, but most pertinently to Dolby Atmos files, the process for adding metadata pertaining to a track's mixer and engineer has changed. To wit, the engineer tag for either .flac or .m4a looks for the following values, in a chain of if-not-exists-then-try-the-next-one:
Similarly for mixer tag:
TIDAL's API is inconsistent on which variation is offered on a track-by-track basis, even within the same album!
Most importantly, however, this pull request changes the order of operations in getting and setting a track's metadata and its supporting files. Now, the order is the following:
track.Track.get_metadata()
track.Track.metadata.media_metadata.tags
against the selected audio formatalbum.Album.get_tracks()
processNone
, executetrack.Track.set_album_dir()
track.Track.save_artist_image()
track.Track.save_artist_bio()
track.Track.get_credits()
track.Track.get_stream()
track.Track.set_manifest()
track.Track.set_filename()
track.Track.set_outfile()
track.Track.get_lyrics()
track.Track.set_urls()
track.Track.download()
, which uses eithertrack.Track.download_url()
ortrack.Track.download_urls()
depending on the number of URLs (i.e., DASH versus TIDAL's JSON)track.Track.set_mutagen()
track.Track.save_album_cover()
if album cover was returned by the API and the album cover file successfully was writtentrack.Track.set_cover_image_tag()
track.Track.reorder_streams()
track.Track.craft_tags()
track.Track.set_tags()