Koreader Progress Sync for all files (#4323)

Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
This commit is contained in:
Joe Milazzo
2026-01-04 12:17:56 -07:00
committed by GitHub
parent f4d9f5be81
commit f5d0ad2ed2
175 changed files with 1900 additions and 1435 deletions
+4 -7
View File
@@ -244,11 +244,7 @@ public class AccountController : BaseApiController
AppUser? user;
if (!string.IsNullOrEmpty(loginDto.ApiKey))
{
user = await _userManager.Users
.Include(u => u.UserPreferences)
.Include(u => u.AuthKeys)
.AsSplitQuery()
.SingleOrDefaultAsync(x => x.GetOpdsAuthKey() == loginDto.ApiKey);
user = await _unitOfWork.UserRepository.GetUserByAuthKey(loginDto.ApiKey);
}
else
{
@@ -518,7 +514,8 @@ public class AccountController : BaseApiController
}
var isAdmin = await _unitOfWork.UserRepository.IsUserAdminAsync(user);
if (!await _accountService.CanChangeAgeRestriction(user)) return BadRequest(await _localizationService.Translate(UserId, "permission-denied"));
var hasRole = await _accountService.CanChangeAgeRestriction(user);
if (!hasRole) return BadRequest(await _localizationService.Translate(UserId, "permission-denied"));
user.AgeRestriction = isAdmin ? AgeRating.NotApplicable : dto.AgeRating;
user.AgeRestrictionIncludeUnknowns = isAdmin || dto.IncludeUnknowns;
@@ -1285,7 +1282,7 @@ public class AccountController : BaseApiController
_unitOfWork.UserRepository.Delete(authKey);
await _unitOfWork.CommitAsync();
await _eventHub.SendMessageToAsync(MessageFactory.AuthKeyUpdate, MessageFactory.AuthKeyDeletedEvent(authKeyId), UserId);
await _eventHub.SendMessageToAsync(MessageFactory.AuthKeyDeleted, MessageFactory.AuthKeyDeletedEvent(authKeyId), UserId);
return Ok();
}