[skip ci] More work on parsing - seasons to fix still and use banned words

This commit is contained in:
iPromKnight
2024-03-10 03:52:21 +00:00
parent 51246ed352
commit 320fccc8e8
26 changed files with 177894 additions and 4898 deletions

View File

@@ -21,7 +21,7 @@ public partial class ResolutionParser
private static partial Regex R480Exp();
private static readonly Regex ResolutionExp = new(string.Join("|", R2160pExp(), R1080pExp(), R720pExp(), R576pExp(), R540pExp(), R480Exp()), RegexOptions.IgnoreCase);
public static void Parse(string title, out Resolution? resolution, out string? source)
{
resolution = null;
@@ -31,14 +31,16 @@ public partial class ResolutionParser
if (result.Success)
{
foreach (var key in Enum.GetNames(typeof(Resolution)))
foreach (var resolutionEnum in Resolution.List)
{
if (result.Groups[key].Success)
if (!result.Groups[resolutionEnum.Name].Success)
{
resolution = Resolution.FromName(key);
source = result.Groups[key].Value;
return;
continue;
}
resolution = resolutionEnum;
source = result.Groups[resolutionEnum.Name].Value;
return;
}
}
@@ -50,4 +52,4 @@ public partial class ResolutionParser
resolution = Resolution.R480P;
}
}
}
}