fix(lidarr): send artistId (singular) so ArtistSearch actually runs - #17
Open
Germwalker wants to merge 1 commit into
Open
fix(lidarr): send artistId (singular) so ArtistSearch actually runs#17Germwalker wants to merge 1 commit into
Germwalker wants to merge 1 commit into
Conversation
Lidarr's ArtistSearchCommand declares a single integer field, ArtistId. Sending "artistIds": [id] makes Lidarr ignore the unknown key, leaving ArtistId at its default of 0, and the queued command then fails with ModelNotFoundException: Artist with ID 0 does not exist. The POST returns 201, so Newtarr logs the search as triggered while no search ever reaches an indexer. Verified on a live instance: 30/30 failures per cycle before, real indexer searches after. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LMKFGWjW2FQSQPCcQ4mWLC
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.
Problem
Lidarr's missing-mode
artistnever triggers a real search. EveryArtistSearchcommand is silently rejected by Lidarr, while Newtarr logs it as a success.In
src/primary/apps/lidarr/api.py, the command payload is built with a plural key:Lidarr's
ArtistSearchCommandexposes a single integer field,ArtistId— there is noArtistIds. Lidarr's JSON deserializer ignores the unknown key,ArtistIdkeeps its default value of0, and the command fails at execution time:Newtarr never sees this:
POST /api/v1/commandreturns 201 with a command id, so it logsTriggered Lidarr ArtistSearch for artist ID: 1261and moves on. The failure happens later, when Lidarr executes the queued command. The artist id is computed correctly — it is only lost when the payload is built.The same file already uses the singular form correctly elsewhere (
params['artistId'] = artist_id, line 195), which suggests a typo rather than a deliberate choice.search_albums()is unaffected: it sendsalbumIds, which does matchAlbumSearchCommand.AlbumIds(aList<int>).Fix
Send the field Lidarr actually declares.
Verification
Applied on a live instance (Lidarr, 3546 artists, ~57k missing albums).
Before — 30 of 30 searches per cycle failed, none reached an indexer:
After — searches reach the indexers:
No further
Artist with ID 0entries after the restart.Impact
Anyone running Newtarr against Lidarr with
hunt_missing_mode: "artist"gets zero results while the logs report normal operation. The bug predates this fork — the same line is present in the upstream Huntarr code.🤖 Generated with Claude Code
https://claude.ai/code/session_01LMKFGWjW2FQSQPCcQ4mWLC