mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-10 06:14:35 -05:00
Feat: Adds OPDS Chapter Filtering/Ordering (#1392)
* Adds server level configs for OPDS * PR comments * Refactor server-reference.conf (itemsPerPage range) * Coerce itemsPerPage (10, 5000) and default invalid sort orders to DESC * Coerce itemsPerPage (10, 5000) and default invalid sort orders to DESC * Change opdsChapterSortOrder type to Enum(SortOrder) * Fix serialization of SortOrderEnum & Add `opdsShowOnlyDownloadedChapters` config
This commit is contained in:
@@ -57,7 +57,10 @@ object ChapterDownloadHelper {
|
||||
chapterId: Int,
|
||||
): Pair<InputStream, Long> = provider(mangaId, chapterId).getAsArchiveStream()
|
||||
|
||||
fun getCbzForDownload(chapterId: Int): Triple<InputStream, String, Long> {
|
||||
fun getCbzForDownload(
|
||||
chapterId: Int,
|
||||
markAsRead: Boolean?,
|
||||
): Triple<InputStream, String, Long> {
|
||||
val (chapterData, mangaTitle) =
|
||||
transaction {
|
||||
val row =
|
||||
@@ -74,6 +77,17 @@ object ChapterDownloadHelper {
|
||||
|
||||
val cbzFile = provider(chapterData.mangaId, chapterData.id).getAsArchiveStream()
|
||||
|
||||
if (markAsRead == true) {
|
||||
Chapter.modifyChapter(
|
||||
chapterData.mangaId,
|
||||
chapterData.index,
|
||||
isRead = true,
|
||||
isBookmarked = null,
|
||||
markPrevRead = null,
|
||||
lastPageRead = null,
|
||||
)
|
||||
}
|
||||
|
||||
return Triple(cbzFile.first, fileName, cbzFile.second)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user