fix webflix

This commit is contained in:
Cloudburst 2022-09-25 19:15:40 +02:00 committed by GitHub
parent 28605bded7
commit b3c10b3088
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 2
version = 3
cloudstream {
// All of these properties are optional, you can safely remove them

View file

@ -55,7 +55,11 @@ class WebFlixProvider(override var lang: String, override var mainUrl: String, o
val posters: List<Entry>
)
private data class HomeResponse(val genres: List<HomeReponseGenre>, val channels: List<Entry>, val slides: List<Entry>) {
private data class HomeResponse(
val genres: List<HomeReponseGenre> = emptyList(),
val channels: List<Entry> = emptyList(),
// val slides: List<Entry> = emptyList()
) {
fun getHomePageLists(provider: WebFlixProvider): List<HomePageList> {
val lists = mutableListOf<HomePageList>()
if (channels.isNotEmpty()) {
@ -64,7 +68,7 @@ class WebFlixProvider(override var lang: String, override var mainUrl: String, o
}
lists.add(channels.toHomePageList("Channels", provider))
}
if (slides.isNotEmpty()) lists.add(slides.toHomePageList("Slides", provider))
//if (slides.isNotEmpty()) lists.add(slides.toHomePageList("Slides", provider))
lists.addAll(genres.map { it.toHomePageList(provider) })
return lists
}
@ -157,7 +161,7 @@ class WebFlixProvider(override var lang: String, override var mainUrl: String, o
}
TvType.TvSeries -> provider.newTvSeriesSearchResponse(
title,
"${provider.mainUrl}/api/series/by/$id/${provider.magicPath}",
"${provider.mainUrl}/api/movie/by/$id/${provider.magicPath}",
TvType.TvSeries
) {
posterUrl = image