Progress Overhaul + Profile Page and a LOT more! (#4262)

Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
This commit is contained in:
Joe Milazzo
2025-12-09 10:00:11 -07:00
committed by GitHub
parent 4ac13f1f25
commit 9f29fa593d
645 changed files with 25585 additions and 4805 deletions
+6 -7
View File
@@ -3,7 +3,6 @@ using System.Threading.Tasks;
using API.Data;
using API.Data.Repositories;
using API.DTOs;
using API.Extensions;
using API.Services;
using API.Services.Plus;
using Microsoft.AspNetCore.Mvc;
@@ -37,7 +36,7 @@ public class RatingController : BaseApiController
[HttpPost("series")]
public async Task<ActionResult> UpdateSeriesRating(UpdateRatingDto updateRating)
{
var user = await _unitOfWork.UserRepository.GetUserByIdAsync(User.GetUserId(), AppUserIncludes.Ratings | AppUserIncludes.ChapterRatings);
var user = await _unitOfWork.UserRepository.GetUserByIdAsync(UserId, AppUserIncludes.Ratings | AppUserIncludes.ChapterRatings);
if (user == null) throw new UnauthorizedAccessException();
if (await _ratingService.UpdateSeriesRating(user, updateRating))
@@ -45,7 +44,7 @@ public class RatingController : BaseApiController
return Ok();
}
return BadRequest(await _localizationService.Translate(User.GetUserId(), "generic-error"));
return BadRequest(await _localizationService.Translate(UserId, "generic-error"));
}
/// <summary>
@@ -57,7 +56,7 @@ public class RatingController : BaseApiController
[HttpPost("chapter")]
public async Task<ActionResult> UpdateChapterRating(UpdateRatingDto updateRating)
{
var user = await _unitOfWork.UserRepository.GetUserByIdAsync(User.GetUserId(), AppUserIncludes.Ratings | AppUserIncludes.ChapterRatings);
var user = await _unitOfWork.UserRepository.GetUserByIdAsync(UserId, AppUserIncludes.Ratings | AppUserIncludes.ChapterRatings);
if (user == null) throw new UnauthorizedAccessException();
if (await _ratingService.UpdateChapterRating(user, updateRating))
@@ -65,7 +64,7 @@ public class RatingController : BaseApiController
return Ok();
}
return BadRequest(await _localizationService.Translate(User.GetUserId(), "generic-error"));
return BadRequest(await _localizationService.Translate(UserId, "generic-error"));
}
/// <summary>
@@ -79,7 +78,7 @@ public class RatingController : BaseApiController
return Ok(new RatingDto()
{
Provider = ScrobbleProvider.Kavita,
AverageScore = await _unitOfWork.SeriesRepository.GetAverageUserRating(seriesId, User.GetUserId()),
AverageScore = await _unitOfWork.SeriesRepository.GetAverageUserRating(seriesId, UserId),
FavoriteCount = 0,
});
}
@@ -95,7 +94,7 @@ public class RatingController : BaseApiController
return Ok(new RatingDto()
{
Provider = ScrobbleProvider.Kavita,
AverageScore = await _unitOfWork.ChapterRepository.GetAverageUserRating(chapterId, User.GetUserId()),
AverageScore = await _unitOfWork.ChapterRepository.GetAverageUserRating(chapterId, UserId),
FavoriteCount = 0,
});
}