Add support for paginated and scrolled modes in EPUB reader

This commit is contained in:
adityachandelgit
2025-05-17 12:36:25 -06:00
committed by Aditya Chandel
parent 98a4272abf
commit 9675820052
12 changed files with 87 additions and 12 deletions
@@ -47,6 +47,7 @@ public class BookLoreUser {
private String theme;
private String font;
private int fontSize;
private String flow;
}
@@ -9,5 +9,6 @@ public class EpubViewerPreferences {
private Long bookId;
private String theme;
private String font;
private String flow;
private Integer fontSize;
}
@@ -32,4 +32,7 @@ public class EpubViewerPreferencesEntity {
@Column(name = "font_size")
private Integer fontSize;
@Column(name = "flow")
private String flow;
}
@@ -58,6 +58,7 @@ public class BooksService {
.font(epubPref.getFont())
.fontSize(epubPref.getFontSize())
.theme(epubPref.getTheme())
.flow(epubPref.getFlow())
.build()));
} else if (bookEntity.getBookType() == BookFileType.PDF) {
pdfViewerPreferencesRepository.findByBookIdAndUserId(bookId, user.getId())
@@ -107,6 +108,7 @@ public class BooksService {
epubPrefs.setFont(epubSettings.getFont());
epubPrefs.setFontSize(epubSettings.getFontSize());
epubPrefs.setTheme(epubSettings.getTheme());
epubPrefs.setFlow(epubSettings.getFlow());
epubViewerPreferencesRepository.save(epubPrefs);
} else {
@@ -218,6 +218,7 @@ public class UserProvisioningService {
.theme("white")
.font("serif")
.fontSize(150)
.flow("paginated")
.build();
}
@@ -0,0 +1,2 @@
ALTER TABLE epub_viewer_preference
ADD COLUMN flow VARCHAR(32) NULL;