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
@@ -26,3 +26,9 @@ WHERE id = ?;
-- name: DeleteAllArtistCredits :exec
DELETE FROM artist_credit;
-- name: CountArtistCreditReferences :one
SELECT
(SELECT COUNT(*) FROM recordings WHERE artist_credit_id = ?1) +
(SELECT COUNT(*) FROM release_groups WHERE album_artist_credit_id = ?1)
AS total;
+6
View File
@@ -103,6 +103,12 @@ LEFT JOIN file_types ft ON af.file_type_id = ft.id
WHERE g.name = ? AND af.library_id = ?
ORDER BY r.name;
-- name: CountGenreReferences :one
SELECT COUNT(*) FROM recording_genres WHERE genre_id = ?;
-- name: DeleteGenre :exec
DELETE FROM genres WHERE id = ?;
-- name: GetAllGenresWithCounts :many
SELECT g.name, COUNT(rg.recording_id) AS track_count
FROM genres g
@@ -34,3 +34,6 @@ DELETE FROM recordings;
-- name: GetAllRecordings :many
SELECT * FROM recordings
ORDER BY name;
-- name: CountRecordingsByArtistCredit :one
SELECT COUNT(*) FROM recordings WHERE artist_credit_id = ?;
@@ -111,6 +111,9 @@ LEFT JOIN (
WHERE aca.artist_id = ?
ORDER BY rg.name;
-- name: CountReleaseGroupRecordings :one
SELECT COUNT(*) FROM release_group_recordings WHERE release_group_id = ?;
-- name: GetAlbumsByArtistByLibrary :many
SELECT
rg.id,