Fix getting next episode when current episode is the last in that season

This commit is contained in:
Stephen Byatt 2021-06-26 20:19:54 +10:00
parent bc16262b20
commit fa3f36f1fc
2 changed files with 5 additions and 2 deletions

View File

@ -715,11 +715,13 @@ class PlayerViewController: UIViewController, GCKDiscoveryManagerListener, GCKRe
}
func getNextEpisode() {
TvShowsAPI.getEpisodes(seriesId: manifest.seriesId!, userId: SessionManager.current.user.user_id!, season: manifest.parentIndexNumber ?? 0, startIndex: manifest.indexNumber, limit: 1)
TvShowsAPI.getEpisodes(seriesId: manifest.seriesId!, userId: SessionManager.current.user.user_id!, startItemId: manifest.id, limit: 2)
.sink(receiveCompletion: { completion in
print(completion)
}, receiveValue: { [self] response in
if let item = response.items?.first {
// Returns 2 items, the first is the current episode
// The second is the next episode
if let item = response.items?.last {
self.upNextViewModel.item = item
}
})

View File

@ -61,6 +61,7 @@ struct VideoUpNextView: View {
.shadow(radius: 10)
}
}
.shadow(radius: 6)
})
}