feat(download): fill in the tracks a nearly complete album is missing
A grab that delivers nine of twelve tracks clears the completeness floor and is imported, and the other three were never looked for. On Soulseek that is the commonest way an album ends up almost right: one peer's folder lacks a track, or one file fails. After a successful import the manager now compares the tracks the files were aligned to (ImportResult.Matched, new) with the expected tracklist. When one to three are missing, and fewer than half, it searches for each one on its own, as the track's artist and title with the album kept for ranking. It grabs the first auto-acceptable copy that is not from the source that already failed to supply it, and is not a delegate, which would place it in its own library. The candidate is trimmed to the one file aligned to the track. The import uses the album's own request with ImportOptions.Only, which skips the completeness check and imports only a file aligned to the missing track, so it is tagged and placed as part of the album, and anything else the folder brought is left out. One attempt per track, and nothing here fails the download: the album is already imported, so a track that cannot be found is logged on the job and left. slskd accepts one-file folders for a request that expects one track, which the per-track search needs. Closes #276 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017HJiuc3ZZhxsPXz3ozTirT
This commit is contained in:
1 parent
c88fc1c7c7
commit
ef89707bb1
5 files changed
+426
-4
No files matched your search
@@ -573,8 +573,10 @@ func isVariousArtists(artist string) bool {
|
||||
// usually matches one file per folder. The two-file floor that filters
|
||||
// out one-file noise for an album therefore filtered out every result
|
||||
// for a track, and a single-track request could never be served here.
|
||||
// A request expecting one track — a recording, or the fill-in for one
|
||||
// missing from an album (#276) — takes a one-file folder.
|
||||
func minFilesFor(dl Download) int {
|
||||
if dl.RecordingMBID != "" {
|
||||
if dl.RecordingMBID != "" || len(dl.Expected) == 1 {
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user