diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Library.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Library.kt index 9d5f60aa..9b047e72 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Library.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Library.kt @@ -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.local.LocalSource import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob @@ -75,6 +76,19 @@ object Library { inLibrary: Boolean, ) { scope.launch { + val sourceId = + transaction { + MangaTable + .select(MangaTable.sourceReference) + .where { MangaTable.id eq mangaId } + .first() + .get(MangaTable.sourceReference) + } + + if (sourceId == LocalSource.ID) { + return@launch + } + try { if (inLibrary) { ThumbnailDownloadHelper.download(mangaId) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/MangaList.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/MangaList.kt index 6ef5ad10..bdc66ea6 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/MangaList.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/MangaList.kt @@ -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.local.LocalSource import eu.kanade.tachiyomi.source.model.MangasPage import org.jetbrains.exposed.dao.id.EntityID import org.jetbrains.exposed.sql.and @@ -83,7 +84,7 @@ object MangaList { .mapNotNull { sManga -> existingMangaUrlsToId[sManga.url]?.let { sManga to it } }.filterNot { (_, resultRow) -> - resultRow[MangaTable.inLibrary] + resultRow[MangaTable.inLibrary] && resultRow[MangaTable.sourceReference] != LocalSource.ID } if (mangaToUpdate.isNotEmpty()) {