added Anime Type in Loklok

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

View file

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

View file

@ -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