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 // use an integer for version numbers
version = 2 version = 3
cloudstream { cloudstream {
// All of these properties are optional, you can safely remove them // 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> 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> { fun getHomePageLists(provider: WebFlixProvider): List<HomePageList> {
val lists = mutableListOf<HomePageList>() val lists = mutableListOf<HomePageList>()
if (channels.isNotEmpty()) { if (channels.isNotEmpty()) {
@ -64,7 +68,7 @@ class WebFlixProvider(override var lang: String, override var mainUrl: String, o
} }
lists.add(channels.toHomePageList("Channels", provider)) 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) }) lists.addAll(genres.map { it.toHomePageList(provider) })
return lists return lists
} }
@ -157,7 +161,7 @@ class WebFlixProvider(override var lang: String, override var mainUrl: String, o
} }
TvType.TvSeries -> provider.newTvSeriesSearchResponse( TvType.TvSeries -> provider.newTvSeriesSearchResponse(
title, title,
"${provider.mainUrl}/api/series/by/$id/${provider.magicPath}", "${provider.mainUrl}/api/movie/by/$id/${provider.magicPath}",
TvType.TvSeries TvType.TvSeries
) { ) {
posterUrl = image posterUrl = image