Random Book Fixes (#2434)

This commit is contained in:
Joe Milazzo 2023-11-15 18:48:21 -06:00 committed by GitHub
parent 1cc5484655
commit 17d6cd7843
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 284 additions and 44 deletions

View file

@ -555,7 +555,7 @@ public class BookService : IBookService
// If this is a single book and not a collection, set publication status to Completed
if (string.IsNullOrEmpty(info.Volume) && Parser.ParseVolume(filePath).Equals(Parser.DefaultVolume))
{
info.Number = "1";
//info.Number = "1";
info.Count = 1;
}
@ -635,6 +635,8 @@ public class BookService : IBookService
return;
case "aut":
case "author":
case "creator":
case "cre":
info.Writer += AppendAuthor(person);
return;
case "pbl":

View file

@ -291,8 +291,11 @@ public class ProcessSeries : IProcessSeries
var maxVolume = series.Volumes.Max(v => (int) Parser.Parser.MaxNumberFromRange(v.Name));
var maxChapter = chapters.Max(c => (int) Parser.Parser.MaxNumberFromRange(c.Range));
if ((maxChapter == 0 || maxChapter > series.Metadata.TotalCount) && maxVolume <= series.Metadata.TotalCount)
// Single books usually don't have a number in their Range (filename)
if (series.Format == MangaFormat.Epub || series.Format == MangaFormat.Pdf && chapters.Count == 1)
{
series.Metadata.MaxCount = 1;
} else if ((maxChapter == 0 || maxChapter > series.Metadata.TotalCount) && maxVolume <= series.Metadata.TotalCount)
{
series.Metadata.MaxCount = maxVolume;
} else if (maxVolume == series.Metadata.TotalCount)