SussyScan: Fix null pointer (#5456)

Fix nullpointer
This commit is contained in:
Chopper 2024-10-11 08:24:59 -03:00 committed by Draff
parent ca55ea1d3b
commit 76741e7ce5
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 7 additions and 3 deletions

View File

@ -3,7 +3,7 @@ ext {
extClass = '.SussyScan'
themePkg = 'madara'
baseUrl = 'https://oldi.sussytoons.com'
overrideVersionCode = 3
overrideVersionCode = 4
}
apply from: "$rootDir/common.gradle"

View File

@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.extension.pt.sussyscan
import eu.kanade.tachiyomi.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
@ -19,10 +20,13 @@ class SussyScan : Madara(
override val useLoadMoreRequest = LoadMoreStrategy.Never
override val useNewChapterEndpoint = true
override val mangaDetailsSelectorAuthor = "div.manga-authors > a"
override val mangaDetailsSelectorDescription = ".manga-about.manga-info"
override val mangaDetailsSelectorTitle = "${super.mangaDetailsSelectorTitle}, span.rate-title, title"
override val mangaDetailsSelectorThumbnail = "head meta[property='og:image']"
override fun mangaDetailsParse(document: Document) = super.mangaDetailsParse(document).apply {
title = title.substringBeforeLast("")
}
override fun imageFromElement(element: Element): String? {
return super.imageFromElement(element)?.takeIf { it.isNotEmpty() }
?: element.attr("content") // Thumbnail from <head>