diff options
| author | TonyB <zbtsebuaa@outlook.com> | 2024-10-06 15:12:20 +0800 |
|---|---|---|
| committer | TonyB <zbtsebuaa@outlook.com> | 2024-10-12 17:09:18 +0800 |
| commit | 79ee36ee155483fcbb2b2863f549b68034634dbc (patch) | |
| tree | f3248cef5fd176c34a232c0b2ab539fe4323a3b4 | |
| parent | 822d4075843cdd4634faf738c2fb69b6b3201d5a (diff) | |
Add EpisodeExpression for anime file names
| -rw-r--r-- | Emby.Naming/Common/NamingOptions.cs | 8 | ||||
| -rw-r--r-- | tests/Jellyfin.Naming.Tests/TV/EpisodeNumberTests.cs | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Emby.Naming/Common/NamingOptions.cs b/Emby.Naming/Common/NamingOptions.cs index 333d237a2..f04346594 100644 --- a/Emby.Naming/Common/NamingOptions.cs +++ b/Emby.Naming/Common/NamingOptions.cs @@ -467,6 +467,14 @@ namespace Emby.Naming.Common { IsNamed = true }, + + // Anime style expression + // "[Group][Series Name][21][1080p][FLAC][HASH]" + // "[Group] Series Name [04][BDRIP]" + new EpisodeExpression(@"(?:\[(?:[^\]]+)\]\s*)?(?<seriesname>\[[^\]]+\]|[^[\]]+)\s*\[(?<epnumber>\d+)\]") + { + IsNamed = true + }, }; VideoExtraRules = new[] diff --git a/tests/Jellyfin.Naming.Tests/TV/EpisodeNumberTests.cs b/tests/Jellyfin.Naming.Tests/TV/EpisodeNumberTests.cs index 406381f14..7bfab570b 100644 --- a/tests/Jellyfin.Naming.Tests/TV/EpisodeNumberTests.cs +++ b/tests/Jellyfin.Naming.Tests/TV/EpisodeNumberTests.cs @@ -77,6 +77,8 @@ namespace Jellyfin.Naming.Tests.TV [InlineData("Season 3/The Series S3 E9 - The title.avi", 9)] [InlineData("Season 3/S003 E009.avi", 9)] [InlineData("Season 3/Season 3 Episode 9.avi", 9)] + [InlineData("[VCB-Studio] Re Zero kara Hajimeru Isekai Seikatsu [21][Ma10p_1080p][x265_flac].mkv", 21)] + [InlineData("[CASO&Sumisora][Oda_Nobuna_no_Yabou][04][BDRIP][1920x1080][x264_AAC][7620E503].mp4", 4)] // [InlineData("Case Closed (1996-2007)/Case Closed - 317.mkv", 317)] // triple digit episode number // TODO: [InlineData("Season 2/16 12 Some Title.avi", 16)] |
