Clean up and fixed a parsing case.
This commit is contained in:
parent
aaedb11836
commit
a501e50c98
4 changed files with 50 additions and 50 deletions
|
|
@ -79,6 +79,10 @@ namespace API.Parser
|
|||
new Regex(
|
||||
@"(?<Series>.*)(?:, Chapter )(?<Chapter>\d+)",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
||||
// Goblin Slayer - Brand New Day 006.5 (2019) (Digital) (danke-Empire)
|
||||
new Regex(
|
||||
@"(?<Series>.*) (?<Chapter>\d+(?:.\d+|-\d+)?) \(\d{4}\)",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
||||
// Akame ga KILL! ZERO (2016-2019) (Digital) (LuCaZ)
|
||||
new Regex(
|
||||
@"(?<Series>.*)\(\d",
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ namespace API.Services
|
|||
|
||||
if (info == null)
|
||||
{
|
||||
_logger.LogWarning("Could not parse from {Path}", path);
|
||||
_logger.LogWarning("Could not parse series from {Path}", path);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -373,18 +373,5 @@ namespace API.Services
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Volume ExistingOrDefault(IList<Volume> existingVolumes, ICollection<Volume> volumes, string volumeName)
|
||||
{
|
||||
return volumes.SingleOrDefault(v => v.Name == volumeName) ?? existingVolumes.SingleOrDefault(v => v.Name == volumeName);
|
||||
}
|
||||
|
||||
public static Series ExistingOrDefault(Library library, IEnumerable<Series> allSeries, string seriesName)
|
||||
{
|
||||
var name = Parser.Parser.Normalize(seriesName);
|
||||
library.Series ??= new List<Series>();
|
||||
return library.Series.SingleOrDefault(s => Parser.Parser.Normalize(s.Name) == name) ??
|
||||
allSeries.SingleOrDefault(s => Parser.Parser.Normalize(s.Name) == name);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue