chore: sync development to main#2859
Conversation
…/episode panels (#2854)
* 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>
…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.
📚 Docs drift reportComparing Rule glossary parity
Glossary is in sync with the code. New migrations on this branch
Each migration typically introduces a setting or schema change. Confirm Rule constantsNo changes to Public contracts (
|
|
🚀
|
|
🎉 This PR is included in version 3.11.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Promotes
developmenttomainfor release. Squash-merge when approved; release automation continues on approval.Changes