Cleanup code and merge conflict left in PR.

This commit is contained in:
Joseph Milazzo 2024-10-26 06:19:42 -05:00
parent 180b49b8ea
commit 87b1a807ea
5 changed files with 1337 additions and 109 deletions

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using API.Entities;
using API.Entities.Enums;
@ -61,12 +61,15 @@ public class MangaFileBuilder : IEntityBuilder<MangaFile>
return this;
}
/// <summary>
/// Generate the Hash on the underlying file
/// </summary>
/// <remarks>Only applicable to Epubs</remarks>
public MangaFileBuilder WithHash()
{
if (_mangaFile.Format == MangaFormat.Epub)
{
_mangaFile.KoreaderHash = KoreaderHelper.HashContents(_mangaFile.FilePath);
}
if (_mangaFile.Format != MangaFormat.Epub) return this;
_mangaFile.KoreaderHash = KoreaderHelper.HashContents(_mangaFile.FilePath);
return this;
}