FF-1524: Added more comic options

This commit is contained in:
John Andrews
2024-05-08 16:42:39 +12:00
parent cf75cf9122
commit f31c2b66c2
3 changed files with 9 additions and 5 deletions

View File

@@ -142,12 +142,16 @@ public class ComicConverter: Node
args.Logger?.ILog("Desired Format: " + Format);
var metadata = new Dictionary<string, object>();
int pageCount = GetPageCount(args, currentFormat, localFile);
args.Logger?.ILog("Page Count: " + pageCount);
metadata.Add("Format", currentFormat);
metadata.Add("Pages", pageCount);
var pageCountResult = GetPageCount(args, currentFormat, localFile);
if (pageCountResult.Success(out int pageCount))
{
args.Logger?.ILog("Page Count: " + pageCount);
metadata.Add("Pages", pageCount);
args.RecordStatisticAverage("COMIC_PAGES", pageCount);
}
args.RecordStatisticRunningTotals("COMIC_FORMAT", currentFormat);
args.RecordStatisticAverage("COMIC_PAGES", pageCount);
args.SetMetadata(metadata);
args.Logger?.ILog("Setting metadata: " + currentFormat);
@@ -294,7 +298,7 @@ public class ComicConverter: Node
/// <param name="format">the format</param>
/// <param name="file">the file to get the page count for</param>
/// <returns>the number of pages</returns>
private int GetPageCount(NodeParameters args, string format, string file)
private Result<int> GetPageCount(NodeParameters args, string format, string file)
{
if (format == null)
return 0;

Binary file not shown.

Binary file not shown.