Expand description
ID3 tag access. Mirrors the mutagen calls in sfx_common.py.
Structs§
- Text
Tags - The text frames
discover-sfxreads:str(tags["TIT2"]),str(tags["TPE1"]), and the firstUSLTframe’s text.
Constants§
- SFX_
GRADE_ ACCURATE - SFX_
GRADE_ FRAME - The user-text frame that carries an SFX quality grade.
- SFX_
GRADE_ REJECTED
Functions§
- base_
frames 🔒 - The frames
tag_mp3/tag_wavalways write: album, genre, year. - chrono_
year 🔒 str(datetime.date.today().year)— the local date, as Python reads it.- read_
sfx_ grade 'accurate'/'rejected'from the file’s grade frame, else"". Never fails: a missing file, missing header, or unknown value all read as ungraded.- read_
text_ tags - Read the three frames, blank on any failure —
ID3(path)raising is swallowed by the caller in Python. Like mutagen, a file with no ID3v2 header falls back to its ID3v1 tag (title and artist only). - read_
txxx - Value of the
TXXXframe whose description isdesc, if present. Multi-value frames yield their first value, like mutagen’stext[0]. - retag_
title_ comment _retag_copy: replaceTIT2withtitleandCOMM(eng, no description) withcomment, leaving every other frame alone. A file with no tag gets a fresh one.- tag_mp3
tag_mp3(path, show, title, artist, lyrics, comments, cover_art_path): load any existing ID3 tag, replace these frames, save as ID3v2.4.- tag_
mp3_ full tag_mp3with every optional frame: USLT lyrics and an eng COMM comment.- tag_wav
tag_wav(path, show, title, artist): an ID3v2.4 chunk in the RIFF file.- write_
sfx_ grade write_sfx_grade(path, status): set the grade frame, or clear it whenstatusis not a known grade. Every other frame is kept in place.