mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-09 05:44:33 -05:00
OPDS: Offer CBZ in older mimetype (#1731)
* OPDS: Offer CBZ in older mimetype * OPDS: Include length when offering CBZ download * Disable compression on CBZ endpoint Zipping a zip * CBZ download match content type of OPDS * Move compression disable * Introduce setting for configuring CBZ mimetype * Document new option [no-ci] * Update server/src/main/kotlin/suwayomi/tachidesk/opds/impl/OpdsEntryBuilder.kt Co-authored-by: Mitchell Syer <Syer10@users.noreply.github.com> --------- Co-authored-by: Mitchell Syer <Syer10@users.noreply.github.com>
This commit is contained in:
@@ -336,6 +336,14 @@ object OpdsEntryBuilder {
|
||||
}
|
||||
|
||||
val entryTitle = "$titlePrefix ${chapter.name}"
|
||||
val cbzFileSize =
|
||||
if (chapter.downloaded) {
|
||||
withContext(Dispatchers.IO) {
|
||||
runCatching { ChapterDownloadHelper.getArchiveStreamWithSize(manga.id, chapter.id).second }.getOrNull()
|
||||
}
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
val links = mutableListOf<OpdsLinkXml>()
|
||||
chapter.url?.let {
|
||||
@@ -348,8 +356,9 @@ object OpdsEntryBuilder {
|
||||
OpdsLinkXml(
|
||||
OpdsConstants.LINK_REL_ACQUISITION_OPEN_ACCESS,
|
||||
"/api/v1/chapter/${chapter.id}/download?markAsRead=${serverConfig.opdsMarkAsReadOnDownload.value}",
|
||||
OpdsConstants.TYPE_CBZ,
|
||||
serverConfig.opdsCbzMimetype.value.mediaType,
|
||||
MR.strings.opds_linktitle_download_cbz.localized(locale),
|
||||
length = cbzFileSize,
|
||||
),
|
||||
)
|
||||
}
|
||||
@@ -411,15 +420,6 @@ object OpdsEntryBuilder {
|
||||
)
|
||||
}
|
||||
|
||||
val cbzFileSize =
|
||||
if (chapter.downloaded) {
|
||||
withContext(Dispatchers.IO) {
|
||||
runCatching { ChapterDownloadHelper.getArchiveStreamWithSize(manga.id, chapter.id).second }.getOrNull()
|
||||
}
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
return OpdsEntryXml(
|
||||
id = "urn:suwayomi:chapter:${chapter.id}:metadata$idSuffix",
|
||||
title = entryTitle,
|
||||
|
||||
Reference in New Issue
Block a user