Repository navigation
Set the YouTube tags together with who wrote them - #118
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 toTrue. Any tags set without going throughread_song(), e.g. withset_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 aValueError, so the flag is never left behind describing tags that were replaced. The flag is read-only, and it'sFalseuntil 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, becauseYOUTUBEhas the same type as the sources thatset_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