removed adult search results from Tmdb

This commit is contained in:
Blatzar 2022-06-15 19:47:07 +02:00
parent 00ccaf78a4
commit 573b3488a3

View file

@ -24,6 +24,8 @@ data class TmdbLink(
)
open class TmdbProvider : MainAPI() {
// This should always be false, but might as well make it easier for forks
open val includeAdult = false
// Use the LoadResponse from the metadata provider
open val useMetaLoadResponse = false
@ -319,7 +321,7 @@ open class TmdbProvider : MainAPI() {
}
override suspend fun search(query: String): List<SearchResponse>? {
return tmdb.searchService().multi(query, 1, "en-Us", "US", true).awaitResponse()
return tmdb.searchService().multi(query, 1, "en-Us", "US", includeAdult).awaitResponse()
.body()?.results?.mapNotNull {
it.movie?.toSearchResponse() ?: it.tvShow?.toSearchResponse()
}