Skip to content

Library Optimizations#405

Merged
therobbiedavis merged 1 commit intocanaryfrom
feature/library-optimizations
Mar 9, 2026
Merged

Library Optimizations#405
therobbiedavis merged 1 commit intocanaryfrom
feature/library-optimizations

Conversation

@therobbiedavis
Copy link
Collaborator

Small optimization release. I noticed that for users with larger libraries, the library page would take a long time to load. This was due to some redundant and unnecessary checks. Also the the api endpoint was returning a lot of data that was not needed for the page. Additionally I have added url resolution normalizations to download client host/ip:port connection strings so the connection tests are more robust.

Added

  • Shared backend/frontend audiobook status helpers so list views can use a consistent status model without relying on full file metadata from /library
  • A dedicated slim library list DTO for GET /library
  • A shared download-client URI builder for normalizing host, scheme, port, and path handling
  • Backend regression tests covering:
    • slim /library payload behavior
    • wanted-flag correctness
    • NZBGet host normalization and queue-path handling
    • qBittorrent, SABnzbd, and Transmission host normalization

Changed

  • Slimmed GET /library from a hybrid list/detail payload into a lighter list response
  • Kept GET /library/{id} as the rich full-detail audiobook endpoint
  • Moved library list status evaluation to shared backend/frontend helpers instead of deriving it ad hoc in views
  • Switched the app from timer-based Wanted badge refreshes to store-driven updates backed by existing SignalR events
  • Updated the frontend library store to collapse concurrent /library requests into a single in-flight fetch
  • Reused cached library state for app-shell lookups and related UI flows instead of issuing redundant library requests
  • Standardized host/URL interpretation across NZBGet, qBittorrent, SABnzbd, and Transmission for both test/save and runtime monitor paths

Fixed

  • Slow /library responses caused by per-audiobook filesystem existence checks during list loading
  • Duplicate /library requests during startup and view initialization
  • Full-library polling churn for the Wanted badge
  • Extra DB work in audiobook detail loading by collapsing a two-query existence/fetch path into a single no-tracking query
  • NZBGet malformed host parsing that could produce errors like Name or service not known (http:80)
  • The same malformed host/URL bug class across other download clients when users pasted scheme/path data into host fields

Removed

  • Periodic full-library polling for the Wanted badge
  • Per-item filesystem probes from the main /library list path
  • Redundant client-side dependence on full files[] metadata in library list views for status calculation

Copilot AI review requested due to automatic review settings March 9, 2026 01:43
@therobbiedavis therobbiedavis merged commit e2d2819 into canary Mar 9, 2026
9 of 11 checks passed
@therobbiedavis therobbiedavis deleted the feature/library-optimizations branch March 9, 2026 01:44
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b2e79f550

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR targets improved performance and robustness for large-library scenarios by slimming the library list payload, consolidating status evaluation into shared helpers, and normalizing download-client host/URL handling across adapters.

Changes:

  • Slimmed GET /library into a lighter list response while keeping GET /library/{id} as the rich detail endpoint (per PR description).
  • Added shared helpers for consistent audiobook status evaluation and improved frontend store behavior to reduce redundant /library fetches (per PR description).
  • Adjusted API project version metadata in the backend csproj.

You can also share your feedback on Copilot code review. Take the survey.

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.

2 participants