You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Report owned books as complete on the Readarr API - #384
Readarr-compatible clients such as Seerr read statistics.percentOfBooks to decide whether a book is available. Chaptarr counted a book in that percentage only while it was monitored. A book that already had its files but was unmonitored reported 0% and showed as missing.
On the Readarr-compatible API, a book in the requested format now reports 100% when it has at least one file and 0% when it has none, whatever its monitoring. Native Chaptarr responses keep the existing calculation.
Database Migration
NO
How was this tested?
Native .NET 10 build on Linux.
New test facade_book_list_should_report_existing_files_independently_of_monitoring (BookControllerStatisticsBatchFixture) covers:
an unmonitored audiobook and an unmonitored ebook with files (100%);
the wrong format (0%);
a native request (0%);
files removed (0%).
It fails without the change (expected 100, was 0) and passes with it.
The PostgreSQL case runs when the PostgreSQL test database is configured.
Ran the BookController, Readarr facade and BookResource tests: 398 passed, 0 failed (the PostgreSQL cases skipped without a configured database).
Screenshots (UI changes only)
N/A
Summary by CodeRabbit
Bug Fixes
Book lists now report file availability based on whether matching audiobook or ebook files exist, independently of monitoring status.
Availability updates correctly when files are deleted or the selected format does not match.
No actionable comments were generated in the recent review.
Walkthrough
The API maps matching facade media types to book statistics that report file availability. The test fixture now supplies book and author services and checks availability and monitoring states across SQLite and PostgreSQL.
Changes: Facade Book Availability Reporting
Layer / File(s)
Summary
Facade book availability reporting src/Chaptarr.Api.V1/Books/BookStatisticsResource.cs, src/Chaptarr.Api.V1/Books/BookResource.cs, src/Chaptarr.Core.Test/Api/BookControllerStatisticsBatchFixture.cs
The statistics resource supports reporting availability from book file counts. Book resource mapping enables this mode when the facade and resource media types match. Tests check facade book-list statistics across media types, missing facade context, monitoring changes, and file deletions on SQLite and PostgreSQL.
Readarr-compatible responses now report a book with at least one file in the requested format as 100% complete regardless of monitoring, which fixes unmonitored owned books being treated as missing. Native responses keep their existing behavior. No concrete merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: owned books are reported as complete on the Readarr-compatible API. The changeset sets statistics.percentOfBooks to 100 for a requested-format book with files, regardl…
Description check
The description covers the purpose and behavior change, the affected statistic, and the native-response exception. It says there is no database migration and gives a clear test plan with OS, runtime, …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: owned books are reported as complete on the Readarr-compatible API. The changeset sets statistics.percentOfBooks to 100 for a requested-format book with files, regardless of monitoring. The title is specific and matches the objectives.
Full details: Description check
Explanation
The description covers the purpose and behavior change, the affected statistic, and the native-response exception. It says there is no database migration and gives a clear test plan with OS, runtime, test name, results, and the skipped PostgreSQL cases. It follows the template's sections. The AI-disclosure note and review-time note are template boilerplate and do not need author content. The Fixes # line is absent, but it is conditional ('if applicable').
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
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
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.
Description
Readarr-compatible clients such as Seerr read
statistics.percentOfBooksto decide whether a book is available. Chaptarr counted a book in that percentage only while it was monitored. A book that already had its files but was unmonitored reported 0% and showed as missing.On the Readarr-compatible API, a book in the requested format now reports 100% when it has at least one file and 0% when it has none, whatever its monitoring. Native Chaptarr responses keep the existing calculation.
Database Migration
NO
How was this tested?
Native .NET 10 build on Linux.
facade_book_list_should_report_existing_files_independently_of_monitoring(BookControllerStatisticsBatchFixture) covers:Screenshots (UI changes only)
N/A
Summary by CodeRabbit