Skip to content

Commit

Permalink
Random Book Fixes (#2434)
Browse files Browse the repository at this point in the history
  • Loading branch information
majora2007 authored Nov 16, 2023
1 parent 1cc5484 commit 17d6cd7
Show file tree
Hide file tree
Showing 9 changed files with 284 additions and 44 deletions.
4 changes: 3 additions & 1 deletion API/Services/BookService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ await _mediaErrorService.ReportMediaIssueAsync(book.FilePath, MediaErrorProducer
// 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;
}

Expand Down Expand Up @@ -635,6 +635,8 @@ private static void PopulatePerson(EpubMetadataMeta metadataItem, ComicInfo info
return;
case "aut":
case "author":
case "creator":
case "cre":
info.Writer += AppendAuthor(person);
return;
case "pbl":
Expand Down
7 changes: 5 additions & 2 deletions API/Services/Tasks/Scanner/ProcessSeries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,11 @@ public void UpdateSeriesMetadata(Series series, Library library)
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)
Expand Down
281 changes: 257 additions & 24 deletions UI/Web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 17d6cd7

Please sign in to comment.