Koreader progress sync interface (#3025)

Co-authored-by: Joe Milazzo <josephmajora@gmail.com>
This commit is contained in:
Matthew DeAngelo 2024-10-26 07:09:00 -04:00 committed by GitHub
parent 1a88dd4fc0
commit 180b49b8ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 5848 additions and 8312 deletions

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using API.Entities;
using API.Entities.Enums;
@ -20,7 +20,7 @@ public class MangaFileBuilder : IEntityBuilder<MangaFile>
Pages = pages,
LastModified = File.GetLastWriteTime(filePath),
LastModifiedUtc = File.GetLastWriteTimeUtc(filePath),
FileName = Parser.RemoveExtensionIfSupported(filePath)
FileName = Parser.RemoveExtensionIfSupported(filePath),
};
}
@ -60,4 +60,14 @@ public class MangaFileBuilder : IEntityBuilder<MangaFile>
_mangaFile.Id = Math.Max(id, 0);
return this;
}
public MangaFileBuilder WithHash()
{
if (_mangaFile.Format == MangaFormat.Epub)
{
_mangaFile.KoreaderHash = KoreaderHelper.HashContents(_mangaFile.FilePath);
}
return this;
}
}