Dashboard Customization Polish (#2295)

This commit is contained in:
Joe Milazzo 2023-09-30 12:33:16 -06:00 committed by GitHub
parent 25e759d301
commit 25ffb2ffe1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 255 additions and 258 deletions

View file

@ -51,7 +51,6 @@ public interface ILibraryRepository
Task<bool> DoAnySeriesFoldersMatch(IEnumerable<string> folders);
Task<string?> GetLibraryCoverImageAsync(int libraryId);
Task<IList<string>> GetAllCoverImagesAsync();
Task<IDictionary<int, LibraryType>> GetLibraryTypesForIdsAsync(IEnumerable<int> libraryIds);
Task<IList<Library>> GetAllWithCoversInDifferentEncoding(EncodeFormat encodeFormat);
Task<bool> GetAllowsScrobblingBySeriesId(int seriesId);
}
@ -346,28 +345,6 @@ public class LibraryRepository : ILibraryRepository
.ToListAsync())!;
}
public async Task<IDictionary<int, LibraryType>> GetLibraryTypesForIdsAsync(IEnumerable<int> libraryIds)
{
var types = await _context.Library
.Where(l => libraryIds.Contains(l.Id))
.AsNoTracking()
.Select(l => new
{
LibraryId = l.Id,
LibraryType = l.Type
})
.ToListAsync();
var dict = new Dictionary<int, LibraryType>();
foreach (var type in types)
{
dict.TryAdd(type.LibraryId, type.LibraryType);
}
return dict;
}
public async Task<IList<Library>> GetAllWithCoversInDifferentEncoding(EncodeFormat encodeFormat)
{
var extension = encodeFormat.GetExtension();