M4A

Inheritance diagram of musify.libraries.local.track.m4a

The M4A implementation of a LocalTrack.

Classes:

M4ATagReader(file, tag_map[, remote_wrangler])

M4ATagWriter(file, tag_map[, remote_wrangler])

M4A(file[, remote_wrangler])

class musify.libraries.local.track.m4a.M4ATagReader(file, tag_map, remote_wrangler=None)

Bases: TagReader[MP4]

Methods:

read_tag(tag_ids)

Extract all tag values for a given list of tag IDs

read_track_number()

Extract track number tags from file

read_track_total()

Extract total track count tags from file

read_key()

Extract key tags from file

read_disc_number()

Extract disc number tags from file

read_disc_total()

Extract total disc count tags from file

read_images()

Extract image from file

read_tag(tag_ids)

Extract all tag values for a given list of tag IDs

Return type:

list[Any] | None

read_track_number()

Extract track number tags from file

Return type:

int | None

read_track_total()

Extract total track count tags from file

Return type:

int | None

read_key()

Extract key tags from file

Return type:

str | None

read_disc_number()

Extract disc number tags from file

Return type:

int | None

read_disc_total()

Extract total disc count tags from file

Return type:

int | None

read_images()

Extract image from file

class musify.libraries.local.track.m4a.M4ATagWriter(file, tag_map, remote_wrangler=None)

Bases: TagWriter[MP4]

Methods:

write_tag(tag_id, tag_value[, dry_run])

Generic method for updating a tag value in the file.

write_tag(tag_id, tag_value, dry_run=True)

Generic method for updating a tag value in the file.

Parameters:
  • tag_id (str | None) – ID of the tag for this file type.

  • tag_value (Any) – New value to assign.

  • dry_run (bool (default: True)) – Run function, but do not modify the file on the disk.

Returns:

bool – The index number of the conditional that was met to warrant updating the file’s tags. None if none of the conditions were met.

class musify.libraries.local.track.m4a.M4A(file, remote_wrangler=None)

Bases: LocalTrack[MP4, M4ATagReader, M4ATagWriter]

Attributes:

valid_extensions

Extensions of files that can be loaded by this class.

tag_map

Map of human-friendly tag name to ID3 tag ids for a given file type

valid_extensions: frozenset[str] = frozenset({'.m4a'})

Extensions of files that can be loaded by this class.

tag_map = TagMap(title=['©nam'], artist=['©ART'], album=['©alb'], album_artist=['aART'], track_number=['trkn'], track_total=['trkn'], genres=['----:com.apple.iTunes:GENRE', '©gen', 'gnre'], date=['©day'], year=(), month=(), day=(), bpm=['tmpo'], key=['----:com.apple.iTunes:INITIALKEY'], disc_number=['disk'], disc_total=['disk'], compilation=['cpil'], comments=['©cmt'], images=['covr'])

Map of human-friendly tag name to ID3 tag ids for a given file type