release / go (push) Successful in 1m54s
release / web (push) Failing after 5s
release / integration (push) Failing after 3m44s
release / govulncheck (push) Successful in 20s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / Build signed APK (push) Canceled after 19s
release / android (push) Canceled after 2m37s
Minstrel is now a viewer of the library it is pointed at. Finding, downloading and filing music moves out of it. Removed from the server: - the request flow (requests, approval, auto-approve) and the wanted list, follows, release profiles and release blocks; - searching indexers, the download clients, the importer, the album lifecycle and missing-file re-acquisition; - the catalogue's discography, search and art (the MusicBrainz release and track-list cache stays, for the duplicate resolver); - Discover: its suggestions of artists not in the library, snoozes, the candidate-artist tag enrichment and its tuning scope; - writes to acquisition tables from moving the library folder and from merging duplicates, the want-list join on Suspect sources, the sealing of acquisition credentials, and the release-group lookup only re-acquisition used. Settling a wrong-slot duplicate no longer sets the release aside: the copies go and their slots show as missing until a good copy is in the library. Removed from the web: Admin > Acquisition and Requests, /requests, /discover, Follow on the artist page, the auto-approve toggle, and the Collection's wanted-list tabs. The Collection is now the library's health: an overview, Reports, Duplicates, Suspect sources and Missing files. The README and docs no longer describe getting music. The tables stay for now; a later migration drops them. The request notification kinds and the Android screens are still to go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
67 lines
2.4 KiB
Go
67 lines
2.4 KiB
Go
package library
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/dhowden/tag"
|
|
"github.com/dhowden/tag/mbz"
|
|
)
|
|
|
|
// TagMBIDs is what a file's MusicBrainz Picard tags name. Empty means the
|
|
// tag is absent.
|
|
type TagMBIDs struct {
|
|
// Release is musicbrainz_albumid: one edition, what albums.mbid stores.
|
|
Release string
|
|
Artist string
|
|
// ReleaseGroup is musicbrainz_releasegroupid. The duplicate resolver
|
|
// reads an album's MusicBrainz track lists by it.
|
|
ReleaseGroup string
|
|
// Recording is what tracks.mbid stores and the ListenBrainz Labs
|
|
// similar-recordings API keys on.
|
|
Recording string
|
|
}
|
|
|
|
// ReadTagMBIDs reads a file's MusicBrainz IDs, for the scanner, the MBID
|
|
// backfills and the importer alike.
|
|
//
|
|
// Delegates to dhowden/tag/mbz, which knows the per-format Raw() conventions:
|
|
// - Vorbis (FLAC/OGG/Opus) keys are lowercased by the parser.
|
|
// - ID3v2 (MP3) TXXX frames are stored under "TXXX"/"TXXX_N" with
|
|
// a *tag.Comm value whose Description holds the Picard tag name.
|
|
// - MP4 (M4A) freeform iTunes atoms are stored under their bare sub-name.
|
|
//
|
|
// mbz maps keys by name alone, and Picard names the recording differently
|
|
// in Vorbis: MUSICBRAINZ_TRACKID there is the recording (the release track
|
|
// is MUSICBRAINZ_RELEASETRACKID), so mbz files it under mbz.Track, its name
|
|
// for the release track. Read mbz.Recording alone and every FLAC has no
|
|
// recording id.
|
|
func ReadTagMBIDs(m tag.Metadata) TagMBIDs {
|
|
info := mbz.Extract(m)
|
|
ids := TagMBIDs{
|
|
Release: cleanMBID(info.Get(mbz.Album)),
|
|
Artist: cleanMBID(info.Get(mbz.Artist)),
|
|
ReleaseGroup: cleanMBID(info.Get(mbz.ReleaseGroup)),
|
|
Recording: cleanMBID(info.Get(mbz.Recording)),
|
|
}
|
|
if ids.Recording == "" && m.Format() == tag.VORBIS {
|
|
ids.Recording = cleanMBID(info.Get(mbz.Track))
|
|
}
|
|
return ids
|
|
}
|
|
|
|
// cleanMBID takes the first non-empty NUL-separated value. dhowden's
|
|
// readTextWithDescrFrame (used for ID3v2 TXXX) does NOT strip the
|
|
// trailing/embedded NUL bytes that ID3v2.4 uses as frame terminator and
|
|
// multi-value separator — so the Text often comes out as "uuid\x00" or
|
|
// "uuid1\x00uuid2". Postgres rejects NULs in text columns (SQLSTATE 22021).
|
|
// Minstrel uses the primary release artist for MBCAA lookup, so first-wins
|
|
// matches the original semantics.
|
|
func cleanMBID(s string) string {
|
|
for _, part := range strings.Split(s, "\x00") {
|
|
if t := strings.TrimSpace(part); t != "" {
|
|
return t
|
|
}
|
|
}
|
|
return ""
|
|
}
|