mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Pipeline + Panels Tweaks (#2367)
This commit is contained in:
parent
8d209e8eda
commit
d7dd278582
2
.github/workflows/develop-workflow.yml
vendored
2
.github/workflows/develop-workflow.yml
vendored
@ -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 }}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user