feat(rules): add rule Jellyfin favorited by including parents#2438
Conversation
|
@s1cstrings Thanks for your PR! Quick question, did you test the changes in prod? |
|
@enoch85 I was in the process of setting up to run it in prod right now actually. I only tested in my test environment that mirrors my prod env but with test data. I will report back once up and running in prod. |
|
Please add a PR to docs as well: https://github.com/Maintainerr/Maintainerr_docs |
my bad, i looked in the current repo for docs and then totally forgot to check where to add. will do shortly! |
|
Not tested, but LGTM. 👍 |
|
alright added pr for the docs. also used it in prod and it's working as it should. previously i was adding favorites to collections and using the collection incl parents rule to achieve similar result but it was causing issues for tv shows. with this favorite incl parent rule i don't have any issues anymore. yay! |
PR #2438 - feat(rules): add rule Jellyfin favorited by including parents - Added Jellyfin favorited rule that checks parent items (series/seasons) - Includes unit tests for the new favorited-by-parents getter PR #2439 - fix: stop rule execution when rule group is deleted mid-run - Changed onRuleGroupDeleted to call stopProcessingRuleGroup instead of removeFromQueue - Fires abort signal for in-flight execution, preventing null reference crashes - Added unit test for delete-during-execution scenario PR #2442 - fix(server): reject null/undefined in numeric rule comparisons - Fixed null guard using proper nullish check (`firstVal != null`) - Preserves v2.27.0 null→0 coercion for BIGGER/SMALLER to avoid upgrade breakage - Logs warning when non-number values are encountered in numeric comparisons - Updated regression tests for numeric comparisons including null/undefined cases
|
This is now included in the You can check the latest commits here: https://github.com/Maintainerr/Maintainerr/commits/jellyfin-dev
Thank you very much! 🚀 |
|
Amazing, was just about to make an issue for this! Jellyfin support has immediately made my stack so much more automated |
|
@enoch85 @ydkmlt84 Thanks for including my PR so quickly to the dev branch! |
|
Thanks for the PR! |
|
🎉 This PR is included in version 3.1.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description & Design
This change adds a new Jellyfin rule for episodes/seasons: Favorited by (username) (incl. parents)
Problem solved:
sw_favoritedByrule only checks the current item. If media type is set to episode or season and the season or show (parent) is favorited, there is currently no way to check. This new rule allows checking for parents and is very useful when using this rule to prevent deletion of favorited media. For example, we don't want to delete episodes if a season is favorited.Why this approach:
sw_favoritedBy, id 40).sw_favoritedBy_including_parent, id 41) so users can explicitly choose parent-inclusive behavior.How it works:
rules.constants.tsfor show typesseasonandepisode.JellyfinGetterServiceforsw_favoritedBy_including_parent.Trade-offs / edge cases:
sw_favoritedBy.AI-Assisted Development
I used Codex 5.3 to create the first draft and tests. I manually reviewed and edited the changes.
Checklist
How to test
I added tests for the new rule
sw_favoritedBy_including_parentas well assw_favoritedBysince it didn't have tests already.yarn test -- apps/server/src/modules/rules/getter/jellyfin-getter.service.spec.tssw_favoritedBy(id 40) returns favorites from the current item only.sw_favoritedBy_including_parent(id 41) returns merged, deduplicated favorites from item + parent + grandparent.