aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2024-11-03 15:44:20 +0100
committerGitHub <noreply@github.com>2024-11-03 15:44:20 +0100
commit725c414682a91126e5090e3dc6943ffee6b9adc2 (patch)
tree1b72ba3999ce9e04469c6934da433cca25e32574
parenta416c438da1cc94389aa96d97929b27f3c08e5a7 (diff)
parent5957790ce82ef4ea1f15ab7942bce59de91a44c4 (diff)
Merge pull request #12778 from TonyBotongChu/anime-parse
Add EpisodeExpression for anime file names
-rw-r--r--Emby.Naming/Common/NamingOptions.cs8
-rw-r--r--tests/Jellyfin.Naming.Tests/TV/EpisodeNumberTests.cs2
2 files changed, 10 insertions, 0 deletions
diff --git a/Emby.Naming/Common/NamingOptions.cs b/Emby.Naming/Common/NamingOptions.cs
index 333d237a2..48338daf4 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>[0-9]+)\]")
+ {
+ 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)]