mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2026-01-05 22:10:34 -06:00
fixed comic renamer
This commit is contained in:
@@ -284,14 +284,6 @@ public class CreateComicInfo : Node
|
||||
info.Count = ofNumber;
|
||||
}
|
||||
|
||||
//var issueNumberMatch2 = Regex.Match(shortname, @"(?<!['])[#]?\b(\-?\d{1,3})\b(?!\w)");
|
||||
ExtractIssueNumber(info, ref shortname);
|
||||
|
||||
if (info.Number != null)
|
||||
ExtractYear(ref shortname);
|
||||
else
|
||||
ExtractAnnualInfo(info, ref shortname);
|
||||
|
||||
var volMatch = Regex.Match(shortname, @"\b[Vv](?:olume|ol)?\s*(\d+)\b", RegexOptions.IgnoreCase);
|
||||
if (volMatch.Success)
|
||||
{
|
||||
@@ -302,6 +294,14 @@ public class CreateComicInfo : Node
|
||||
: shortname;
|
||||
|
||||
}
|
||||
//var issueNumberMatch2 = Regex.Match(shortname, @"(?<!['])[#]?\b(\-?\d{1,3})\b(?!\w)");
|
||||
ExtractIssueNumber(info, ref shortname);
|
||||
|
||||
if (info.Number != null)
|
||||
ExtractYear(ref shortname);
|
||||
else
|
||||
ExtractAnnualInfo(info, ref shortname);
|
||||
|
||||
|
||||
// remove any junk
|
||||
shortname = Regex.Replace(shortname, @"\(([\-]?\d+)\)", "$1").Trim();
|
||||
|
||||
@@ -92,6 +92,33 @@ public class ComicInfoTests : TestBase
|
||||
Assert.AreEqual("Ultimate Spider-Man (2000) - Volume 5 - Public Scrutiny.cbz", name.Value);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Volume2()
|
||||
{
|
||||
var result = CreateComicInfo.GetInfo(Logger,
|
||||
"/home/john/Comics/Marvel/X-Men/X-Men The Complete Age of Apocalypse Epic/X-Men The Complete Age of Apocalypse Epic - Vol 3.cbz",
|
||||
"/home/john/Comics",
|
||||
true);
|
||||
|
||||
TestContext.WriteLine(Logger.ToString());
|
||||
|
||||
Assert.IsFalse(result.IsFailed);
|
||||
var info = result.Value;
|
||||
Assert.IsNotNull(info);
|
||||
Assert.AreEqual("Marvel", info.Publisher);
|
||||
Assert.AreEqual("X-Men The Complete Age of Apocalypse Epic", info.Series);
|
||||
Assert.AreEqual("Volume 3", info.Volume);
|
||||
Assert.AreEqual(null, info.Title);
|
||||
|
||||
var xml = CreateComicInfo.SerializeToXml(info);
|
||||
Assert.IsFalse(string.IsNullOrWhiteSpace(xml));
|
||||
TestContext.WriteLine(new string('-', 70));
|
||||
TestContext.WriteLine(xml);
|
||||
|
||||
var name = CreateComicInfo.GetNewName(info, "cbz", 0);
|
||||
Assert.AreEqual("X-Men The Complete Age of Apocalypse Epic - Volume 3.cbz", name.Value);
|
||||
}
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public void NameAndNumber()
|
||||
@@ -226,6 +253,7 @@ public class ComicInfoTests : TestBase
|
||||
var name = CreateComicInfo.GetNewName(info, "cbz", 3);
|
||||
Assert.AreEqual("Batman - The Killing Joke.cbz", name.Value);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void NameAndNumber2()
|
||||
{
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user