From fa3f36f1fc0590db3bf064554035c02b1664626c Mon Sep 17 00:00:00 2001 From: Stephen Byatt <47413006+stephenb10@users.noreply.github.com> Date: Sat, 26 Jun 2021 20:19:54 +1000 Subject: [PATCH] Fix getting next episode when current episode is the last in that season --- JellyfinPlayer/VideoPlayer.swift | 6 ++++-- JellyfinPlayer/VideoUpNextView.swift | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/JellyfinPlayer/VideoPlayer.swift b/JellyfinPlayer/VideoPlayer.swift index d4c3dd26..66fdb0a6 100644 --- a/JellyfinPlayer/VideoPlayer.swift +++ b/JellyfinPlayer/VideoPlayer.swift @@ -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 } }) diff --git a/JellyfinPlayer/VideoUpNextView.swift b/JellyfinPlayer/VideoUpNextView.swift index a85be5af..0fa3f5de 100644 --- a/JellyfinPlayer/VideoUpNextView.swift +++ b/JellyfinPlayer/VideoUpNextView.swift @@ -61,6 +61,7 @@ struct VideoUpNextView: View { .shadow(radius: 10) } } + .shadow(radius: 6) }) }