[PR #14540] [MERGED] Improve extra rule resolution and file handling #14026

Closed
opened 2026-02-07 07:23:07 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/14540
Author: @TokerX
Created: 7/27/2025
Status: Merged
Merged: 8/4/2025
Merged by: @joshuaboniface

Base: masterHead: issue-8641


📝 Commits (1)

  • 7785b51 Enhance extra rules for video and audio file naming; update tests for new naming conventions

📊 Changes

8 files changed (+195 additions, -93 deletions)

View changed files

📝 CONTRIBUTORS.md (+1 -0)
📝 Emby.Naming/Common/NamingOptions.cs (+14 -14)
📝 Emby.Naming/Video/ExtraRuleResolver.cs (+28 -50)
📝 Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs (+12 -25)
📝 tests/Jellyfin.Naming.Tests/Video/ExtraTests.cs (+9 -2)
📝 tests/Jellyfin.Naming.Tests/Video/VideoListResolverTests.cs (+1 -1)
tests/Jellyfin.Server.Implementations.Tests/Library/CoreResolutionIgnoreRuleTest.cs (+129 -0)
📝 tests/Jellyfin.Server.Implementations.Tests/Plugins/PluginManagerTests.cs (+1 -1)

📄 Description

NamingOptions.cs

  • Updated suffix-based extra rules to prevent false positives on
    legitimate file names ending in trailer or sample.

ExtraRuleResolver.cs

  • Refactored if/else if into a switch expression for clarity.
  • Moved repeated result assignment outside conditional blocks to
    reduce duplication.
  • Lifted invariant calculations outside the loop to improve
    efficiency.

CoreResolutionIgnoreRule.cs

  • Added support for checking top parent.
  • Reduced nesting for readability.
  • Removed redundant "&& parent is not AggregateFolder" check
    already evaluated upstream.

Tests

ExtraTests.cs and VideoListResolverTests.cs: updated to reflect
new logic.

CoreResolutionIgnoreRuleTest.cs: new tests added

PluginManagerTests.cs: fixed test failure by formatting
versionInfo.Timestamp using the "o" format to ensure consistent
UTC parsing.

Closes #8641


🔄 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/14540 **Author:** [@TokerX](https://github.com/TokerX) **Created:** 7/27/2025 **Status:** ✅ Merged **Merged:** 8/4/2025 **Merged by:** [@joshuaboniface](https://github.com/joshuaboniface) **Base:** `master` ← **Head:** `issue-8641` --- ### 📝 Commits (1) - [`7785b51`](https://github.com/jellyfin/jellyfin/commit/7785b51f572cf48a62dfc2ee60fc1db0ccedf1a2) Enhance extra rules for video and audio file naming; update tests for new naming conventions ### 📊 Changes **8 files changed** (+195 additions, -93 deletions) <details> <summary>View changed files</summary> 📝 `CONTRIBUTORS.md` (+1 -0) 📝 `Emby.Naming/Common/NamingOptions.cs` (+14 -14) 📝 `Emby.Naming/Video/ExtraRuleResolver.cs` (+28 -50) 📝 `Emby.Server.Implementations/Library/CoreResolutionIgnoreRule.cs` (+12 -25) 📝 `tests/Jellyfin.Naming.Tests/Video/ExtraTests.cs` (+9 -2) 📝 `tests/Jellyfin.Naming.Tests/Video/VideoListResolverTests.cs` (+1 -1) ➕ `tests/Jellyfin.Server.Implementations.Tests/Library/CoreResolutionIgnoreRuleTest.cs` (+129 -0) 📝 `tests/Jellyfin.Server.Implementations.Tests/Plugins/PluginManagerTests.cs` (+1 -1) </details> ### 📄 Description **NamingOptions.cs** - Updated suffix-based extra rules to prevent false positives on legitimate file names ending in trailer or sample. **ExtraRuleResolver.cs** - Refactored if/else if into a switch expression for clarity. - Moved repeated result assignment outside conditional blocks to reduce duplication. - Lifted invariant calculations outside the loop to improve efficiency. **CoreResolutionIgnoreRule.cs** - Added support for checking top parent. - Reduced nesting for readability. - Removed redundant "&& parent is not AggregateFolder" check already evaluated upstream. **Tests** **ExtraTests.cs** and **VideoListResolverTests.cs**: updated to reflect new logic. **CoreResolutionIgnoreRuleTest.cs**: new tests added **PluginManagerTests.cs**: fixed test failure by formatting versionInfo.Timestamp using the "o" format to ensure consistent UTC parsing. Closes #8641 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 07:23:07 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#14026