mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-05 14:25:17 -04:00
OPDS Enhancements, Epub fixes, and a lot more (#4035)
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com> Co-authored-by: Robbie Davis <robbie@therobbiedavis.com> Co-authored-by: Fabian Pammer <fpammer@mantro.net> Co-authored-by: Vinícius Licz <vinilicz@gmail.com>
This commit is contained in:
@@ -26,8 +26,8 @@ public interface IGenreRepository
|
||||
Task RemoveAllGenreNoLongerAssociated(bool removeExternal = false);
|
||||
Task<IList<GenreTagDto>> GetAllGenreDtosForLibrariesAsync(int userId, IList<int>? libraryIds = null, QueryContext context = QueryContext.None);
|
||||
Task<int> GetCountAsync();
|
||||
Task<GenreTagDto> GetRandomGenre();
|
||||
Task<GenreTagDto> GetGenreById(int id);
|
||||
Task<GenreTagDto?> GetRandomGenre();
|
||||
Task<GenreTagDto?> GetGenreById(int id);
|
||||
Task<List<string>> GetAllGenresNotInListAsync(ICollection<string> genreNames);
|
||||
Task<PagedList<BrowseGenreDto>> GetBrowseableGenre(int userId, UserParams userParams);
|
||||
}
|
||||
@@ -79,7 +79,7 @@ public class GenreRepository : IGenreRepository
|
||||
return await _context.Genre.CountAsync();
|
||||
}
|
||||
|
||||
public async Task<GenreTagDto> GetRandomGenre()
|
||||
public async Task<GenreTagDto?> GetRandomGenre()
|
||||
{
|
||||
var genreCount = await GetCountAsync();
|
||||
if (genreCount == 0) return null;
|
||||
@@ -92,7 +92,7 @@ public class GenreRepository : IGenreRepository
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task<GenreTagDto> GetGenreById(int id)
|
||||
public async Task<GenreTagDto?> GetGenreById(int id)
|
||||
{
|
||||
return await _context.Genre
|
||||
.Where(g => g.Id == id)
|
||||
|
||||
Reference in New Issue
Block a user