Normalize book progress percentage rounding (#2359)

Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
ACX
2026-01-20 09:57:59 -07:00
committed by GitHub
parent 8b61f38113
commit 9dc5110169

View File

@@ -277,21 +277,28 @@ public class BookUpdateService {
private Float updateEbookProgress(UserBookProgressEntity progress, EpubProgress epubProgress) {
if (epubProgress == null) return null;
progress.setEpubProgress(epubProgress.getCfi());
progress.setEpubProgressHref(epubProgress.getHref());
return epubProgress.getPercentage();
float percentage = epubProgress.getPercentage();
return Math.round(percentage * 10f) / 10f;
}
private Float updatePdfProgress(UserBookProgressEntity progress, PdfProgress pdfProgress) {
if (pdfProgress == null) return null;
progress.setPdfProgress(pdfProgress.getPage());
return pdfProgress.getPercentage();
float percentage = pdfProgress.getPercentage();
return Math.round(percentage * 10f) / 10f;
}
private Float updateCbxProgress(UserBookProgressEntity progress, CbxProgress cbxProgress) {
if (cbxProgress == null) return null;
progress.setCbxProgress(cbxProgress.getPage());
return cbxProgress.getPercentage();
float percentage = cbxProgress.getPercentage();
return Math.round(percentage * 10f) / 10f;
}
private void updateExistingProgress(Long userId, Set<Long> bookIds, ReadStatus status, Instant now, Instant dateFinished) {