Skip to main content

Module id3w

Module id3w 

Source
Expand description

An ID3v2.4 reader/writer that saves exactly what mutagen saves.

The pipeline records SHA-256 digests of stems in manifests and logs, so a tag that merely reads the same is not enough: the bytes must match. This follows mutagen.id3 1.47’s save path:

  • frames sorted by (priority, len(frame data), HashKey), priority being the index in TIT2 TPE1 TRCK TALB TPOS TDRC TCON, then everything else, then APIC (whose relative order is kept);
  • every encoded string followed by its terminator, text frames with an empty "\0".join(text) dropped entirely;
  • padding from PaddingInfo.get_default_padding — keep the space already there unless it exceeds 10 KiB + 1 % of the file, otherwise 1 KiB + 0.1 % — with the old tag region resized in place.

Frames this module does not model are carried over byte for byte.

Structs§

Frame
Tag
A loaded (or fresh) tag, frames keyed and ordered as mutagen’s dict.

Enums§

Body

Constants§

ORDER 🔒

Functions§

encode 🔒
encoded_text 🔒
existing_tag_size 🔒
The size of an existing ID3v2 tag at the start of data (header included), or 0.
parse_body 🔒
read_encoded 🔒
Split one terminated string off the front of data.
read_multi 🔒
read_syncsafe 🔒
syncsafe 🔒
term 🔒
write_body 🔒