mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-05 14:25:17 -04:00
Koreader Progress Sync for all files (#4323)
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
This commit is contained in:
@@ -88,6 +88,7 @@ public interface IUserRepository
|
||||
Task<UserDto?> GetUserDtoById(int userId);
|
||||
Task<AppUser?> GetUserByUsernameAsync(string username, AppUserIncludes includeFlags = AppUserIncludes.None);
|
||||
Task<AppUser?> GetUserByIdAsync(int userId, AppUserIncludes includeFlags = AppUserIncludes.None);
|
||||
Task<AppUser?> GetUserByAuthKey(string authKey, AppUserIncludes includeFlags = AppUserIncludes.None);
|
||||
Task<int> GetUserIdByUsernameAsync(string username);
|
||||
Task<IList<AppUserBookmark>> GetAllBookmarksByIds(IList<int> bookmarkIds);
|
||||
Task<AppUser?> GetUserByEmailAsync(string email, AppUserIncludes includes = AppUserIncludes.None);
|
||||
@@ -259,6 +260,18 @@ public class UserRepository : IUserRepository
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task<AppUser?> GetUserByAuthKey(string authKey, AppUserIncludes includeFlags = AppUserIncludes.None)
|
||||
{
|
||||
if (string.IsNullOrEmpty(authKey)) return null;
|
||||
|
||||
return await _context.AppUserAuthKey
|
||||
.Where(ak => ak.Key == authKey)
|
||||
.HasNotExpired()
|
||||
.Select(ak => ak.AppUser)
|
||||
.Includes(includeFlags)
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<AppUserBookmark>> GetAllBookmarksAsync()
|
||||
{
|
||||
return await _context.AppUserBookmark.ToListAsync();
|
||||
|
||||
Reference in New Issue
Block a user