Skip to content

Health: cards for covers, details, disk space, tracker sign-ins and leftover reading data - #253

Closed
Squeaks72 wants to merge 1 commit into
AngeloSha:mainfrom
Squeaks72:pr/health-more-checks
Closed

Squeaks72 wants to merge 1 commit into
AngeloSha:mainfrom
Squeaks72:pr/health-more-checks

Conversation

@Squeaks72

Copy link
Copy Markdown
Contributor

Summary

Five more Health cards, each reading the library's own records rather than its chapters. Each has the shape of the existing checks: findings first, info rows never turn a card amber, a finding can be ignored by its key, and the card says what it cannot see.

  • Series covers: a series with nothing to show as a cover: none set by hand, none fetched, and no chapter whose first page could stand in (the order serveLibSeriesThumb uses). A cover that exists but is blank is not claimed.
  • Series details: a series with no description or no genres. A missing description is only a finding where the series' source gives descriptions to other series (a source that gives none has none to give), and a series missing only its author is listed for reference.
  • Disk space and folders: the library, downloads and config folders. Under 5 % free on a disk of under 200 GB, or under 2 % or 5 GB free anywhere, is a finding (so a big array at 4 % free is fine); a folder that cannot be read, or looks empty while chapters are recorded under it (a share that is not mounted), is a problem.
  • Tracker sync: a sign-in a tracker refused (the row stays off until its owner reconnects), a failed sync, a sign-in expired or expiring within 14 days; one ending within 30 days is listed for reference.
  • Reading data: counts of reading history, tracker records, offline downloads, and favourites or progress that point at removed series or chapters. Informational only; nothing is deleted, because that data is kept on purpose.
  • Covers, details, disk and trackers join the ignorable checks (POST /api/admin/health/ignore). Fix everything has nothing to do for them (a cover, a description or a disk is the owner's), and lists each one still amber under Needs you by the card's own count, so its end never reads as done over them.
  • The page size, the findings-first cut, the verdict and the summary tails that every check shares move to bff/src/lib/healthKit.ts, so a check can live in its own file without importing the whole report. The existing checks are unchanged.

Type

  • Feature

Testing

bff and web typecheck clean. New tests: bff/test/healthMore.test.ts (the free-space rule), bff/test/healthMore.int.test.ts and bff/test/healthDetails.int.test.ts against a throwaway Postgres (which series the covers card lists; a refused, an expiring and a healthy tracker sign-in; leftover reading data being informational; a source that describes no series not being asked for descriptions), and link cases in web/test/healthLinks.test.ts. web tests pass in full; health.int and healthIgnore.int pass. The disk card's folder reading was not covered by a test (only its free-space rule), and nothing was exercised in a browser.

Checklist

  • Focused scope (one topic)
  • Matches the existing TypeScript style
  • Docs updated if user-facing (docs/USAGE.md, docs/api.md, bff/openapi.yaml)
  • No new default sources hardcoded to specific sites

🤖 Generated with Claude Code

…eftover reading data

Five more Health cards, each reading the library's own records rather than its chapters:
- Series covers: a series with nothing to show as a cover (none set, none fetched, no chapter to take one from).
- Series details: a series with no description or genres. A missing description only counts where the series' source
  gives descriptions to other series; a series missing only its author is listed for reference.
- Disk space and folders: low free space (judged by share and size, so a big array at 4 % is fine) and a library or
  download folder that cannot be read or looks empty while chapters are recorded under it.
- Tracker sync: a sign-in a tracker refused, a failed sync, a sign-in expired or expiring within 14 days.
- Reading data: counts of reading history, tracker records, offline downloads, favourites and progress pointing at
  removed series or chapters. Informational; nothing is deleted.

The first four can be ignored per finding, and Fix everything lists the ones still amber under Needs you. The checks'
shared page size, cut and verdict move to lib/healthKit.ts so a check can live in its own file.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@AngeloSha

Copy link
Copy Markdown
Owner

Thank you for these. Three parts are in v0.72.0,
rebuilt on Health's own parts with you credited as co-author:

  • The healthKit.ts split, as you had it. MAX_ITEMS, truncate, verdict and the summary tails now live
    apart from health.ts, and the new cards use them.
  • Disk space and folders, with three changes:
    • It turns red at MIN_FREE_GB, the floor where the downloader actually refuses (10 GB by default), and amber
      below the slow archive's floor while the archive has a series queued. With a 5 GB floor of its own, Health read
      fine between 5 and 10 GB while every download was being refused.
    • The empty-folder check opens the folder and reads one entry. A full readdir of a library's top level is tens
      of thousands of names on a NAS and wakes every disk of an Unraid array, and this card runs every six hours and
      after every scan.
    • The level goes into the ignore's members. With empty members an ignore covers anything, so ignoring "the
      archive waits" would also have silenced "downloads are refused".
  • Tracker sync, as you built it, with two small changes. The tracker's name comes from its adapter, so a tracker
    added later is named without touching the card. An ignore records what was wrong, so an ignored "ends in 10 days"
    doesn't hide a sign-in the tracker refuses later.

Two cards are left out on purpose:

  • Series covers. Admin → Art already has missing-cover and missing-banner filters with counts, and a Backfill.
  • Reading data. That history is kept on purpose, and counting it meant full scans of reading_events, which
    only grows, on every unattended Health run.

Series details waits on #257. Without a fix step beside it, a library built by hand would show thousands of
findings that nothing can clear.

@AngeloSha AngeloSha closed this Oct 16, 2026
Squeaks72 added a commit to Squeaks72/uchiyomi that referenced this pull request Oct 16, 2026
… series grouped on the server

Three cards from @Squeaks72's AngeloSha#252 and AngeloSha#253, rebuilt on Health's own parts, and the server half of AngeloSha#254's By series.

- lib/healthKit.ts: MAX_ITEMS, truncate, verdict and the summary tails, out of health.ts (AngeloSha#253's split), plus the
  full row list each per-series card keeps under a symbol for By series -- never on the wire.
- Disk space and folders (lib/healthDisk.ts): red under the downloader's own MIN_FREE_GB, where new downloads stop
  (AngeloSha#253 used 5 GB of its own, so 5-10 GB read fine while every download was refused), amber under the slow archive's
  floor while it has a series queued. A library or download folder that cannot be opened, or is empty while chapters
  are recorded in it, is a problem; only its first entry is read (opendir, one entry), never a readdir that wakes an
  Unraid array. An ignore records the level, so an ignored warning does not silence a later problem. The archive's
  floor is read from its row: importing lib/archive.ts closed a module loop that left healthSummary half loaded.
- Tracker sync (lib/healthTrackers.ts), AngeloSha#253's card: every member's refused, failing, ended or ending sign-in, named
  by the tracker's own adapter; an ignore records what was wrong.
- Chapter files (lib/healthFiles.ts), AngeloSha#252 rebuilt: the files the nightly count found no page in, from its stamps
  alone (pages = 0, pages_checked_at set, not pruned) on a new partial index -- no file is opened -- with Fetch again
  (`refetch`, the series page's route, which keeps each old file until its copy lands) on the files Uchiyomi
  downloaded itself. No delete, here or in Fix everything. persistScan clears pages_checked_at when a file's mtime
  moves, so a refetched file leaves the card and is counted again.
- By series: GET /api/admin/health?view=series adds `bySeries`, grouped from every card's full list (AngeloSha#254 grouped
  the fifty rows a card sends), worst first; never built by the six-hourly refresh.
- Fix everything lists the three new cards under Needs you, last.

Co-authored-by: Squeaks72 <18704769+Squeaks72@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Squeaks72 added a commit to Squeaks72/uchiyomi that referenced this pull request Oct 16, 2026
…in all eight languages

The web half of @Squeaks72's AngeloSha#254, AngeloSha#253 and AngeloSha#252.

- By check / By series (components/HealthBySeries.tsx, lib/healthBySeries.ts): one card per series in Health's card
  look with its status edge, each finding as its own card's row with its keys. Remove from library is the bulk hide
  route (never N deletes) after a confirmation that counts and names the series, and acts only on the ticked series
  on the screen; Open is a link, the actions are keys. The view is per device; every reader of the report on Admin
  shares one query, which asks for the series while the view is By series.
- The Chapter files row's Fetch again key, the new cards' titles, links and sentences, and their legend copy.
- 51 strings translated into all eight languages (no English copies).

Co-authored-by: Squeaks72 <18704769+Squeaks72@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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