mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-05 14:25:17 -04:00
OPDS Performance Enhancements (#4332)
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
This commit is contained in:
@@ -126,7 +126,6 @@ public interface IUserRepository
|
||||
/// <param name="includes"></param>
|
||||
/// <returns></returns>
|
||||
Task<AppUser?> GetByOidcId(string? oidcId, AppUserIncludes includes = AppUserIncludes.None);
|
||||
|
||||
Task<AnnotationDto?> GetAnnotationDtoById(int userId, int annotationId);
|
||||
Task<List<AnnotationDto>> GetAnnotationDtosBySeries(int userId, int seriesId);
|
||||
Task UpdateUserAsActive(int userId);
|
||||
@@ -139,6 +138,7 @@ public interface IUserRepository
|
||||
Task<DateTime?> GetAuthKeyExpiration(string authKey, int userId);
|
||||
Task<AppUserSocialPreferences> GetSocialPreferencesForUser(int userId);
|
||||
Task<AppUserPreferences> GetPreferencesForUser(int userId);
|
||||
Task<AppUserOpdsPreferences> GetOpdsPreferences(int userId);
|
||||
}
|
||||
|
||||
public class UserRepository : IUserRepository
|
||||
@@ -1127,4 +1127,18 @@ public class UserRepository : IUserRepository
|
||||
.Where(p => p.AppUserId == userId)
|
||||
.FirstAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// No Tracking
|
||||
/// </summary>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<AppUserOpdsPreferences> GetOpdsPreferences(int userId)
|
||||
{
|
||||
return await _context.AppUserPreferences
|
||||
.Where(p => p.AppUserId == userId)
|
||||
.Select(p => p.OpdsPreferences)
|
||||
.AsNoTracking()
|
||||
.FirstAsync();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user