Readarr /search endpoint, fix type mismatch in AddAuthorOptions struct #185
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.
Hey there, this is my first PR to an open source project, apologies in advance for any mistakes!
While attempting to create a Jellyseerr-like interface for Readarr, I didn't manage to find any way to search for books. Only the
/book/lookupendpoint was implemented, but the results I got from it were lacking (no cover images, no book overview, no full author name). After adding the/searchendpoint, I wasn't able to successfully callAddBookbecause Readarr expects theBooksToMonitorarray to consist of strings instead of int64s.So this PR adds the

/searchendpoint (https://readarr.com/docs/api/#/Search/get_api_v1_search) and fixes a type mismatch ([]int64instead of[]string) in theAddAuthorOptionsstruct. Readarr API docs:I also added testing for the new search functionality in
search_test.go, but I'm not 100% sure that it's up to par.