diff --git a/src/all/pixiv/build.gradle b/src/all/pixiv/build.gradle index dba0fad2d..c458e4795 100644 --- a/src/all/pixiv/build.gradle +++ b/src/all/pixiv/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Pixiv' pkgNameSuffix = 'all.pixiv' extClass = '.PixivFactory' - extVersionCode = 7 + extVersionCode = 8 isNsfw = true } diff --git a/src/all/pixiv/src/eu/kanade/tachiyomi/extension/all/pixiv/Pixiv.kt b/src/all/pixiv/src/eu/kanade/tachiyomi/extension/all/pixiv/Pixiv.kt index 98a92ba10..4e3ba1667 100644 --- a/src/all/pixiv/src/eu/kanade/tachiyomi/extension/all/pixiv/Pixiv.kt +++ b/src/all/pixiv/src/eu/kanade/tachiyomi/extension/all/pixiv/Pixiv.kt @@ -298,7 +298,9 @@ class Pixiv(override val lang: String) : HttpSource() { val (id, isSeries) = parseSMangaUrl(manga.url) if (isSeries) { - val series = ApiCall("/touch/ajax/illust/series/$id").executeApi() + val series = ApiCall("/touch/ajax/illust/series/$id") + .executeApi().series!! + val illusts = getSeriesIllustsCached(id) if (series.id != null && series.userId != null) { @@ -316,7 +318,8 @@ class Pixiv(override val lang: String) : HttpSource() { val tags = illusts.flatMap { it.tags ?: emptyList() }.toSet() if (tags.isNotEmpty()) manga.genre = tags.joinToString() - (series.coverImage ?: illusts.firstOrNull()?.url)?.let { manga.thumbnail_url = it } + val coverImage = series.coverImage?.let { if (it.isString) it.content else null } + (coverImage ?: illusts.firstOrNull()?.url)?.let { manga.thumbnail_url = it } } else { val illust = getIllustCached(id) @@ -349,7 +352,7 @@ class Pixiv(override val lang: String) : HttpSource() { setUrlWithoutDomain("/artworks/${illust.id!!}") name = illust.title ?: "(null)" date_upload = (illust.upload_timestamp ?: 0) * 1000 - chapter_number = i.toFloat() + chapter_number = (illusts.size - i).toFloat() } } diff --git a/src/all/pixiv/src/eu/kanade/tachiyomi/extension/all/pixiv/PixivTypes.kt b/src/all/pixiv/src/eu/kanade/tachiyomi/extension/all/pixiv/PixivTypes.kt index 9e6bcfcb7..0c57be291 100644 --- a/src/all/pixiv/src/eu/kanade/tachiyomi/extension/all/pixiv/PixivTypes.kt +++ b/src/all/pixiv/src/eu/kanade/tachiyomi/extension/all/pixiv/PixivTypes.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi.extension.all.pixiv import kotlinx.serialization.Serializable +import kotlinx.serialization.json.JsonPrimitive @Serializable internal data class PixivApiResponse( @@ -59,10 +60,15 @@ internal data class PixivAuthorDetails( val user_name: String? = null, ) +@Serializable +internal data class PixivSeriesDetails( + val series: PixivSeries?, +) + @Serializable internal data class PixivSeries( val caption: String? = null, - val coverImage: String? = null, + val coverImage: JsonPrimitive? = null, val id: String? = null, val title: String? = null, val userId: String? = null,