aboutsummaryrefslogtreecommitdiff
path: root/Emby.Naming
diff options
context:
space:
mode:
authorJoe Rogers <1337joe@gmail.com>2022-03-04 10:52:15 +0100
committerJoe Rogers <1337joe@gmail.com>2022-03-04 10:52:21 +0100
commit3205e97e1e7ad6e3e84797f9575b6958d5dfc8b0 (patch)
tree3b3028698ae483ac01318d6df33f1b2f6d4b490e /Emby.Naming
parent136eab9b1eb56e9332b40721264f2720b97ab6c1 (diff)
Strip out external file fuzzy matching
Convert MediaFlagDelimiter back to char
Diffstat (limited to 'Emby.Naming')
-rw-r--r--Emby.Naming/Common/NamingOptions.cs4
-rw-r--r--Emby.Naming/ExternalFiles/ExternalPathParser.cs8
2 files changed, 6 insertions, 6 deletions
diff --git a/Emby.Naming/Common/NamingOptions.cs b/Emby.Naming/Common/NamingOptions.cs
index a79153e86..de9c75da2 100644
--- a/Emby.Naming/Common/NamingOptions.cs
+++ b/Emby.Naming/Common/NamingOptions.cs
@@ -266,7 +266,7 @@ namespace Emby.Naming.Common
MediaFlagDelimiters = new[]
{
- "."
+ '.'
};
MediaForcedFlags = new[]
@@ -715,7 +715,7 @@ namespace Emby.Naming.Common
/// <summary>
/// Gets or sets list of external media flag delimiters.
/// </summary>
- public string[] MediaFlagDelimiters { get; set; }
+ public char[] MediaFlagDelimiters { get; set; }
/// <summary>
/// Gets or sets list of external media forced flags.
diff --git a/Emby.Naming/ExternalFiles/ExternalPathParser.cs b/Emby.Naming/ExternalFiles/ExternalPathParser.cs
index 9d07dc2f9..3bde3a1cf 100644
--- a/Emby.Naming/ExternalFiles/ExternalPathParser.cs
+++ b/Emby.Naming/ExternalFiles/ExternalPathParser.cs
@@ -61,11 +61,11 @@ namespace Emby.Naming.ExternalFiles
{
var languageString = extraString;
var titleString = string.Empty;
- int separatorLength = separator.Length;
+ const int SeparatorLength = 1;
while (languageString.Length > 0)
{
- int lastSeparator = languageString.LastIndexOf(separator, StringComparison.OrdinalIgnoreCase);
+ int lastSeparator = languageString.LastIndexOf(separator);
if (lastSeparator == -1)
{
@@ -73,7 +73,7 @@ namespace Emby.Naming.ExternalFiles
}
string currentSlice = languageString[lastSeparator..];
- string currentSliceWithoutSeparator = currentSlice[separatorLength..];
+ string currentSliceWithoutSeparator = currentSlice[SeparatorLength..];
if (_namingOptions.MediaDefaultFlags.Any(s => currentSliceWithoutSeparator.Contains(s, StringComparison.OrdinalIgnoreCase)))
{
@@ -107,7 +107,7 @@ namespace Emby.Naming.ExternalFiles
languageString = languageString[..lastSeparator];
}
- pathInfo.Title = separatorLength <= titleString.Length ? titleString[separatorLength..] : null;
+ pathInfo.Title = titleString.Length >= SeparatorLength ? titleString[SeparatorLength..] : null;
}
return pathInfo;