Potential fix for parsing Cyberpunk 2077
- Added a ComicsSeriesSpecialCasesRegex and passed any filename that contains "Cyberpunk 2077" over to it so we can parse it separately. This could be used for any other potential problem series.
This commit is contained in:
parent
569ec9bb09
commit
a14417e640
2 changed files with 30 additions and 2 deletions
|
|
@ -220,6 +220,18 @@ namespace API.Parser
|
|||
MatchOptions, RegexTimeout),
|
||||
};
|
||||
|
||||
private static readonly Regex[] ComicSeriesSpecialCaseRegex = new[]
|
||||
{
|
||||
// Cyberpunk 2077 - Your Voice 01
|
||||
new Regex(
|
||||
@"^(?<Series>.+? \d.+) (?<Chapter>(?:[^#])\d+?)",
|
||||
MatchOptions, RegexTimeout),
|
||||
// Cyberpunk 2077 #01
|
||||
new Regex(
|
||||
@"^(?<Series>.+? \d.+) #(?<Chapter>\d.+?)",
|
||||
MatchOptions, RegexTimeout),
|
||||
};
|
||||
|
||||
private static readonly Regex[] ComicSeriesRegex = new[]
|
||||
{
|
||||
// Invincible Vol 01 Family matters (2005) (Digital)
|
||||
|
|
@ -714,7 +726,15 @@ namespace API.Parser
|
|||
}
|
||||
public static string ParseComicSeries(string filename)
|
||||
{
|
||||
foreach (var regex in ComicSeriesRegex)
|
||||
Regex[] ComicCase;
|
||||
if (filename.Contains("Cyberpunk 2077"))
|
||||
{
|
||||
ComicCase = ComicSeriesSpecialCaseRegex;
|
||||
} else
|
||||
{
|
||||
ComicCase = ComicSeriesRegex;
|
||||
}
|
||||
foreach (var regex in ComicCase)
|
||||
{
|
||||
var matches = regex.Matches(filename);
|
||||
foreach (Match match in matches)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue