Skip to content

Set the YouTube tags together with who wrote them - #118

Merged
gevhaz merged 1 commit into
mainfrom
claude/intelligent-keller-9das92
Nov 7, 2026
Merged

gevhaz merged 1 commit into
mainfrom
claude/intelligent-keller-9das92

Conversation

@gevhaz

@gevhaz gevhaz commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Where the YouTube description ranks against MusicBrainz depends on TagTable.youtube_is_auto_generated. The flag was set separately from the YouTube tags and defaulted to True. Any tags set without going through read_song(), e.g. with set_tags(YOUTUBE, …), ranked the description above MusicBrainz, even when the uploader wrote it.

The YouTube tags are now set with set_youtube_tags(tags, is_auto_generated=…), which stores the tags and the flag together. The flag can't be left out because it's keyword-only and has no default. set_tags(YOUTUBE, …) raises a ValueError, so the flag is never left behind describing tags that were replaced. The flag is read-only, and it's False until a description is set, so a description isn't trusted above MusicBrainz unless something says YouTube generated it.

set_tags(YOUTUBE, …) is rejected when the code runs, not by mypy, because YOUTUBE has the same type as the sources that set_tags() accepts.

The tags parsed from the YouTube tags (PARSED_FROM_YOUTUBE) are still set on their own, but their rank also depends on the flag. read_song() always sets them together with the description. Set without a description, they rank as if the uploader wrote it.

Closes #86


Generated by Claude Code

TagTable.youtube_is_auto_generated defaulted to True and was set
separately from the YouTube tags, so tags set with set_tags(YOUTUBE, …)
ranked the description above MusicBrainz even when the uploader wrote
it.

Setting the YouTube tags now requires saying whether the description
is auto-generated, through set_youtube_tags(), and set_tags() refuses
YOUTUBE. The flag is read-only and is False until a description is set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019JcntoSF2xPkzAWLdTzdoc
@gevhaz
gevhaz merged commit f9b592b into main Nov 7, 2026
4 checks passed
@gevhaz
gevhaz deleted the claude/intelligent-keller-9das92 branch November 7, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stop defaulting to trusting the YouTube description

2 participants