From d587217d0bc78472d2d4249c3087831679011d9e Mon Sep 17 00:00:00 2001 From: hexated Date: Mon, 9 Jan 2023 20:56:23 +0700 Subject: [PATCH] [Loklok] fixed tracker --- Loklok/build.gradle.kts | 2 +- Loklok/src/main/kotlin/com/hexated/Loklok.kt | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Loklok/build.gradle.kts b/Loklok/build.gradle.kts index 22b3816b..46035769 100644 --- a/Loklok/build.gradle.kts +++ b/Loklok/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 12 +version = 13 cloudstream { diff --git a/Loklok/src/main/kotlin/com/hexated/Loklok.kt b/Loklok/src/main/kotlin/com/hexated/Loklok.kt index 12fe1451..9ca5d73e 100644 --- a/Loklok/src/main/kotlin/com/hexated/Loklok.kt +++ b/Loklok/src/main/kotlin/com/hexated/Loklok.kt @@ -163,12 +163,12 @@ class Loklok : MainAPI() { } val type = when { + res.areaList?.firstOrNull()?.id == 44 && res.tagNameList?.contains("Anime") == true -> { + TvType.Anime + } data.category == 0 -> { TvType.Movie } - data.category != 0 && res.tagNameList?.contains("Anime") == true -> { - TvType.Anime - } else -> { TvType.TvSeries } @@ -177,7 +177,7 @@ class Loklok : MainAPI() { val animeType = if(type == TvType.Anime && data.category == 0) "movie" else "tv" val malId = if(type == TvType.Anime) { - app.get("${jikanAPI}/anime?q=${res.name}&start_date=${res.year}&type=$animeType&order_by=start_date&limit=1") + app.get("${jikanAPI}/anime?q=${res.name}&start_date=${res.year}&type=$animeType") .parsedSafe()?.data?.firstOrNull()?.mal_id } else { null @@ -195,7 +195,7 @@ class Loklok : MainAPI() { return newTvSeriesLoadResponse( res.name ?: return null, url, - type, + if(data.category == 0) TvType.Movie else type, episodes ) { this.posterUrl = res.coverVerticalUrl @@ -330,6 +330,11 @@ class Loklok : MainAPI() { @JsonProperty("subtitlingList") val subtitlingList: ArrayList? = arrayListOf(), ) + data class Region( + @JsonProperty("id") val id: Int? = null, + @JsonProperty("name") val name: String? = null, + ) + data class MediaDetail( @JsonProperty("name") val name: String? = null, @JsonProperty("introduction") val introduction: String? = null, @@ -338,6 +343,7 @@ class Loklok : MainAPI() { @JsonProperty("coverVerticalUrl") val coverVerticalUrl: String? = null, @JsonProperty("coverHorizontalUrl") val coverHorizontalUrl: String? = null, @JsonProperty("score") val score: String? = null, + @JsonProperty("areaList") val areaList: ArrayList? = arrayListOf(), @JsonProperty("episodeVo") val episodeVo: ArrayList? = arrayListOf(), @JsonProperty("likeList") val likeList: ArrayList? = arrayListOf(), @JsonProperty("tagNameList") val tagNameList: ArrayList? = arrayListOf(),