FLAC
The FLAC implementation of a LocalTrack
.
Classes:
|
|
|
|
|
- class musify.libraries.local.track.flac.FLACTagReader(file, tag_map, remote_wrangler=None)
Bases:
TagReader
[FLAC
]Methods:
Extract image from file
Check if file has embedded images
- read_images()
Extract image from file
- check_for_images()
Check if file has embedded images
- Return type:
bool
- class musify.libraries.local.track.flac.FLACTagWriter(file, tag_map, remote_wrangler=None)
Bases:
TagWriter
[FLAC
]Methods:
write_tag
(tag_id, tag_value[, dry_run])Generic method for updating a tag value in the file.
delete_tag
(tag_name[, dry_run])Remove a tag by its tag name.
- 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.
- delete_tag(tag_name, dry_run=True)
Remove a tag by its tag name.
- Parameters:
tag_name (
str
) – Tag name as found inTagMap
to remove.dry_run (
bool
(default:True
)) – Run function, but do not modify the file on the disk.
- Returns:
bool
– True if tag has been remove, False otherwise.
- class musify.libraries.local.track.flac.FLAC(file, remote_wrangler=None)
Bases:
LocalTrack
[FLAC
,FLACTagReader
,FLACTagWriter
]Attributes:
Extensions of files that can be loaded by this class.
Map of human-friendly tag name to ID3 tag ids for a given file type
- valid_extensions: frozenset[str] = frozenset({'.flac'})
Extensions of files that can be loaded by this class.
- tag_map = TagMap(title=['title'], artist=['artist'], album=['album'], album_artist=['albumartist'], track_number=['tracknumber', 'track'], track_total=['tracktotal'], genres=['genre'], date=['date', 'year'], year=['year'], month=(), day=(), bpm=['bpm'], key=['initialkey'], disc_number=['discnumber'], disc_total=['disctotal'], compilation=['compilation'], comments=['comment', 'description'], images=())
Map of human-friendly tag name to ID3 tag ids for a given file type