Skip to content

Add opt-in album downloads for slskd - #4

Merged
Gabriel-Lewis merged 1 commit into
devfrom
feat/slskd-album
Aug 29, 2026
Merged

Gabriel-Lewis merged 1 commit into
devfrom
feat/slskd-album

Conversation

@Gabriel-Lewis

Copy link
Copy Markdown
Owner

Adds SLSKD_ALBUM_MODE. With it on, slskd fetches the whole release the recommended track sits in rather than that track alone. Off by default — it multiplies transfer volume per recommendation, and existing setups should upgrade with identical behaviour.

Independent of #2 and #3; branches straight off dev.

Behaviour when enabled

  • Search asks for <main artist> - <album>, falling back to the track when the recommendation has no album metadata. The existing wildcard retry still applies.
  • Selection groups results by peer + directory — the closest thing Soulseek has to a release — and requires the candidate to actually contain the recommended track. A directory naming the album outranks one naming the artist, which outranks having more files; file count is capped so a large dump can't outscore the right album.
  • Filtering shifts granularity: FILTER_LIST matches the directory, so a live or remix pressing is rejected as a release rather than one track at a time. Bitrate and bit-depth floors apply to siblings but not to the recommended track — a mediocre file in the playlist beats an empty slot.
  • Download queues the whole directory in one POST, since the endpoint already takes an array.
  • Migration follows the recommended track. When the monitor sees it finish, siblings slskd reports as Succeeded are moved across; anything still transferring is left in place rather than copied truncated.
  • Playlist gets only the recommended track. Explo is a discovery list, and a dozen album tracks per recommendation would bury it.

Design notes

track.File still points at the recommended track, so MonitorDownloads needs no changes. Siblings ride along in a new Track.AlbumFiles.

Sibling migration hangs off an optional albumMigrator interface rather than MoveDownload reaching for a concrete downloader; youtube grabs a single file and simply doesn't implement it. The hook runs after the primary is removed and before the empty-directory check, so a directory still holding an unfinished album track isn't deleted out from under it.

Testing

go build, go vet and go test ./src/downloader/... pass. Coverage: release selection, album-vs-track directory preference, requiring the recommended track, filtered-release rejection, duration check not applied to siblings, single-request queueing, search-term fallback, Windows path grouping, sibling migration skipping unfinished transfers, and the migration being inert with album mode off.

The src/web packages fail to build for want of dist/*; that is pre-existing on dev and unrelated.

🤖 Generated with Claude Code

Set SLSKD_ALBUM_MODE=true and slskd fetches the whole release the
recommended track belongs to, rather than that track alone. Off by
default: it multiplies transfer volume per recommendation, and existing
setups should not change behaviour on upgrade.

How it works. QueryTrack searches "<artist> - <album>" instead of
"<track> - <artist>", falling back to the track when the recommendation
carries no album. GetTrack then groups results by peer and directory,
which is the closest thing Soulseek has to a release, and picks the best
candidate: it must contain the recommended track, a directory naming the
album beats one that merely contains the track, and among equals the
fuller release wins. Every file goes to slskd in a single request, since
the downloads endpoint already takes an array.

Two filters are deliberately not applied to sibling tracks. The
ten-second duration check is meaningful only for the recommended track,
and FILTER_LIST is matched against the directory instead, so a live
pressing is rejected as a release rather than one track at a time.

Only the recommended track enters the playlist. Explo builds a discovery
list, and a dozen album tracks per recommendation would bury it. The
rest simply land in the library.

track.File still points at the recommended track, so MonitorDownloads
needs no changes. Siblings ride along in track.AlbumFiles and are
migrated once the primary is moved, skipping any that slskd has not
finished -- copying a file mid-transfer would put a truncated track in
the library.

Migration hangs off an optional albumMigrator interface rather than
MoveDownload reaching for a concrete downloader. Youtube grabs a single
file and simply does not implement it. The hook runs after the primary
is removed and before the empty-directory check, so a directory still
holding an unfinished album track survives to be cleaned up on a later
pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Gabriel-Lewis
Gabriel-Lewis merged commit 22386aa into dev Aug 29, 2026
4 checks passed
@Gabriel-Lewis
Gabriel-Lewis deleted the feat/slskd-album branch August 29, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant