Performance Improvements (#2449)
This commit is contained in:
parent
419a827d42
commit
5ed1eebd26
34 changed files with 389 additions and 132 deletions
|
@ -17,6 +17,7 @@ public interface IGenreRepository
|
|||
void Remove(Genre genre);
|
||||
Task<Genre?> FindByNameAsync(string genreName);
|
||||
Task<IList<Genre>> GetAllGenresAsync();
|
||||
Task<IList<Genre>> GetAllGenresByNamesAsync(IEnumerable<string> normalizedNames);
|
||||
Task<IList<GenreTagDto>> GetAllGenreDtosAsync(int userId);
|
||||
Task RemoveAllGenreNoLongerAssociated(bool removeExternal = false);
|
||||
Task<IList<GenreTagDto>> GetAllGenreDtosForLibrariesAsync(IList<int> libraryIds, int userId);
|
||||
|
@ -96,6 +97,13 @@ public class GenreRepository : IGenreRepository
|
|||
return await _context.Genre.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<IList<Genre>> GetAllGenresByNamesAsync(IEnumerable<string> normalizedNames)
|
||||
{
|
||||
return await _context.Genre
|
||||
.Where(g => normalizedNames.Contains(g.NormalizedTitle))
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<IList<GenreTagDto>> GetAllGenreDtosAsync(int userId)
|
||||
{
|
||||
var ageRating = await _context.AppUser.GetUserAgeRestriction(userId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue