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,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using API.Entities;
@ -10,6 +11,7 @@ public interface IMangaFileRepository
{
void Update(MangaFile file);
Task<IList<MangaFile>> GetAllWithMissingExtension();
Task<MangaFile> GetByKoreaderHash(string hash);
}
public class MangaFileRepository : IMangaFileRepository
@ -32,4 +34,10 @@ public class MangaFileRepository : IMangaFileRepository
.Where(f => string.IsNullOrEmpty(f.Extension))
.ToListAsync();
}
public Task<MangaFile> GetByKoreaderHash(string hash)
{
return _context.MangaFile
.FirstOrDefaultAsync(f => f.KoreaderHash == hash.ToUpper());
}
}