Implemented the ability to read format tag and force special status. (#1284)
This commit is contained in:
parent
a0e1ba8d67
commit
1a128a3af4
4 changed files with 29 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Immutable;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
|
@ -512,6 +513,11 @@ namespace API.Parser
|
|||
MatchOptions, RegexTimeout
|
||||
);
|
||||
|
||||
private static readonly ImmutableArray<string> FormatTagSpecialKeyowrds = ImmutableArray.Create(
|
||||
"Special", "Reference", "Director's Cut", "Box Set", "Box-Set", "Annual", "Anthology", "Epilogue",
|
||||
"One Shot", "One-Shot", "Prologue", "TPB", "Trade Paper Back", "Omnibus", "Compendium", "Absolute", "Graphic Novel",
|
||||
"GN", "FCBD");
|
||||
|
||||
public static MangaFormat ParseFormat(string filePath)
|
||||
{
|
||||
if (IsArchive(filePath)) return MangaFormat.Archive;
|
||||
|
@ -1034,5 +1040,15 @@ namespace API.Parser
|
|||
{
|
||||
return path.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks against a set of strings to validate if a ComicInfo.Format should receive special treatment
|
||||
/// </summary>
|
||||
/// <param name="comicInfoFormat"></param>
|
||||
/// <returns></returns>
|
||||
public static bool HasComicInfoSpecial(string comicInfoFormat)
|
||||
{
|
||||
return FormatTagSpecialKeyowrds.Contains(comicInfoFormat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue