From f7c648455be828c8319ccdfae962aefcb403f754 Mon Sep 17 00:00:00 2001 From: hexated Date: Sat, 25 Feb 2023 20:48:30 +0700 Subject: [PATCH] loklok: added actors --- Loklok/build.gradle.kts | 2 +- Loklok/src/main/kotlin/com/hexated/Loklok.kt | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Loklok/build.gradle.kts b/Loklok/build.gradle.kts index 6541e685..3c1297c7 100644 --- a/Loklok/build.gradle.kts +++ b/Loklok/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 17 +version = 18 cloudstream { diff --git a/Loklok/src/main/kotlin/com/hexated/Loklok.kt b/Loklok/src/main/kotlin/com/hexated/Loklok.kt index 724f6f55..f73b7f60 100644 --- a/Loklok/src/main/kotlin/com/hexated/Loklok.kt +++ b/Loklok/src/main/kotlin/com/hexated/Loklok.kt @@ -2,6 +2,7 @@ package com.hexated import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.* +import com.lagradost.cloudstream3.LoadResponse.Companion.addActors import com.lagradost.cloudstream3.LoadResponse.Companion.addAniListId import com.lagradost.cloudstream3.LoadResponse.Companion.addMalId import com.lagradost.cloudstream3.utils.* @@ -133,6 +134,12 @@ class Loklok : MainAPI() { headers["deviceid"] = getDevideId() + val actors = res.starList?.mapNotNull { + Actor( + it.localName ?: return@mapNotNull null, it.image + ) + } + val episodes = res.episodeVo?.map { eps -> val definition = eps.definitionList?.map { Definition( @@ -193,6 +200,7 @@ class Loklok : MainAPI() { this.plot = res.introduction this.tags = res.tagNameList this.rating = res.score.toRatingInt() + addActors(actors) addMalId(malId) addAniListId(anilistId?.toIntOrNull()) this.recommendations = recommendations @@ -369,6 +377,11 @@ class Loklok : MainAPI() { @JsonProperty("name") val name: String? = null, ) + data class StarList( + @JsonProperty("image") val image: String? = null, + @JsonProperty("localName") val localName: String? = null, + ) + data class MediaDetail( @JsonProperty("name") val name: String? = null, @JsonProperty("introduction") val introduction: String? = null, @@ -377,6 +390,7 @@ class Loklok : MainAPI() { @JsonProperty("coverVerticalUrl") val coverVerticalUrl: String? = null, @JsonProperty("coverHorizontalUrl") val coverHorizontalUrl: String? = null, @JsonProperty("score") val score: String? = null, + @JsonProperty("starList") val starList: ArrayList? = arrayListOf(), @JsonProperty("areaList") val areaList: ArrayList? = arrayListOf(), @JsonProperty("episodeVo") val episodeVo: ArrayList? = arrayListOf(), @JsonProperty("likeList") val likeList: ArrayList? = arrayListOf(),