diff options
| author | Erik Rigtorp <erik@rigtorp.se> | 2020-05-03 21:29:52 -0700 |
|---|---|---|
| committer | Erik Rigtorp <erik@rigtorp.se> | 2020-06-08 16:35:20 -0700 |
| commit | 75efb8f52d4234bfdefa2a0ac48f7261aa9ef58b (patch) | |
| tree | e8200db84c65577c7b87c6151afd5572d0d4fecd | |
| parent | 82ff3fa75d7da1d160ee5b774bd2238b5727d5ea (diff) | |
Use additional unicode chars for year extraction
| -rw-r--r-- | Emby.Naming/Common/NamingOptions.cs | 4 | ||||
| -rw-r--r-- | Emby.Naming/Video/CleanDateTimeParser.cs | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Emby.Naming/Common/NamingOptions.cs b/Emby.Naming/Common/NamingOptions.cs index 1b343790e..c727681a6 100644 --- a/Emby.Naming/Common/NamingOptions.cs +++ b/Emby.Naming/Common/NamingOptions.cs @@ -137,7 +137,9 @@ namespace Emby.Naming.Common CleanDateTimes = new[] { @"(.+[^_\,\.\(\)\[\]\-])[_\.\(\)\[\]\-](19\d{2}|20\d{2})([ _\,\.\(\)\[\]\-][^0-9]|).*(19\d{2}|20\d{2})*", - @"(.+[^_\,\.\(\)\[\]\-])[ _\.\(\)\[\]\-]+(19\d{2}|20\d{2})([ _\,\.\(\)\[\]\-][^0-9]|).*(19\d{2}|20\d{2})*" + @"(.+[^_\,\.\(\)\[\]\-])[ _\.\(\)\[\]\-]+(19\d{2}|20\d{2})([ _\,\.\(\)\[\]\-][^0-9]|).*(19\d{2}|20\d{2})*", + @"(.+\w)\W+\p{Ps}(19[0-9]{2}|20[0-9]{2})\p{Pe}", // Prefer year enclosed in parenthesis (){}[] + @"(.+\w)\W+(19[0-9]{2}|20[0-9]{2})(\W|$)", // Secondary year surrounded by non-word chars }; CleanStrings = new[] diff --git a/Emby.Naming/Video/CleanDateTimeParser.cs b/Emby.Naming/Video/CleanDateTimeParser.cs index 579c9e91e..7c18ab039 100644 --- a/Emby.Naming/Video/CleanDateTimeParser.cs +++ b/Emby.Naming/Video/CleanDateTimeParser.cs @@ -32,7 +32,6 @@ namespace Emby.Naming.Video var match = expression.Match(name); if (match.Success - && match.Groups.Count == 5 && match.Groups[1].Success && match.Groups[2].Success && int.TryParse(match.Groups[2].Value, NumberStyles.Integer, CultureInfo.InvariantCulture, out var year)) |
