mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 11:24:35 -05:00
Add support for opds-pse for undownloaded chapters (#1278)
* Add OPDS page streaming for undownloaded chapters * Add [D] in chapter title prefix when isDownloaded * Removed Chapter.isDownloaded check in query for other opds endpoints * Add chapter progression tracking for streaming and refactor code * dd ❌ Unicode for chapters with 0 pages [post pageRefresh] * Add Library Updates feed and remove redundant metadata fetching for OPDS chapters and manga * Address PR comments & add chapter markAsRead for cbzDownload * Address PR comment/s * Rem. markAsRead for chapter download * Rem. markAsRead for chapter download --------- Co-authored-by: ShowY <showypro@gmail.com>
This commit is contained in:
@@ -278,6 +278,31 @@ object OpdsV1Controller {
|
||||
},
|
||||
)
|
||||
|
||||
var chapterMetadataFeed =
|
||||
handler(
|
||||
pathParam<Int>("mangaId"),
|
||||
pathParam<Int>("chapterId"),
|
||||
documentWith = {
|
||||
withOperation {
|
||||
summary("OPDS Chapter Details Feed")
|
||||
description("OPDS feed for a specific undownloaded chapter of a manga")
|
||||
}
|
||||
},
|
||||
behaviorOf = { ctx, mangaId, chapterId ->
|
||||
ctx.future {
|
||||
future {
|
||||
Opds.getChapterMetadataFeed(mangaId, chapterId, BASE_URL)
|
||||
}.thenApply { xml ->
|
||||
ctx.contentType(OPDS_MIME).result(xml)
|
||||
}
|
||||
}
|
||||
},
|
||||
withResults = {
|
||||
httpCode(HttpStatus.OK)
|
||||
httpCode(HttpStatus.NOT_FOUND)
|
||||
},
|
||||
)
|
||||
|
||||
// Specific Source Feed
|
||||
val sourceFeed =
|
||||
handler(
|
||||
@@ -407,4 +432,28 @@ object OpdsV1Controller {
|
||||
httpCode(HttpStatus.NOT_FOUND)
|
||||
},
|
||||
)
|
||||
|
||||
// Main Library Updates Feed
|
||||
val libraryUpdatesFeed =
|
||||
handler(
|
||||
queryParam<Int?>("pageNumber"),
|
||||
documentWith = {
|
||||
withOperation {
|
||||
summary("OPDS Library Updates Feed")
|
||||
description("OPDS feed listing recent manga chapter updates")
|
||||
}
|
||||
},
|
||||
behaviorOf = { ctx, pageNumber ->
|
||||
ctx.future {
|
||||
future {
|
||||
Opds.getLibraryUpdatesFeed(BASE_URL, pageNumber ?: 1)
|
||||
}.thenApply { xml ->
|
||||
ctx.contentType(OPDS_MIME).result(xml)
|
||||
}
|
||||
}
|
||||
},
|
||||
withResults = {
|
||||
httpCode(HttpStatus.OK)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user