Pipeline + Panels Tweaks (#2367)

This commit is contained in:
Joe Milazzo 2023-10-29 11:23:57 -05:00 committed by GitHub
parent 8d209e8eda
commit d7dd278582
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -49,7 +49,7 @@ jobs:
dotnet-version: 7.0.x dotnet-version: 7.0.x
- name: Bump versions - name: Bump versions
uses: majora2007/dotnet-bump-version@v0.0.2 uses: majora2007/dotnet-bump-version@v0.0.3
with: with:
version_files: Kavita.Common/Kavita.Common.csproj version_files: Kavita.Common/Kavita.Common.csproj
github_token: ${{ secrets.REPO_GHA_PAT }} github_token: ${{ secrets.REPO_GHA_PAT }}

View File

@ -44,12 +44,19 @@ public class PanelsController : BaseApiController
/// <param name="apiKey"></param> /// <param name="apiKey"></param>
/// <returns>The number of pages read, 0 if none read</returns> /// <returns>The number of pages read, 0 if none read</returns>
[HttpGet("get-progress")] [HttpGet("get-progress")]
public async Task<ActionResult<int>> GetProgress(int chapterId, [FromQuery] string apiKey) public async Task<ActionResult<ProgressDto>> GetProgress(int chapterId, [FromQuery] string apiKey)
{ {
if (string.IsNullOrEmpty(apiKey)) return Unauthorized("ApiKey is required"); if (string.IsNullOrEmpty(apiKey)) return Unauthorized("ApiKey is required");
var userId = await _unitOfWork.UserRepository.GetUserIdByApiKeyAsync(apiKey); var userId = await _unitOfWork.UserRepository.GetUserIdByApiKeyAsync(apiKey);
var progress = await _unitOfWork.AppUserProgressRepository.GetUserProgressDtoAsync(chapterId, userId); var progress = await _unitOfWork.AppUserProgressRepository.GetUserProgressDtoAsync(chapterId, userId);
return Ok(progress?.PageNum ?? 0); if (progress == null) return Ok(new ProgressDto()
{
PageNum = 0,
ChapterId = chapterId,
VolumeId = 0,
SeriesId = 0
});
return Ok(progress);
} }
} }