Skip to content

docs: sync overlay processing API and add UI test-utils reference#2866

Merged
enoch85 merged 1 commit into
developmentfrom
docs/sync-overlay-and-test-utils
May 10, 2026
Merged

docs: sync overlay processing API and add UI test-utils reference#2866
enoch85 merged 1 commit into
developmentfrom
docs/sync-overlay-and-test-utils

Conversation

@enoch85

@enoch85 enoch85 commented May 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Documents the force flag on overlay processing endpoints and the 409
gating on DELETE /overlays/reset (#2827), and points contributors at
the new TanStack Query test helpers (#2863).
@enoch85 enoch85 merged commit 02429db into development May 10, 2026
12 checks passed
@enoch85 enoch85 deleted the docs/sync-overlay-and-test-utils branch May 10, 2026 13:12
maintainerr-automation Bot added a commit that referenced this pull request May 11, 2026
* docs: sync overlay processing API and add UI test-utils reference (#2866)

Documents the force flag on overlay processing endpoints and the 409
gating on DELETE /overlays/reset (#2827), and points contributors at
the new TanStack Query test helpers (#2863).

* fix(rules): scope exclusion cascade by type, not entry point (#2858) (#2867)

Excluding a single episode used to skip every other episode of the same
show. The cascade filter keyed off `Exclusion.parent`, but `parent` is the
entry point of the exclusion request (set to `data.mediaId`, which from the
show overview is always the show id) — not the structural parent. A typed
cascade set driven by `mediaServerId` of `type='show'`/`'season'` rows fixes
the regression without breaking the legacy null-type fallback.

* fix(collections): sort by addDate and group episodes by show (#2868)

* fix(collections): sort by addDate and group episodes by show

Maintainerr is now the source of truth for collection ordering: both the
Plex push and the UI fetch use the same comparator, so what users see in
the collection page matches what the media server displays.

- deleteSoonest now reads collection_media.addDate (drives the visible
  "Leaving in X days" overlay) instead of MediaItem.addedAt (the
  unrelated media-server library date)
- Same-day items tie via UTC day bucketing so the title tiebreaker
  actually fires within a "Leaving Today" group
- Title sort groups episodes/seasons under their show via
  grandparentTitle/parentTitle; movies are unaffected

* refactor(sort): pin missing values to end + DRY numeric branches

- Items missing the sort value (no air date, no rating, no view count, no
  add date) now sort to the end regardless of asc/desc. Previously they
  coerced to 0 and silently sorted to the front in ascending order — an
  item with no air date appeared before one from 1995.
- airDate, rating, watchCount, and deleteSoonest collapse onto one helper
  (compareNumericWithTitleFallback), removing three near-identical case
  bodies in compareMediaItemsBySort.
- airDate now day-buckets like deleteSoonest, so same-day items always
  reach the title tiebreaker instead of comparing by clock time.
- Pin tsBuildInfoFile in apps/server/tsconfig.build.json so nest-cli's
  type-check pass stops emitting a stray tsconfig.build.tsbuildinfo at
  the package root.

* refactor(sort): align deleteSoonest buckets with visible daysLeft

- Bucket deleteSoonest by `ceil((addDate - referenceTime) / dayMs)` so
  items showing the same "Leaving in X days" countdown tie even when
  their addDates straddle UTC midnight. Falls back to UTC-day bucketing
  when no reference time is supplied.
- Wire `referenceTime = now - deleteAfterDays * dayMs` through the two
  collection sort paths (applyCollectionSort + paginated fetch).
- Replace the show-aware title test data — old data alphabetized
  identically under either comparator and didn't actually prove the
  grouping behavior. New data interleaves episode titles across shows
  and asserts on [show, episode] pairs.
- Drop dead `baseUrl` + `paths` from apps/ui/tsconfig.json (unused alias)
  to clear the TS 6 deprecation surfaced in the IDE.

* perf(collections): restore SQL fast path for deleteSoonest paging

Page-loading a collection with `deleteSoonest` was hydrating every row
in the collection before slicing — minutes-long blocking page loads on
collections of a few hundred items, especially on Jellyfin where
`getMetadata` isn't cached at the adapter layer.

`deleteSoonest` orders by `addDate + deleteAfterDays`, but
`deleteAfterDays` is constant per collection, so the only sort key that
matters lives on `collection_media.addDate`. SQL can paginate it
directly without touching MediaItem metadata.

`applyCollectionSort` (the media-server push) still applies the
day-bucketed title tiebreaker via the comparator, so the polished
alphabetical-within-day order is what users see when browsing the
actual Plex/Jellyfin collection. The Maintainerr UI page may show
same-day items in a slightly different order — acceptable because the
primary sort key is correct and Maintainerr's DB remains the source of
truth driving the next push.

Other explicit sorts (airDate / rating / watchCount / title) still go
through hydrate-then-paginate because their sort keys live on
MediaItem, not on collection_media.

---------

Co-authored-by: enoch85 <mailto@danielhansson.nu>
@maintainerr-automation

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@enoch85 enoch85 added this to the 3.11.0 milestone May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant