Skip to content

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.

Supress max page error on bookmark api and just adjust the pages for the user. (#445)

Joseph Milazzo55dd9e7f1e91
diff --git a/API/Controllers/ReaderController.cs b/API/Controllers/ReaderController.cs
index 2e0bc0e9d..5a10676d1 100644
--- a/API/Controllers/ReaderController.cs
+++ b/API/Controllers/ReaderController.cs
@@ -241,17 +241,18 @@ namespace API.Controllers
var chapter = await _unitOfWork.VolumeRepository.GetChapterAsync(bookmarkDto.ChapterId);
if (bookmarkDto.PageNum > chapter.Pages)
{
- return BadRequest("Can't bookmark past max pages");
+ bookmarkDto.PageNum = chapter.Pages;
}
if (bookmarkDto.PageNum < 0)
{
- return BadRequest("Can't bookmark less than 0");
+ bookmarkDto.PageNum = 0;
}
try
{
+ // TODO: Look into creating a progress entry when a new item is added to the DB so we can just look it up and modify it
user.Progresses ??= new List<AppUserProgress>();
var userProgress =
user.Progresses.SingleOrDefault(x => x.ChapterId == bookmarkDto.ChapterId && x.AppUserId == user.Id);
diff --git a/Kavita.Common/Kavita.Common.csproj b/Kavita.Common/Kavita.Common.csproj
index 02613b335..b4bc5f86a 100644
--- a/Kavita.Common/Kavita.Common.csproj
+++ b/Kavita.Common/Kavita.Common.csproj
@@ -4,7 +4,7 @@
<TargetFramework>net5.0</TargetFramework>
<Company>kavitareader.com</Company>
<Product>Kavita</Product>
- <AssemblyVersion>0.4.3.5</AssemblyVersion>
+ <AssemblyVersion>0.4.3.6</AssemblyVersion>
<NeutralLanguage>en</NeutralLanguage>
</PropertyGroup>