Fix updating finished date on physical books throwing unsupported book type error (#2949)
This commit is contained in:
+10
-1
@@ -209,8 +209,15 @@ public class ReadingProgressService {
|
|||||||
progress.setBook(book);
|
progress.setBook(book);
|
||||||
progress.setLastReadTime(now);
|
progress.setLastReadTime(now);
|
||||||
|
|
||||||
Float percentage;
|
Float percentage = null;
|
||||||
|
|
||||||
|
boolean hasProgressData = request.getFileProgress() != null
|
||||||
|
|| request.getEpubProgress() != null
|
||||||
|
|| request.getPdfProgress() != null
|
||||||
|
|| request.getCbxProgress() != null
|
||||||
|
|| request.getAudiobookProgress() != null;
|
||||||
|
|
||||||
|
if (hasProgressData) {
|
||||||
if (request.getFileProgress() != null) {
|
if (request.getFileProgress() != null) {
|
||||||
BookFileProgress fileProgress = request.getFileProgress();
|
BookFileProgress fileProgress = request.getFileProgress();
|
||||||
percentage = fileProgress.progressPercent();
|
percentage = fileProgress.progressPercent();
|
||||||
@@ -239,6 +246,8 @@ public class ReadingProgressService {
|
|||||||
setProgressPercent(progress, primaryFile.getBookType(), percentage);
|
setProgressPercent(progress, primaryFile.getBookType(), percentage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (request.getDateFinished() != null) {
|
if (request.getDateFinished() != null) {
|
||||||
progress.setDateFinished(request.getDateFinished());
|
progress.setDateFinished(request.getDateFinished());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user