feat(16-02): add go-flac dependencies and implement FLAC tag writer

- Add go-flac/go-flac/v2, flacvorbis/v2, flacpicture/v2 dependencies
- Create tagwriter.go with TagChanges type, field constants, format detection, MIME detection
- Create flac.go with writeFlacTags using Vorbis Comments + PICTURE blocks + AtomicWrite
- Implement replaceVorbisComment helper for case-insensitive field replacement
- Handle cover art add/replace/clear via PICTURE metadata blocks
This commit is contained in:
2026-03-17 10:32:28 -04:00
parent 4463d3e3e1
commit 3642cbe0d5
12 changed files with 379 additions and 0 deletions
@@ -10,6 +10,17 @@ import (
"database/sql"
)
const countReleaseGroupRecordings = `-- name: CountReleaseGroupRecordings :one
SELECT COUNT(*) FROM release_group_recordings WHERE release_group_id = ?
`
func (q *Queries) CountReleaseGroupRecordings(ctx context.Context, releaseGroupID int64) (int64, error) {
row := q.db.QueryRowContext(ctx, countReleaseGroupRecordings, releaseGroupID)
var count int64
err := row.Scan(&count)
return count, err
}
const createReleaseGroup = `-- name: CreateReleaseGroup :one
INSERT INTO release_groups (name) VALUES (?)
RETURNING id, name, cover_art_id, album_artist_credit_id, year, total_tracks, total_discs