Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(collections): drop redundant Jellyfin/Emby empty-collection delete, keep repopulate#3137

Merged
enoch85 merged 1 commit into
developmentfrom
fix/jellyfin-heal-repopulate-only
Jun 20, 2026
Merged

fix(collections): drop redundant Jellyfin/Emby empty-collection delete, keep repopulate#3137
enoch85 merged 1 commit into
developmentfrom
fix/jellyfin-heal-repopulate-only

Conversation

@enoch85

@enoch85 enoch85 commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Follow-up trim to the #3129 heal.

The #3129 fix added a delete-when-genuinely-empty path to checkAutomaticMediaServerLink for Jellyfin/Emby. On closer look (and against real-server logs) that path was redundant — removal of an empty automatic collection's BoxSet is already driven by Maintainerr:

  • When handling empties an automatic collection, removeFromCollection deletes the media-server collection (or just unlinks it when a sibling rule group shares the BoxSet) — see fix(collections): don't resurrect a deleted collection's media-server link #3135. Jellyfin/Emby don't auto-delete an empty BoxSet; Maintainerr triggers the deletion.
  • The pre-existing if (!serverColl) clear-link path recovers a collection whose BoxSet is already gone (and recreates it when items match again).

It also carried the transient child-read deletion risk flagged in review, on a path that wasn't needed.

This keeps only the genuinely-new behaviour for #3129re-add rule-owned DB items missing from a still-present, under-populated BoxSet — reusing the existing resync helper (resyncRuleOwnedItemsToMediaServerCollection, the same one the Plex shared-collection branch uses). All removal stays in the existing flow. Plex behaviour is untouched.

Net: −177 lines (the delete gate + its four tests). The repopulate path and its tests stay.

…elete, keep repopulate

The #3129 heal added a delete-when-genuinely-empty path to
checkAutomaticMediaServerLink for Jellyfin/Emby. That duplicated existing,
Maintainerr-driven behaviour: when handling empties an automatic collection,
removeFromCollection already deletes the BoxSet (or unlinks it when a sibling
rule group shares it), and the (!serverColl) clear-link path already recovers a
collection whose BoxSet is gone. It also carried a transient child-read
deletion risk on that redundant path.

Keep only the genuinely-new behaviour for #3129 — re-add rule-owned DB items
missing from a still-present, under-populated BoxSet, reusing the existing
resync helper (shared with the Plex branch) — and leave all removal to that
existing flow. Jellyfin/Emby do not auto-delete an empty BoxSet; Maintainerr
triggers it. Drops the delete gate and its four tests.
@enoch85 enoch85 force-pushed the fix/jellyfin-heal-repopulate-only branch from 64d3466 to 54a6c47 Compare June 20, 2026 11:43
@enoch85 enoch85 merged commit 576d78c into development Jun 20, 2026
4 checks passed
@enoch85 enoch85 deleted the fix/jellyfin-heal-repopulate-only branch June 20, 2026 12:03
enoch85 added a commit that referenced this pull request Jun 20, 2026
* fix(collections): drop the redundant Jellyfin/Emby empty-collection delete, keep repopulate (#3137)

The #3129 heal added a delete-when-genuinely-empty path to
checkAutomaticMediaServerLink for Jellyfin/Emby. That duplicated existing,
Maintainerr-driven behaviour: when handling empties an automatic collection,
removeFromCollection already deletes the BoxSet (or unlinks it when a sibling
rule group shares it), and the (!serverColl) clear-link path already recovers a
collection whose BoxSet is gone. It also carried a transient child-read
deletion risk on that redundant path.

Keep only the genuinely-new behaviour for #3129 — re-add rule-owned DB items
missing from a still-present, under-populated BoxSet, reusing the existing
resync helper (shared with the Plex branch) — and leave all removal to that
existing flow. Jellyfin/Emby do not auto-delete an empty BoxSet; Maintainerr
triggers it. Drops the delete gate and its four tests.

* test(collections): cover empty Jellyfin and Emby no-local heal

---------

Co-authored-by: enoch85 <[email protected]>
@maintainerr-automation

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.15.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

doonga pushed a commit to greyrock-labs/home-ops that referenced this pull request Jun 20, 2026
…➔ 3.15.2) (#349)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/maintainerr/maintainerr](https://github.com/Maintainerr/Maintainerr) | patch | `3.15.1` → `3.15.2` |

---

### Release Notes

<details>
<summary>Maintainerr/Maintainerr (ghcr.io/maintainerr/maintainerr)</summary>

### [`v3.15.2`](https://github.com/Maintainerr/Maintainerr/blob/HEAD/CHANGELOG.md#3152-2026-06-20)

[Compare Source](Maintainerr/Maintainerr@v3.15.1...v3.15.2)

#### Highlights

- Fixed transient failure handling for Sonarr and Radarr lookups, preventing data loss during rule evaluations under heavy load ([#&#8203;3125](Maintainerr/Maintainerr#3125), [#&#8203;3128](Maintainerr/Maintainerr#3128), [#&#8203;3139](Maintainerr/Maintainerr#3139)).
- Resolved issues with Jellyfin/Emby automatic collections, ensuring proper handling of empty collections and preventing resurrection of deleted media-server links ([#&#8203;3129](Maintainerr/Maintainerr#3129), [#&#8203;3134](Maintainerr/Maintainerr#3134), [#&#8203;3135](Maintainerr/Maintainerr#3135), [#&#8203;3137](Maintainerr/Maintainerr#3137)).
- Improved Streamystats watchlist handling by inheriting parent show information for season/episode-level rules, preventing unintended deletions or unmonitoring ([#&#8203;3127](Maintainerr/Maintainerr#3127), [#&#8203;3133](Maintainerr/Maintainerr#3133)).

#### Fixes

- Fixed transient failure handling for Sonarr and Radarr lookups, ensuring fail-closed behavior to prevent data loss during rule evaluations under heavy load ([#&#8203;3125](Maintainerr/Maintainerr#3125), [#&#8203;3128](Maintainerr/Maintainerr#3128), [#&#8203;3139](Maintainerr/Maintainerr#3139)).
- Resolved issues with Jellyfin/Emby automatic collections:
  - Fixed empty collections not healing properly for Jellyfin/Emby servers ([#&#8203;3129](Maintainerr/Maintainerr#3129), [#&#8203;3134](Maintainerr/Maintainerr#3134)).
  - Prevented resurrection of deleted media-server links when handling empty collections ([#&#8203;3135](Maintainerr/Maintainerr#3135)).
  - Removed redundant empty-collection delete logic for Jellyfin/Emby, retaining only the repopulation path ([#&#8203;3137](Maintainerr/Maintainerr#3137)).
- Improved Streamystats watchlist handling by inheriting parent show information for season/episode-level rules, preventing unintended deletions or unmonitoring ([#&#8203;3127](Maintainerr/Maintainerr#3127), [#&#8203;3133](Maintainerr/Maintainerr#3133)).

#### Dependencies

- Updated 12 dependencies, including [@&#8203;types/node](https://github.com/types/node), sharp, [@&#8203;faker-js/faker](https://github.com/faker-js/faker), and typescript-eslint.

</details>

---

### Configuration

📅 **Schedule**: (in timezone America/New_York)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMjQuMCIsInVwZGF0ZWRJblZlciI6IjQzLjIyNC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19-->

Reviewed-on: https://git.greyrock.io/greyrock-labs/home-ops/pulls/349
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