Skip to main content

Module tags

Module tags 

Source
Expand description

ID3 tag access. Mirrors the mutagen calls in sfx_common.py.

Structs§

TextTags
The text frames discover-sfx reads: str(tags["TIT2"]), str(tags["TPE1"]), and the first USLT frame’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_wav always 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 TXXX frame whose description is desc, if present. Multi-value frames yield their first value, like mutagen’s text[0].
retag_title_comment
_retag_copy: replace TIT2 with title and COMM (eng, no description) with comment, 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_mp3 with 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 when status is not a known grade. Every other frame is kept in place.