Skip to content

feat(metadata): write source URL into dedicated tag (#605)#863

Open
SnitchTeam wants to merge 1 commit into
spotbye:mainfrom
SnitchTeam:feat/605-source-url-metadata-tag
Open

feat(metadata): write source URL into dedicated tag (#605)#863
SnitchTeam wants to merge 1 commit into
spotbye:mainfrom
SnitchTeam:feat/605-source-url-metadata-tag

Conversation

@SnitchTeam
Copy link
Copy Markdown

Summary

Adds the originating source URL of each download to a dedicated metadata tag in addition to the existing COMMENT fallback, so library managers (MusicBrainz Picard, Beets, foobar2000, etc.) can read where the file came from.

Changes

  • FLAC: write Vorbis SOURCE tag when metadata.URL is non-empty.
  • MP3: write the standard ID3v2 WOAS (Official audio source webpage) URL frame, plus a TXXX user-defined frame with description SOURCE for maximum tagger compatibility (Picard/Beets).
  • M4A: pass -metadata source=<url> to ffmpeg.

The existing COMMENT/COMM/comment fallback behavior (URL written into the comment when no explicit comment is set) is preserved, so users relying on it are not affected. The new source tag is only written when metadata.URL is non-empty.

Notes

  • The bogem/id3v2 library does not expose a typed URL link frame, so WOAS is written via AddFrame("WOAS", id3v2.UnknownFrame{Body: []byte(url)}), which produces a spec-compliant URL link frame body (raw URL bytes, no encoding byte).
  • Diff is minimal (3 small additions in backend/metadata.go).

Test

  • go build ./...
  • go vet ./backend/...

Closes #605

Adds the originating URL to a dedicated metadata tag in addition to the existing COMMENT fallback: Vorbis SOURCE for FLAC, ID3 WOAS + TXXX/SOURCE for MP3, and 'source' for M4A. Improves compatibility with library managers like MusicBrainz Picard and Beets.

Closes spotbye#605
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.

[Feature Request] add/write file source to metadata

1 participant