Add Koreader API endpoints
This commit is contained in:
parent
6288d89651
commit
e84aed357a
19 changed files with 4079 additions and 1 deletions
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue