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

@ -284,7 +284,7 @@ namespace API.Services.Tasks
AddOrUpdateFileForChapter(chapter, info);
chapter.Number = Parser.Parser.MinimumNumberFromRange(info.Chapters) + "";
chapter.Range = info.Chapters;
chapter.Pages = chapter.Files.Sum(f => f.NumberOfPages);
chapter.Pages = chapter.Files.Sum(f => f.Pages);
_metadataService.UpdateMetadata(chapter, _forceUpdate);
}
@ -350,7 +350,7 @@ namespace API.Services.Tasks
{
FilePath = info.FullFilePath,
Format = info.Format,
NumberOfPages = _archiveService.GetNumberOfPagesFromArchive(info.FullFilePath)
Pages = _archiveService.GetNumberOfPagesFromArchive(info.FullFilePath)
};
}
@ -361,7 +361,7 @@ namespace API.Services.Tasks
if (existingFile != null)
{
existingFile.Format = info.Format;
existingFile.NumberOfPages = _archiveService.GetNumberOfPagesFromArchive(info.FullFilePath);
existingFile.Pages = _archiveService.GetNumberOfPagesFromArchive(info.FullFilePath);
}
else
{