From 85352da28a2e46e84d55d38a0e8dd6f8acd3f222 Mon Sep 17 00:00:00 2001 From: hexated Date: Sat, 8 Oct 2022 00:32:11 +0700 Subject: [PATCH] added Anime Type in Loklok --- Loklok/build.gradle.kts | 2 +- Loklok/src/main/kotlin/com/hexated/Loklok.kt | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Loklok/build.gradle.kts b/Loklok/build.gradle.kts index 73838069..b3f25cdc 100644 --- a/Loklok/build.gradle.kts +++ b/Loklok/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 7 +version = 8 cloudstream { diff --git a/Loklok/src/main/kotlin/com/hexated/Loklok.kt b/Loklok/src/main/kotlin/com/hexated/Loklok.kt index a57d9d61..3adefe45 100644 --- a/Loklok/src/main/kotlin/com/hexated/Loklok.kt +++ b/Loklok/src/main/kotlin/com/hexated/Loklok.kt @@ -136,10 +136,22 @@ class Loklok : MainAPI() { rec.toSearchResponse() } + val type = when { + data.category == 0 -> { + TvType.Movie + } + data.category != 0 && res.tagNameList?.contains("Anime") == true -> { + TvType.Anime + } + else -> { + TvType.TvSeries + } + } + return newTvSeriesLoadResponse( res.name ?: return null, url, - if (data.category == 0) TvType.Movie else TvType.TvSeries, + type, episodes ) { this.posterUrl = res.coverVerticalUrl