[PR #12170] [MERGED] Fix for Issue #12142: Fix ExtraRuleResolver filtering out top level folders #12924

Closed
opened 2025-12-22 09:34:18 +01:00 by backuprepo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/12170
Author: @mcmcelro
Created: 6/24/2024
Status: Merged
Merged: 3/28/2025
Merged by: @crobibero

Base: masterHead: fix-extraruleresolver-filtering-out-top-level-folders


📝 Commits (9)

  • d204bb1 Fix ExtraRuleResolver to stop filtering out libraries where the name of the base folder matches an 'videos extras' rule with an ExtraRuleType of DirectoryName
  • dab1a99 Update CONTRIBUTORS.md
  • 36771fd Update Emby.Naming/Video/ExtraRuleResolver.cs
  • 83fe977 Update ExtraTests.cs
  • b4d42ee Update ExtraTests.cs
  • 51d7179 In MediaBrowser.Model, upgrade System.Text.Json from 8.0.3 (vulnerable - high risk) to 8.0.4
  • f863643 Update ExtraTests.cs
  • 42224df Revert "In MediaBrowser.Model, upgrade System.Text.Json from 8.0.3 (vulnerable - high risk) to 8.0.4"
  • f2af508 Merge branch 'master' into fix-extraruleresolver-filtering-out-top-level-folders

📊 Changes

8 files changed (+84 additions, -16 deletions)

View changed files

📝 CONTRIBUTORS.md (+1 -0)
📝 Emby.Naming/Video/ExtraRuleResolver.cs (+5 -2)
📝 Emby.Naming/Video/VideoListResolver.cs (+3 -2)
📝 Emby.Naming/Video/VideoResolver.cs (+9 -6)
📝 Emby.Server.Implementations/Library/LibraryManager.cs (+1 -1)
📝 Emby.Server.Implementations/Library/Resolvers/ExtraResolver.cs (+2 -2)
📝 Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs (+2 -2)
📝 tests/Jellyfin.Naming.Tests/Video/ExtraTests.cs (+61 -1)

📄 Description

Changes

Fix ExtraRuleResolver to stop filtering out libraries where the name of the base folder matches a 'videos extras' rule with an ExtraRuleType of DirectoryName.

Currently the ExtraRuleResolver code doesn't know anything about the root folder of the current library. As a result, when we're attempting to add items in a library where the root folder has a name with a match in Emby.Naming.Common.NamingOptions.VideoExtraRules, the entire library is being ignored as a Video Extras folder.

We need to pass in the root folder of the current library to compare to the path of the current item being evaluated, and if we match the current item's folder to the root folder, then we ignore the ExtraRules with a type of DirectoryName and we continue to scan deeper in the library. Filters still apply to subfolders within the library itself.

Issues

Fixes #12142.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/12170 **Author:** [@mcmcelro](https://github.com/mcmcelro) **Created:** 6/24/2024 **Status:** ✅ Merged **Merged:** 3/28/2025 **Merged by:** [@crobibero](https://github.com/crobibero) **Base:** `master` ← **Head:** `fix-extraruleresolver-filtering-out-top-level-folders` --- ### 📝 Commits (9) - [`d204bb1`](https://github.com/jellyfin/jellyfin/commit/d204bb1272b2fec0762989cb4d2ffb3a36fc0d39) Fix ExtraRuleResolver to stop filtering out libraries where the name of the base folder matches an 'videos extras' rule with an ExtraRuleType of DirectoryName - [`dab1a99`](https://github.com/jellyfin/jellyfin/commit/dab1a9950a934c93d29ea94c132785e841a6da1b) Update CONTRIBUTORS.md - [`36771fd`](https://github.com/jellyfin/jellyfin/commit/36771fddbd1713192e9d22f6b01418530e45e188) Update Emby.Naming/Video/ExtraRuleResolver.cs - [`83fe977`](https://github.com/jellyfin/jellyfin/commit/83fe9777559098023c105dad78f81eb60e6749f7) Update ExtraTests.cs - [`b4d42ee`](https://github.com/jellyfin/jellyfin/commit/b4d42ee6625116bb06855f46ec35e0b5deddba92) Update ExtraTests.cs - [`51d7179`](https://github.com/jellyfin/jellyfin/commit/51d7179b2ab0fc47fe1450721cfb1815348e02c6) In MediaBrowser.Model, upgrade System.Text.Json from 8.0.3 (vulnerable - high risk) to 8.0.4 - [`f863643`](https://github.com/jellyfin/jellyfin/commit/f863643e6b38ff3e95d4ec8f22e3f784f72605a0) Update ExtraTests.cs - [`42224df`](https://github.com/jellyfin/jellyfin/commit/42224df7f48a2521de6631e7a6104ab171a9daab) Revert "In MediaBrowser.Model, upgrade System.Text.Json from 8.0.3 (vulnerable - high risk) to 8.0.4" - [`f2af508`](https://github.com/jellyfin/jellyfin/commit/f2af508f739634ccda964396505df944ce5a6652) Merge branch 'master' into fix-extraruleresolver-filtering-out-top-level-folders ### 📊 Changes **8 files changed** (+84 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `CONTRIBUTORS.md` (+1 -0) 📝 `Emby.Naming/Video/ExtraRuleResolver.cs` (+5 -2) 📝 `Emby.Naming/Video/VideoListResolver.cs` (+3 -2) 📝 `Emby.Naming/Video/VideoResolver.cs` (+9 -6) 📝 `Emby.Server.Implementations/Library/LibraryManager.cs` (+1 -1) 📝 `Emby.Server.Implementations/Library/Resolvers/ExtraResolver.cs` (+2 -2) 📝 `Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs` (+2 -2) 📝 `tests/Jellyfin.Naming.Tests/Video/ExtraTests.cs` (+61 -1) </details> ### 📄 Description <!-- Ensure your title is short, descriptive, and in the imperative mood (Fix X, Change Y, instead of Fixed X, Changed Y). For a good inspiration of what to write in commit messages and PRs please review https://chris.beams.io/posts/git-commit/ and our documentation. --> **Changes** <!-- Describe your changes here in 1-5 sentences. --> Fix ExtraRuleResolver to stop filtering out libraries where the name of the base folder matches a 'videos extras' rule with an ExtraRuleType of DirectoryName. Currently the ExtraRuleResolver code doesn't know anything about the root folder of the current library. As a result, when we're attempting to add items in a library where the root folder has a name with a match in Emby.Naming.Common.NamingOptions.VideoExtraRules, the entire library is being ignored as a Video Extras folder. We need to pass in the root folder of the current library to compare to the path of the current item being evaluated, and if we match the current item's folder to the root folder, then we ignore the ExtraRules with a type of DirectoryName and we continue to scan deeper in the library. Filters still apply to subfolders within the library itself. **Issues** <!-- Tag any issues that this PR solves here. ex. Fixes # --> Fixes #12142. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
backuprepo 2025-12-22 09:34:18 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: starred/jellyfin#12924
No description provided.