Add Lidarr as a download provider - #2
Open
Gabriel-Lewis wants to merge 30 commits into
Open
Conversation
Add helper funcs; implement hour cooldown for search Check for rejected releases Add cleanup func and worker Add check to artist adding Mark track as present
Add download monitor Add album release to request More updates to lidarr Don't monitor the whole artist Fix rebase More rebase fixes Remove timeout from main.go Fix rebase more Fix rebase more
Fix post rebase Remove redeclarations Update sample env; reorganize Add PUID/GID support to Docker container Fixup rebase Update lidarr monitoring Fix config Fix ReadEnv rebase Fixup rebase Restore a couple files Unformat config Ignore vscode Restore downloader Add fields to type Make lidarr timeout an int Fix env reading Remove scheme Fix cleanup tasks Use track title Structure logging Fixup rebase Cut down on changes Fix linting issues
Build test branch Update condition Fix request calls Fix the linter Simplify api calls Debug Try to search on add Remove old structs; update querytrack Debug and comment out helper func More debugging Add new helper func Fix call; add debug Use release group as id Debug More debugging Add release group is helper Get release group
Remove debugs Set trackfile after download starts Fix rebase Remove extraneous code Restore untouched file
…gh playlist cache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports upstream PR LumePart#21 (
avedor+LumePart, 29 commits) onto this fork. Merged as a branch rather than reimplemented, so future upstream updates to that PR can be pulled in cleanly and author attribution is preserved.Upstream LumePart#21 is open and actively maintained — not rejected. The maintainer's most recent comment on it is "Current state is working for me"; it has been gated mainly on Lidarr's own MusicBrainz metadata service being unreliable through much of 2025.
What this adds
src/downloader/lidarr.go(new, ~740 lines) — raw HTTP client,X-Api-Keyauth. An SDK-based approach was deliberately abandoned upstream at the maintainer's request.Endpoints used:
GET /api/v1/rootfolder,GET /api/v1/album/lookup,GET|POST /api/v1/album,POST|GET /api/v1/command(AlbumSearch),GET /api/v1/track,GET /api/v1/queue,GET /api/v1/history,DELETE /api/v1/queue/{id}.Monitorinterface gainsMoveDownload(...), moving it offDownloadClientonto each provider.FileStatusgainsQueueID. Status map keys move fromtrack.Filetotrack.ID, because Lidarr exposes no stable filename until import.slskd.gore-gainsMoveDownloadas a method (pure relocation);youtube.gogets a no-op stub.LIDARR_URL,LIDARR_API_KEY,LIDARR_ROOT_FOLDER(defaultMusic),LIDARR_RETRY(8),LIDARR_TIMEOUT(20),LIDARR_DIR,LIDARR_MIGRATE_DOWNLOADS,LIDARR_MONITOR_INTERVAL(1 min),LIDARR_MONITOR_DURATION(20 min).models.TrackgainsAlbumID. An album cache keyed byartist|albumresolves a release-group MBID via/album/lookup, adds the album withsearchForNewAlbum: true, then matches individual tracks back out of/api/v1/trackand/api/v1/historyby MBID or fuzzy title.defs.AllConfigKeysgains the Lidarr keys.Verified
go build ./src/main/— succeeds.npm run buildinsrc/web/frontend— succeeds.dev, and confirmed not to regress the#214authbypass work that landed ondevafter Add lidarr as downloader LumePart/Explo#21 last synced (git diff dev..HEAD -- src/web/backend/auth/is empty).needsDownloadDir()and runningLidarr.URLthroughfixBaseURL()inCommonFixes()— are already handled inside Add lidarr as downloader LumePart/Explo#21.Not tested against a live Lidarr instance.
Tradeoff
Lidarr acquires whole albums only. A 25-track ListenBrainz playlist spans roughly 25 distinct albums, so putting
lidarrfirst pulls far more audio than the playlist needs. That is inherent to Lidarr and accepted upstream — and it is the motivation for the fallback-threshold work stacked on top of this branch.Note also that
Lidarr.MoveDownloadis a no-op: Lidarr places files itself, into its own root folder, not Explo'sDOWNLOAD_DIR.LIDARR_ROOT_FOLDERmust therefore resolve to the same music root Plex indexes.