Some code cleanup

This commit is contained in:
Joseph Milazzo 2021-03-22 16:38:51 -05:00
parent 585e965a85
commit d73bd22db2
34 changed files with 814 additions and 383 deletions

View file

@ -106,7 +106,7 @@ namespace API.Services
var chapterFiles = chapter.Files ?? await _unitOfWork.VolumeRepository.GetFilesForChapter(chapter.Id);
foreach (var mangaFile in chapterFiles)
{
if (page <= (mangaFile.NumberOfPages + pagesSoFar))
if (page <= (mangaFile.Pages + pagesSoFar))
{
var path = GetCachePath(chapter.Id);
var files = _directoryService.GetFilesWithExtension(path, Parser.Parser.ImageFileExtensions);
@ -121,7 +121,7 @@ namespace API.Services
return (files.ElementAt(page - pagesSoFar), mangaFile);
}
pagesSoFar += mangaFile.NumberOfPages;
pagesSoFar += mangaFile.Pages;
}
return ("", null);