From 85393c74c4b7c3b14437caa3fe16d83d5ba65b30 Mon Sep 17 00:00:00 2001 From: Mylloon <29067904+Mylloon@users.noreply.github.com> Date: Wed, 5 Jun 2024 14:27:33 +0200 Subject: [PATCH] fix: Scan VF (#3395) * fix Scan VF * increase version code * override function --- .../tachiyomi/multisrc/mmrcms/MMRCMS.kt | 2 +- src/fr/scanvf/build.gradle | 2 +- .../tachiyomi/extension/fr/scanvf/ScanVF.kt | 20 ++++++++++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib-multisrc/mmrcms/src/eu/kanade/tachiyomi/multisrc/mmrcms/MMRCMS.kt b/lib-multisrc/mmrcms/src/eu/kanade/tachiyomi/multisrc/mmrcms/MMRCMS.kt index 708b02543..50fa20e1b 100644 --- a/lib-multisrc/mmrcms/src/eu/kanade/tachiyomi/multisrc/mmrcms/MMRCMS.kt +++ b/lib-multisrc/mmrcms/src/eu/kanade/tachiyomi/multisrc/mmrcms/MMRCMS.kt @@ -208,7 +208,7 @@ constructor( override fun searchMangaNextPageSelector(): String? = ".pagination a[rel=next]" - protected fun parseSearchDirectory(page: Int): MangasPage { + protected open fun parseSearchDirectory(page: Int): MangasPage { val manga = searchDirectory.subList((page - 1) * 24, min(page * 24, searchDirectory.size)) .map { SManga.create().apply { diff --git a/src/fr/scanvf/build.gradle b/src/fr/scanvf/build.gradle index 9a3e75383..9eb14c354 100644 --- a/src/fr/scanvf/build.gradle +++ b/src/fr/scanvf/build.gradle @@ -3,7 +3,7 @@ ext { extClass = '.ScanVF' themePkg = 'mmrcms' baseUrl = 'https://www.scan-vf.net' - overrideVersionCode = 1 + overrideVersionCode = 2 } apply from: "$rootDir/common.gradle" diff --git a/src/fr/scanvf/src/eu/kanade/tachiyomi/extension/fr/scanvf/ScanVF.kt b/src/fr/scanvf/src/eu/kanade/tachiyomi/extension/fr/scanvf/ScanVF.kt index 1099b8a68..a2731d521 100644 --- a/src/fr/scanvf/src/eu/kanade/tachiyomi/extension/fr/scanvf/ScanVF.kt +++ b/src/fr/scanvf/src/eu/kanade/tachiyomi/extension/fr/scanvf/ScanVF.kt @@ -1,10 +1,28 @@ package eu.kanade.tachiyomi.extension.fr.scanvf import eu.kanade.tachiyomi.multisrc.mmrcms.MMRCMS +import eu.kanade.tachiyomi.source.model.MangasPage +import eu.kanade.tachiyomi.source.model.SManga +import kotlin.math.min class ScanVF : MMRCMS( "Scan VF", "https://www.scan-vf.net", "fr", + itemPath = "", supportsAdvancedSearch = false, -) +) { + override fun parseSearchDirectory(page: Int): MangasPage { + val manga = searchDirectory.subList((page - 1) * 24, min(page * 24, searchDirectory.size)) + .map { + SManga.create().apply { + url = "/${it.data}" + title = it.value + thumbnail_url = guessCover(url, null) + } + } + val hasNextPage = (page + 1) * 24 <= searchDirectory.size + + return MangasPage(manga, hasNextPage) + } +}