Skip to content

[Step][#1080] Library: a temporary "Broken books" group, with the server's reasons - #1082

Draft
Yoldark34 wants to merge 1 commit into
Listenarrs:canaryfrom
Yoldark34:library/broken-books
Draft

Yoldark34 wants to merge 1 commit into
Listenarrs:canaryfrom
Yoldark34:library/broken-books

Conversation

@Yoldark34

Copy link
Copy Markdown
Contributor

Draft. A step of the Repair epic, #1080: a stepping stone toward the Issues page (#1081), which is probably months away.

Question for maintainers: keep this band-aid, or wait for the Issues page?

This is a temporary quality-of-life shortcut, not the Issues page. It lets users find their broken books now, with the server's rules, while the Issues page waits for its groundwork: the backend search (#1076) and the backend tasks (#1078).

Would you rather:

  1. keep the band-aid, removed once the Issues page lands; or
  2. drop it and do it right the first time with the Issues page, accepting the delay?

Either is fine with me. It's one self-contained commit.

Change

Server: why a book is broken

  • A book is broken when Audible, the only metadata source today, can't be asked for it: no title, no author, no ASIN (or one that isn't an ASIN), or no region for its ASIN. Later, any book not matched to a metadata provider would count.
  • BrokenBookRules (application layer) gives the reasons, one code per problem: missing_title, missing_author, missing_asin, invalid_asin, missing_region. The Issues page will use the same codes.
  • The library list (GET /library) gives each book its brokenReasons, empty when the book is fine. They're read from its main ASIN identifier and that identifier's region, with one query for the whole library (GetAsinIdentifiersGroupedByAudiobookIdAsync). There's no migration.

Front end: display only

  • The group menu ends with "Broken books": the Books list narrowed to the books with reasons, each reason shown as an orange tag under the cover (or on the list row). The rules stay on the server; the front end only filters and shows.
  • The front end has the same dictionary of codes, with a label each (utils/brokenBookReasons.ts). A backend test fails when the two dictionaries differ, so a code can't be added on one side only.
  • The address and the saved choice use group=broken. With no broken book left, the page says so and offers all books. The group menu stays available when the filtered list is empty.

With the other PRs

Tests

Backend: BrokenBookRulesTests (each reason, several at once), LibraryListServiceTests (reasons read from the main ASIN identifier, falling back to the ASIN field), BrokenBookReasonsDictionaryTests (front-end and server dictionaries match). 3783 passed. Front end: the group (last in the menu, filtering, address, saved choice, tags only in this group, empty state). 676 passed. dotnet format, type-check, eslint and prettier are clean.

Captures

Taken on a fresh instance running this branch, with one book whose ASIN has no region.

The group menu, "Broken books" last:
Group menu

The "Broken books" group, with each book's reasons:
Broken books group

🤖 Generated with Claude Code

@Yoldark34 Yoldark34 changed the title [Epic #1080] Library: a temporary "Broken books" group, with the server's reasons [Step][#1080] Library: a temporary "Broken books" group, with the server's reasons Oct 21, 2026
A quality-of-life shortcut until the Issues page, not the Issues page. The
library list gives each book its brokenReasons: why Audible, the only
metadata source today, can't be asked for it (missing_title,
missing_author, missing_asin, invalid_asin, missing_region), read from its
main ASIN identifier and that identifier's region; empty when the book is
fine. The rules live on the server (BrokenBookRules); the Issues page will
use the same codes, and later any book not matched to a metadata provider
will count. The codes form a dictionary on each side (BrokenBookReasons on
the server, the labels in utils/brokenBookReasons.ts on the front end); a
backend test fails when the two differ.

The group menu ends with "Broken books": the Books list narrowed to the
books with reasons, each shown as an orange tag on the card or row. The
address and the saved choice use group=broken; with no broken book left,
the page says so and offers all books; the group menu stays available when
the filtered list is empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Yoldark34
Yoldark34 force-pushed the library/broken-books branch from c4cb042 to 7855b9c Compare October 23, 2026 12:52
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.

1 participant