don't save Local source chapters into disk again!

This commit is contained in:
Aria Moradi
2021-09-18 14:53:59 +04:30
parent d83ddea323
commit 531d148718
2 changed files with 26 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ package suwayomi.tachidesk.manga.impl
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import eu.kanade.tachiyomi.source.LocalSource
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.online.HttpSource
import org.jetbrains.exposed.sql.and
@@ -68,6 +69,13 @@ object Page {
}
}
// don't cache images for Local Source
if (mangaEntry[MangaTable.sourceReference] == LocalSource.ID) {
return CachedImageResponse.getImageResponse {
source.fetchImage(tachiyomiPage).awaitSingle()
}
}
val chapterDir = getChapterDir(mangaId, chapterId)
File(chapterDir).mkdirs()
val fileName = getPageName(index, chapterDir) // e.g. 001