Preserve request outcomes and align Discover shelf windows
This commit is contained in:
parent
90e956b157
commit
03ff22ea86
15 changed files with 226 additions and 92 deletions
|
|
@ -28,8 +28,10 @@ class ConductarrDiscoverOperations(
|
|||
require(title.type != "tv" || !title.seasons.isNullOrEmpty()) { "Whole-series season metadata is required" }
|
||||
val body = RequestIntentBody(
|
||||
mediaType = if (title.type == "movie") RequestIntentBody.MediaType.MOVIE else RequestIntentBody.MediaType.TV,
|
||||
recommendationProfile = intent.profile, requester = intent.requester,
|
||||
seasons = title.seasons?.map(Int::toLong), source = RequestIntentBody.Source.RECOMMENDATION, tmdbId = title.tmdb,
|
||||
recommendationProfile = intent.profile.takeIf { intent.fromRecommendation }, requester = intent.requester,
|
||||
seasons = title.seasons?.map(Int::toLong),
|
||||
source = if (intent.fromRecommendation) RequestIntentBody.Source.RECOMMENDATION else RequestIntentBody.Source.TITLE,
|
||||
tmdbId = title.tmdb,
|
||||
)
|
||||
return when (val result = client.mutate(TvRoutes.request(body))) {
|
||||
is MutationResult.Success -> result.value.outcome()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue