snowmtl extension error fix: dynamic retrieval (#1531)
* dynamic retrieval * ktlint errors fixed * reinstated comments
This commit is contained in:
@@ -112,11 +112,14 @@ object Page {
|
|||||||
|
|
||||||
if (pageEntry[PageTable.imageUrl] == null) {
|
if (pageEntry[PageTable.imageUrl] == null) {
|
||||||
val trueImageUrl = getTrueImageUrl(tachiyomiPage, source)
|
val trueImageUrl = getTrueImageUrl(tachiyomiPage, source)
|
||||||
transaction {
|
if (trueImageUrl.length <= 2048) {
|
||||||
PageTable.update({ (PageTable.chapter eq chapterId) and (PageTable.index eq index) }) {
|
transaction {
|
||||||
it[imageUrl] = trueImageUrl
|
PageTable.update({ (PageTable.chapter eq chapterId) and (PageTable.index eq index) }) {
|
||||||
|
it[imageUrl] = trueImageUrl
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tachiyomiPage.imageUrl = trueImageUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
val fileName = getPageName(index, chapterEntry[ChapterTable.pageCount])
|
val fileName = getPageName(index, chapterEntry[ChapterTable.pageCount])
|
||||||
|
|||||||
@@ -182,7 +182,13 @@ private class ChapterForDownload(
|
|||||||
PageTable.batchInsert(pageList) { page ->
|
PageTable.batchInsert(pageList) { page ->
|
||||||
this[PageTable.index] = page.index
|
this[PageTable.index] = page.index
|
||||||
this[PageTable.url] = page.url
|
this[PageTable.url] = page.url
|
||||||
this[PageTable.imageUrl] = page.imageUrl
|
// 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.chapter] = chapterId
|
this[PageTable.chapter] = chapterId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user