mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-05 22:35:17 -04:00
Massive UI Cleanup (#4466)
Co-authored-by: KindlyFire <10267586+kindlyfire@users.noreply.github.com> Co-authored-by: Hosted Weblate <hosted@weblate.org> Co-authored-by: Adam Havránek <adamhavra@seznam.cz> Co-authored-by: Aindriú Mac Giolla Eoin <aindriu80@gmail.com> Co-authored-by: Alexey <lewadedun@gmail.com> Co-authored-by: Anon Bitardov <timurvolga23+weblate@gmail.com> Co-authored-by: Ferran <ferrancette@gmail.com> Co-authored-by: Gneb <goozi12345@gmail.com> Co-authored-by: Robin Stolpe <robinstolpe@slashmad.com> Co-authored-by: 안세훈 <on9686@gmail.com> Co-authored-by: Tijl Van den Brugghen <contact@tijlvdb.me>
This commit is contained in:
@@ -37,6 +37,8 @@ public interface ILibraryRepository
|
||||
void Update(Library library);
|
||||
void Delete(Library? library);
|
||||
Task<IEnumerable<LibraryDto>> GetLibraryDtosAsync();
|
||||
Task<LibraryDto?> GetLibraryDtoByIdAsync(int libraryId);
|
||||
Task<LiteLibraryDto?> GetLiteLibraryDtoByIdAsync(int libraryId);
|
||||
Task<bool> LibraryExists(string libraryName);
|
||||
Task<Library?> GetLibraryForIdAsync(int libraryId, LibraryIncludes includes = LibraryIncludes.None);
|
||||
Task<IList<LibraryDto>> GetLibraryDtosForUsernameAsync(string userName);
|
||||
@@ -214,6 +216,23 @@ public class LibraryRepository : ILibraryRepository
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<LibraryDto?> GetLibraryDtoByIdAsync(int libraryId)
|
||||
{
|
||||
return await _context.Library
|
||||
.Include(f => f.Folders)
|
||||
.Include(l => l.LibraryFileTypes)
|
||||
.ProjectTo<LibraryDto>(_mapper.ConfigurationProvider)
|
||||
.AsSplitQuery()
|
||||
.FirstOrDefaultAsync(l => l.Id == libraryId);
|
||||
}
|
||||
|
||||
public async Task<LiteLibraryDto?> GetLiteLibraryDtoByIdAsync(int libraryId)
|
||||
{
|
||||
return await _context.Library
|
||||
.ProjectTo<LiteLibraryDto>(_mapper.ConfigurationProvider)
|
||||
.FirstOrDefaultAsync(l => l.Id == libraryId);
|
||||
}
|
||||
|
||||
public async Task<Library?> GetLibraryForIdAsync(int libraryId, LibraryIncludes includes = LibraryIncludes.None)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user