Koreader Progress Sync (#3823)

Co-authored-by: Joseph Milazzo <josephmajora@gmail.com>
This commit is contained in:
Tyler Kenney 2025-06-20 13:45:56 -04:00 committed by GitHub
parent b6d004614a
commit 3107ca73e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 4165 additions and 0 deletions

View file

@ -5,11 +5,13 @@ using API.Entities;
using Microsoft.EntityFrameworkCore;
namespace API.Data.Repositories;
#nullable enable
public interface IMangaFileRepository
{
void Update(MangaFile file);
Task<IList<MangaFile>> GetAllWithMissingExtension();
Task<MangaFile?> GetByKoreaderHash(string hash);
}
public class MangaFileRepository : IMangaFileRepository
@ -32,4 +34,13 @@ public class MangaFileRepository : IMangaFileRepository
.Where(f => string.IsNullOrEmpty(f.Extension))
.ToListAsync();
}
public async Task<MangaFile?> GetByKoreaderHash(string hash)
{
if (string.IsNullOrEmpty(hash)) return null;
return await _context.MangaFile
.FirstOrDefaultAsync(f => f.KoreaderHash != null &&
f.KoreaderHash.Equals(hash.ToUpper()));
}
}