Base

Inheritance diagram of musify.libraries.local.track.tags.base

The base processor definition for reading/manipulating tag data in an audio file.

Classes:

TagProcessor(file, tag_map[, remote_wrangler])

Base tag processor for reading/writing of tag metadata to a file.

class musify.libraries.local.track.tags.base.TagProcessor(file, tag_map, remote_wrangler=None)

Bases: ABC, Generic

Base tag processor for reading/writing of tag metadata to a file.

Parameters:
  • file (TypeVar(T, bound= FileType)) – The loaded Mutagen object of the file to extract tags from.

  • tag_map (TagMap) – The map of tag names to tag IDs for the given file type.

  • remote_wrangler (RemoteDataWrangler | None (default: None)) – Optionally, provide a RemoteDataWrangler object for processing URIs. This object will be used to check for and validate a URI tag on the file. The tag that is used for reading and writing is set by the uri_tag class attribute. If no remote_wrangler is given, no URI processing will occur.

Attributes:

uri_tag

The tag field to use as the URI tag in the file's metadata

num_sep

The separator to use when representing separated tag values as a combined string.

remote_source

The name of the remote service for which this TagProcessor can process remote data.

unavailable_uri_dummy

The value to use as a URI for an item which does not have an associated remote object.

file

tag_map

remote_wrangler

uri_tag: LocalTrackField = 44

The tag field to use as the URI tag in the file’s metadata

num_sep: str = '/'

The separator to use when representing separated tag values as a combined string. Used when some number type tag values come as a combined string i.e. track number/track total

property remote_source: str | None

The name of the remote service for which this TagProcessor can process remote data.

property unavailable_uri_dummy: str | None

The value to use as a URI for an item which does not have an associated remote object. An item that has this URI value will be excluded from most remote logic. If no remote_wrangler has been assigned to this object, return None.

file
tag_map
remote_wrangler