release / govulncheck (push) Successful in 16s
release / web (push) Successful in 1m19s
release / go (push) Successful in 1m37s
release / integration (push) Successful in 5m28s
release / android (push) Successful in 5m44s
release / Build signed APK (releases and dev) (push) Successful in 5m58s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 25s
release / Verify release artifacts (tag releases only) (push) Skipped
The one-time listing took only albums whose tags already named their release group and artist, and left 340 off the list. The rest are now matched: the release their tags name, else the artist's release groups called what the album is called, else a MusicBrainz search by artist and title. A group found by name is taken only when its tracks agree with the album's (by disc and number, then title; length and title, or recording), so a partial copy still matches and a same-titled other album does not. library_album_matches records each album the listing decided, listed or unmatched with why, so an album taken off the list is never re-listed. The albums no match was found for are named on the Held tab. Album rows with no tracks are no longer counted. The length and title checks move from the importer to release, shared by both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 lines
1.0 KiB
Go
41 lines
1.0 KiB
Go
package release
|
|
|
|
import "slices"
|
|
|
|
// Comparing a file against a MusicBrainz track: shared by the importer's
|
|
// check of a download and the library listing's match of an album (#5569).
|
|
|
|
// LengthFits allows five seconds or 3%, whichever is more: remasters and
|
|
// rips differ by a second or two, a different recording by far more. A
|
|
// track MusicBrainz has no length for says nothing against the file.
|
|
func LengthFits(fileMs, trackMs int) bool {
|
|
if trackMs <= 0 {
|
|
return true
|
|
}
|
|
if fileMs <= 0 {
|
|
return false
|
|
}
|
|
tol := max(5000, trackMs*3/100)
|
|
d := fileMs - trackMs
|
|
return d <= tol && -d <= tol
|
|
}
|
|
|
|
// TitleAgrees: the same words, or one title holding all of the other's
|
|
// ("Get Lucky (Radio Edit)" holds "Get Lucky").
|
|
func TitleAgrees(a, b string) bool {
|
|
ta, tb := Tokens(a), Tokens(b)
|
|
if len(ta) == 0 || len(tb) == 0 {
|
|
return false
|
|
}
|
|
return subset(ta, tb) || subset(tb, ta)
|
|
}
|
|
|
|
func subset(small, big []string) bool {
|
|
for _, w := range small {
|
|
if !slices.Contains(big, w) {
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
}
|