added Anime Type in Loklok

This commit is contained in:
hexated 2022-10-08 00:32:11 +07:00
parent 53fc328f26
commit 85352da28a
2 changed files with 14 additions and 2 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers // use an integer for version numbers
version = 7 version = 8
cloudstream { cloudstream {

View file

@ -136,10 +136,22 @@ class Loklok : MainAPI() {
rec.toSearchResponse() 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( return newTvSeriesLoadResponse(
res.name ?: return null, res.name ?: return null,
url, url,
if (data.category == 0) TvType.Movie else TvType.TvSeries, type,
episodes episodes
) { ) {
this.posterUrl = res.coverVerticalUrl this.posterUrl = res.coverVerticalUrl