DeviantArt: Fix NullPointerException for some galleries (#6812)

Select always-present element for gallery name
This commit is contained in:
DokterKaj 2024-12-27 14:03:52 +08:00 committed by Draff
parent c3c87863b2
commit 065ff132a0
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'DeviantArt' extName = 'DeviantArt'
extClass = '.DeviantArt' extClass = '.DeviantArt'
extVersionCode = 1 extVersionCode = 2
isNsfw = true isNsfw = true
} }

View File

@ -74,7 +74,7 @@ class DeviantArt : HttpSource() {
val manga = SManga.create().apply { val manga = SManga.create().apply {
// If manga is sub-gallery then use sub-gallery name, else use gallery name // If manga is sub-gallery then use sub-gallery name, else use gallery name
title = subFolderGallery?.selectFirst("._2vMZg + ._2vMZg")?.text()?.substringBeforeLast(" ") title = subFolderGallery?.selectFirst("._2vMZg + ._2vMZg")?.text()?.substringBeforeLast(" ")
?: document.selectFirst(".ds-card-selected h2")!!.text() ?: subFolderGallery?.selectFirst("[aria-haspopup=listbox] > div")!!.ownText()
author = document.title().substringBefore(" ") author = document.title().substringBefore(" ")
description = subFolderGallery?.selectFirst(".legacy-journal")?.wholeText() description = subFolderGallery?.selectFirst(".legacy-journal")?.wholeText()
thumbnail_url = subFolderGallery?.selectFirst("img[property=contentUrl]")?.absUrl("src") thumbnail_url = subFolderGallery?.selectFirst("img[property=contentUrl]")?.absUrl("src")