Closed ghost closed 4 years ago
I'll try looking into this soon.
The key is in the api document...
If type is set to shows and you add ?extended=noseasons to the URL, it won't return season or episode info.
Thus, on the model TraktWatchedShows
if we allow seasons
to be an optional
array, this will then decode properly...
public let seasons: [TraktWatchedSeason]?
Since a season element is not returned...
Sample of json returned using .noSeasons
is below
[
{
"last_watched_at": "2020-05-05T23:54:22.000Z",
"reset_at": null,
"last_updated_at": "2020-05-05T23:57:07.000Z",
"plays": 6,
"show": {
"title": "Driven",
"year": 2020,
"ids": {
"tmdb": null,
"slug": "driven-2020",
"tvdb": 378677,
"tvrage": null,
"trakt": 159421,
"imdb": null
}
}
},
{
"last_watched_at": "2020-05-05T23:54:10.000Z",
"reset_at": null,
"last_updated_at": "2020-05-05T23:59:06.000Z",
"plays": 37,
"show": {
"title": "Street Outlaws: Memphis",
"year": 2018,
"ids": {
"tmdb": 76107,
"slug": "street-outlaws-memphis",
"tvdb": 340321,
"tvrage": null,
"trakt": 126601,
"imdb": "tt9177338"
}
}
}
]
If you would like a PR, I can submit one including a new test for this response.
Hi, I'm trying to use the method getWatchedShows with the argument ExtendedType.noSeasons like this:
And I'm getting the following error: