Skip to content

Commit

Permalink
task: updated withGenres and withoutGenres to make use of the TmdbDis…
Browse files Browse the repository at this point in the history
…coverFilter so the separators can be configured
  • Loading branch information
P-Stringer authored and ChrisKruegerDev committed Jan 20, 2024
1 parent 3fe9848 commit 3192c40
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ sealed interface TmdbDiscover {
val voteCountGte: Int?
val voteCountLte: Int?

val withGenres: List<String>
val withoutGenres: List<String>
val withGenres: TmdbDiscoverFilter<String>?
val withoutGenres: TmdbDiscoverFilter<String>?
val withWatchProviders: TmdbDiscoverFilter<Int>?
val watchRegion: String? // ISO 3166-1 code
val withWatchMonetizationTypes: List<TmdbWatchMonetizationType>
Expand All @@ -84,12 +84,12 @@ sealed interface TmdbDiscover {
params[DiscoverParam.VOTE_COUNT_LTE] = it.toString()
}

if (withGenres.isNotEmpty()) {
params[DiscoverParam.WITH_GENRES] = withGenres.joinToString(",")
withGenres?.let{
params[DiscoverParam.WITH_GENRES] = it.items.joinToString(it.separator.value)
}

if (withoutGenres.isNotEmpty()) {
params[DiscoverParam.WITHOUT_GENRES] = withoutGenres.joinToString(",")
withoutGenres?.let {
params[DiscoverParam.WITHOUT_GENRES] = it.items.joinToString(it.separator.value)
}

withWatchProviders?.let { f ->
Expand All @@ -115,8 +115,8 @@ sealed interface TmdbDiscover {
override val voteAverageLte: Float? = null,
override val voteCountGte: Int? = null,
override val voteCountLte: Int? = null,
override val withGenres: List<String> = emptyList(),
override val withoutGenres: List<String> = emptyList(),
override val withGenres: TmdbDiscoverFilter<String>? = null,
override val withoutGenres: TmdbDiscoverFilter<String>? = null,
val releaseDate: TmdbDiscoverTimeRange? = null,
val withReleaseTypes: TmdbDiscoverFilter<TmdbReleaseType>? = null,
override val withWatchProviders: TmdbDiscoverFilter<Int>? = null,
Expand Down Expand Up @@ -164,8 +164,8 @@ sealed interface TmdbDiscover {
override val voteAverageLte: Float? = null,
override val voteCountGte: Int? = null,
override val voteCountLte: Int? = null,
override val withGenres: List<String> = emptyList(),
override val withoutGenres: List<String> = emptyList(),
override val withGenres: TmdbDiscoverFilter<String>? = null,
override val withoutGenres: TmdbDiscoverFilter<String>? = null,
val firstAirDate: TmdbDiscoverTimeRange? = null,
val airDateGte: String? = null,
val airDateLte: String? = null,
Expand Down

0 comments on commit 3192c40

Please sign in to comment.