[PR #5043] [MERGED] adjust episode path expression to allow digits in series names #10376

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

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/5043
Author: @senritsu
Created: 1/17/2021
Status: Merged
Merged: 2/5/2021
Merged by: @dkanada

Base: masterHead: improve-episode-number-parsing-with-digits-in-names


📝 Commits (1)

  • 4e21b49 adjust episode path expression to allow digits in series names

📊 Changes

2 files changed (+12 additions, -7 deletions)

View changed files

📝 Emby.Naming/Common/NamingOptions.cs (+7 -6)
📝 tests/Jellyfin.Naming.Tests/TV/EpisodeNumberTests.cs (+5 -1)

📄 Description

Changes
The previous expression was too greedy to consume digits, because the hyphen was optional. This lead to incorrect episode numbers for certain series with digits in their names, in those cases each episode was recognized as the same episode number (the digit from the series name).

The rule, which matches most standard anime filenames, also had a lower priority than one of the Kodi rules, leading to incorrect recognition for absolute numbered episodes with triple digits and higher (first digit was used as season number, rest of digits as episode number). This also resolves one of the TODO test cases.

Additional test cases were added to ensure that both hyphens in different parts of the filename, as well as names without hyphens, still work correctly. All previous test cases still pass.

Unfortunately another TODO (EpisodeNumberTests.cs@L76, Uchuu Senkan Yamato 2199) with the same issue (digits in the series name) could not be trivially fixed in the same change, due to the significantly different formatting. Attempts to resolve this case did not work out for now.

Issues


🔄 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/5043 **Author:** [@senritsu](https://github.com/senritsu) **Created:** 1/17/2021 **Status:** ✅ Merged **Merged:** 2/5/2021 **Merged by:** [@dkanada](https://github.com/dkanada) **Base:** `master` ← **Head:** `improve-episode-number-parsing-with-digits-in-names` --- ### 📝 Commits (1) - [`4e21b49`](https://github.com/jellyfin/jellyfin/commit/4e21b49994ba031e0716568c38681c3c5b83bbc0) adjust episode path expression to allow digits in series names ### 📊 Changes **2 files changed** (+12 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `Emby.Naming/Common/NamingOptions.cs` (+7 -6) 📝 `tests/Jellyfin.Naming.Tests/TV/EpisodeNumberTests.cs` (+5 -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** The previous expression was too greedy to consume digits, because the hyphen was optional. This lead to incorrect episode numbers for certain series with digits in their names, in those cases each episode was recognized as the same episode number (the digit from the series name). The rule, which matches most standard anime filenames, also had a lower priority than one of the Kodi rules, leading to incorrect recognition for absolute numbered episodes with triple digits and higher (first digit was used as season number, rest of digits as episode number). This also resolves one of the TODO test cases. Additional test cases were added to ensure that both hyphens in different parts of the filename, as well as names without hyphens, still work correctly. All previous test cases still pass. Unfortunately another TODO ([EpisodeNumberTests.cs@L76](https://github.com/senritsu/jellyfin/blob/4e21b49994ba031e0716568c38681c3c5b83bbc0/tests/Jellyfin.Naming.Tests/TV/EpisodeNumberTests.cs#L76), Uchuu Senkan Yamato 2199) with the same issue (digits in the series name) could not be trivially fixed in the same change, due to the significantly different formatting. Attempts to resolve this case did not work out for now. **Issues** <!-- Tag any issues that this PR solves here. ex. Fixes # --> --- <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 06:19:10 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#10376