jellyfin/Emby.Naming
Michael McElroy f02190c394
Fix for Issue #12142: Fix ExtraRuleResolver filtering out top level folders (#12170)
* Fix ExtraRuleResolver to stop filtering out libraries where the name of the base folder matches an '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.

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.

* Update CONTRIBUTORS.md

* Update Emby.Naming/Video/ExtraRuleResolver.cs

* Update ExtraTests.cs

Add tests for this fix.

Also add missing tests in TestKodiExtras, TestExpandedExtras, and TestSample, and expanded TestDirectories into TestDirectoriesAudioExtras and TestDirectoriesVideoExtras. There were no checks for the theme-music folder name previously.

* Update ExtraTests.cs

Removed unnecessary "using System"

* In MediaBrowser.Model, upgrade System.Text.Json from 8.0.3 (vulnerable - high risk) to 8.0.4

* Update ExtraTests.cs

Remove empty lines in usings

* Revert "In MediaBrowser.Model, upgrade System.Text.Json from 8.0.3 (vulnerable - high risk) to 8.0.4"
2025-03-27 18:18:19 -06:00
..
Audio Fix clean regex 2023-06-28 17:40:00 +02:00
AudioBook Allocate less Lists 2023-03-01 00:44:57 +01:00
Common Add eac3 as audio name format (#13784) 2025-03-27 10:43:25 -06:00
ExternalFiles Backport pull request #12026 from jellyfin/release-10.9.z 2024-06-23 11:40:41 -04:00
Properties Adjusted AssemblyCopyright attribute values. 2019-03-14 22:17:56 +01:00
TV Rework season folder parsing (#11748) 2025-03-23 10:05:40 -06:00
Video Fix for Issue #12142: Fix ExtraRuleResolver filtering out top level folders (#12170) 2025-03-27 18:18:19 -06:00
Emby.Naming.csproj Update projects to .NET 9 (#13023) 2024-11-16 10:11:01 -07:00