mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-10 14:24:34 -05:00
Handle too long page image urls (#1544)
Attempted fix of 3ff29aa38a might not work, because there is no guarantee that the extension supports retrieving a specific page.
This commit is contained in:
@@ -112,14 +112,11 @@ object Page {
|
||||
|
||||
if (pageEntry[PageTable.imageUrl] == null) {
|
||||
val trueImageUrl = getTrueImageUrl(tachiyomiPage, source)
|
||||
if (trueImageUrl.length <= 2048) {
|
||||
transaction {
|
||||
PageTable.update({ (PageTable.chapter eq chapterId) and (PageTable.index eq index) }) {
|
||||
it[imageUrl] = trueImageUrl
|
||||
}
|
||||
transaction {
|
||||
PageTable.update({ (PageTable.chapter eq chapterId) and (PageTable.index eq index) }) {
|
||||
it[imageUrl] = trueImageUrl
|
||||
}
|
||||
}
|
||||
tachiyomiPage.imageUrl = trueImageUrl
|
||||
}
|
||||
|
||||
val fileName = getPageName(index, chapterEntry[ChapterTable.pageCount])
|
||||
|
||||
@@ -182,13 +182,7 @@ private class ChapterForDownload(
|
||||
PageTable.batchInsert(pageList) { page ->
|
||||
this[PageTable.index] = page.index
|
||||
this[PageTable.url] = page.url
|
||||
// Only store imageUrl if it's not too long to prevent database constraint violations
|
||||
this[PageTable.imageUrl] =
|
||||
if (page.imageUrl != null && page.imageUrl!!.length <= 2048) {
|
||||
page.imageUrl
|
||||
} else {
|
||||
null
|
||||
}
|
||||
this[PageTable.imageUrl] = page.imageUrl
|
||||
this[PageTable.chapter] = chapterId
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user