Lots of Bugfixes (#2977)

This commit is contained in:
Joe Milazzo 2024-06-04 17:43:15 -05:00 committed by GitHub
parent 8c629695ef
commit 616ed7a75d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 427 additions and 244 deletions

View file

@ -34,7 +34,7 @@ public interface IChapterRepository
Task<ChapterDto?> GetChapterDtoAsync(int chapterId, ChapterIncludes includes = ChapterIncludes.Files);
Task<ChapterMetadataDto?> GetChapterMetadataDtoAsync(int chapterId, ChapterIncludes includes = ChapterIncludes.Files);
Task<IList<MangaFile>> GetFilesForChapterAsync(int chapterId);
Task<IList<Chapter>> GetChaptersAsync(int volumeId);
Task<IList<Chapter>> GetChaptersAsync(int volumeId, ChapterIncludes includes = ChapterIncludes.None);
Task<IList<MangaFile>> GetFilesForChaptersAsync(IReadOnlyList<int> chapterIds);
Task<string?> GetChapterCoverImageAsync(int chapterId);
Task<IList<string>> GetAllCoverImagesAsync();
@ -184,10 +184,11 @@ public class ChapterRepository : IChapterRepository
/// </summary>
/// <param name="volumeId"></param>
/// <returns></returns>
public async Task<IList<Chapter>> GetChaptersAsync(int volumeId)
public async Task<IList<Chapter>> GetChaptersAsync(int volumeId, ChapterIncludes includes = ChapterIncludes.None)
{
return await _context.Chapter
.Where(c => c.VolumeId == volumeId)
.Includes(includes)
.OrderBy(c => c.SortOrder)
.ToListAsync();
}