Skip to content

feat: library seed, daily prune, quota errors, Seerr v3.3.0+ compatibility #116

Merged
retardgerman merged 17 commits into
devfrom
feature/library-seed
Jun 20, 2026
Merged

feat: library seed, daily prune, quota errors, Seerr v3.3.0+ compatibility #116
retardgerman merged 17 commits into
devfrom
feature/library-seed

Conversation

@retardgerman

@retardgerman retardgerman commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • On first boot, scans the entire Jellyfin library and pre-populates the dedup store so pre-existing content never triggers a "new item" Discord notification.
  • Adds a daily background prune scan that removes dedup keys for items deleted from Jellyfin, preventing unbounded growth. Surviving keys have their TTL refreshed daily so suppression never lapses.
  • Adds a "Re-Seed Library" button in the dashboard to manually re-run the seed scan.
  • All scans abort on incomplete Jellyfin fetches (network errors, malformed responses) rather than acting on partial data. Concurrent seed/prune runs are blocked via a shared single-flight flag.
  • Quota errors from Jellyseerr are now surfaced to the user directly (e.g. "Series Quota exceeded.") instead of a generic "An error occurred." — applies to /request, the request button, and the daily pick button.
  • Auto-Map and Sync with Seerr now handle the discordIds array format introduced in Jellyseerr v3.3.0, alongside the legacy discordId string.
  • form-data bumped to 4.0.6 (GHSA-hmw2-7cc7-3qxx).

Docs and code were AI-assisted; all changes manually reviewed and verified.

Seerr PR #2712 changed the notification settings API from a single
discordId string to a discordIds array. Our sync-preview was reading
the old field, getting undefined, and marking every mapping as stale —
causing the sync button to want to remove all users.

Both auto-map-preview and sync-preview now read discordIds with a
fallback to the legacy discordId field for older Seerr installs.
Sync checks array membership instead of exact equality.
- Validate Jellyfin response shape before accepting Items array; treat
  malformed responses as incomplete rather than silently returning empty
- Narrow catch in fetchAllLibraryItems to Axios errors only; re-throw
  programming errors so they surface instead of being masked
- Add .catch() on all fire-and-forget seedLibrary/pruneLibrary calls to
  guard against unhandled promise rejections crashing Node 18
- Add single-flight guard (scanInProgress flag) shared between seeder and
  pruner to prevent concurrent scans on the dedup store
- pruneLibrary now re-asserts surviving keys (store.set) before pruning
  so seeded TTLs refresh daily instead of expiring after 7 days
- Validate fetchLibraryMap return shape in both seeder and pruner for a
  useful error message instead of "null is not iterable"
- pruneLibrary missing-config log level raised from debug to warn
- pruneLibrary now flushes the store after prune
- fetchRecentlyAdded: add isAxiosError guard and response shape
  validation, consistent with fetchAllLibraryItems
- pruneLibrary: set/clear scanInProgress via new setScanInProgress()
  export so a re-seed triggered during a prune run is also blocked
Previously all 403s showed a generic or auth-focused message. Jellyseerr
returns { message: "Series Quota exceeded." } in the response body —
this is now detected and surfaced to the user directly.

Extracts getSeerrErrorMessage() helper used in all three request catch
blocks (handleSearchOrRequest, button handler, daily pick handler) so
quota detection is consistent and not duplicated.
@retardgerman retardgerman changed the title feat: library seed and daily prune scan feat: library seed, daily prune, quota errors, Seerr v3.3.0+ compat Jun 20, 2026
@retardgerman retardgerman changed the title feat: library seed, daily prune, quota errors, Seerr v3.3.0+ compat feat: library seed, daily prune, quota errors, Seerr v3.3.0+ compatibility Jun 20, 2026
@retardgerman retardgerman merged commit c757d33 into dev Jun 20, 2026
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