Add Koreader API endpoints

This commit is contained in:
Tyler Kenney 2025-05-19 16:51:14 -04:00
parent 6288d89651
commit e84aed357a
19 changed files with 4079 additions and 1 deletions

View file

@ -10,6 +10,7 @@ public interface IMangaFileRepository
{
void Update(MangaFile file);
Task<IList<MangaFile>> GetAllWithMissingExtension();
Task<MangaFile?> GetByKoreaderHash(string hash);
}
public class MangaFileRepository : IMangaFileRepository
@ -32,4 +33,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 &&
EF.Functions.Like(f.KoreaderHash, hash));
}
}