Skip to content

chore: sync development to main#2859

Merged
maintainerr-automation[bot] merged 7 commits into
mainfrom
development
May 8, 2026
Merged

chore: sync development to main#2859
maintainerr-automation[bot] merged 7 commits into
mainfrom
development

Conversation

@maintainerr-automation

@maintainerr-automation maintainerr-automation Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Promotes development to main for release. Squash-merge when approved; release automation continues on approval.

Changes

enoch85 and others added 4 commits May 6, 2026 20:21
* feat: implement plex adapter collection sorting logic

* feat: apply collection sort orchestration in collections service

* feat: add collection items sort dropdown to rule form

* feat: complete UI and full stack implementation for collection sorting

* fix(collections): address review feedback for collection sort

- Generate proper TypeORM migration for mediaServerSort column
  (previous PR shipped the entity change without one — upgrades would
  fail on the missing column).
- Extend collection sort comparator for addDate and releaseDate; the
  UI offered seven sort options but four (addDate.{asc,desc},
  releaseDate.{asc,desc}) fell through to the default branch and
  silently preserved input order.
- Replace fake MediaServerCollectionSort union with a real template
  literal (\${CollectionMediaSortField}.\${MediaSortOrder}); add
  parseCollectionSortKey helper and remove \`as any\` casts.
- Add smart-collection guard before reorder (Plex rejects move on
  smart) and membership-changed gate so we only push order to Plex
  when newMedia.length > 0.
- Filter items with missing metadata before sorting; replace the
  \`mediaData!\` non-null assertion.
- Move MEDIA_SERVER_FEATURES + supportsFeature into contracts and gate
  the UI dropdown via supportsFeature(COLLECTION_SORT) so the feature
  becomes available automatically if Jellyfin ever gains a boxset
  reorder API.
- Add ICollection.mediaServerSort field; tighten zod-to-payload
  parsing in AddModal.
- Revert unrelated edits introduced by this PR (rules.service return
  values, scheduler defensive guards, cosmetic setContext changes).
- Tests: setCollectionCustomSort and moveCollectionItem URL shapes,
  PlexAdapter.reorderCollectionItems orchestration, JellyfinAdapter
  feature flag and reorder rejection.

---------

Co-authored-by: Steven Seitz <steven.seitz@omron.com>
Co-authored-by: enoch85 <mailto@danielhansson.nu>
@maintainerr-automation maintainerr-automation Bot requested a review from enoch85 as a code owner May 8, 2026 11:15
@maintainerr-automation maintainerr-automation Bot added the release:docker-build Build release candidate Docker image label May 8, 2026
enoch85 and others added 3 commits May 8, 2026 16:31
…2860)

- Apply the collection sort immediately when a rule group is saved with
  a newly enabled or changed sort value, so users no longer see a
  configured sort that hasn't been pushed to Plex until a later add
  cycle. Previous behaviour gated the push on `newMedia.length > 0`,
  which left save-time changes unapplied indefinitely.

- Continue past per-item move failures in the Plex adapter
  reorderCollectionItems loop. A single rejected move no longer aborts
  subsequent moves; failures are accumulated and logged in a summary
  warning so the rest of the collection still gets ordered.

- Short-circuit the Plex reorder when the collection is already in the
  requested order. The adapter reads current child IDs first via
  PlexApiService.getCollectionChildren and returns early when they
  match `orderedItemIds`, skipping both the prefs PUT and every move
  PUT. The membership-changed gate in addToCollectionInternal is kept
  as a coarse pre-filter; the adapter check is the safety net.

- Reuse the existing `case 'title':` branch in compareMediaItemsBySort
  as a tiebreaker for airDate / rating / watchCount / deleteSoonest, so
  items sharing the same primary value fall back to alphabetical
  ordering. Status sorts (manual / excluded) intentionally skip the
  fallback to preserve their partition contract. Affects every
  consumer of the comparator (Maintainerr UI overview/library/
  collection display and the Plex collection-sort push) so on-disk
  Plex order matches what users see in Maintainerr for the same key.

Tests: new sort-utils.spec covering the timelordx tiebreaker scenario,
updated plex-adapter.service.spec for short-circuit and per-item
failure paths, and rules.service.updateRules.spec covering the
save-time apply transition.
The metadata refresh retry path validated the verified id with
isBlankMediaServerId, while the pre-filter used shouldRefreshMetadataItemId.
When getMetadata returned an item with the Jellyfin empty GUID
(00000000-0000-0000-0000-000000000000), the asymmetric check let the
retry call refreshItemMetadata with that id, producing the
"Guid can't be empty" spam in Jellyfin's ProviderManager queue.

Use the same predicate in both places so foreign-shaped and empty-GUID
ids are rejected consistently before any refresh request is issued.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved by release automation (CODEOWNER approval was verified by Release 2).

@maintainerr-automation maintainerr-automation Bot merged commit 0b1fe17 into main May 8, 2026
24 checks passed
@maintainerr-automation

Copy link
Copy Markdown
Contributor Author

📚 Docs drift report

Comparing origin/mainHEAD against Maintainerr_docs. Informational only — maintainers decide what needs doc updates before release.

Rule glossary parity

  • Code rule keys (rules.constants.ts): 160
  • Documented keys (docs/Glossary.md): 160

Glossary is in sync with the code.

New migrations on this branch

  • 1778173113116-AddCollectionMediaServerSort.ts

Each migration typically introduces a setting or schema change. Confirm Configuration.md and Migration.md still reflect user-facing behaviour.

Rule constants

No changes to rules.constants.ts.

Public contracts (@maintainerr/contracts)

  • Added (1):
    • packages/contracts/src/media-server/features.ts
  • Modified (5):
    • packages/contracts/src/media-server/enums.ts
    • packages/contracts/src/media-server/index.ts
    • packages/contracts/src/media-server/sort-utils.ts
    • packages/contracts/src/media-server/sorting.ts
    • packages/contracts/src/storage-metrics/index.ts

Public DTO changes may affect docs/API.md and the OpenAPI spec in static/openapi-spec/maintainerr_api_specs.yaml.

New HTTP controllers

No new controllers.

feat: commits on this branch

Behavioral fixes worth reviewing

fix: commits that touched user-facing surfaces (UI, settings, notifications, collections, rule executor, controllers, README). Worth scanning to decide whether observable behavior changed enough to warrant a docs note.

@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Release 2.5 - Execute Push PR To Main completed after approval.

  • PR squash-merged into main
  • Sync back: success
  • Build Main: success

@maintainerr-automation

Copy link
Copy Markdown
Contributor Author

🎉 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

release:docker-build Build release candidate Docker image released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants