aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2026-02-05 19:21:41 +0100
committerShadowghost <Ghost_of_Stone@web.de>2026-02-05 19:57:39 +0100
commit46ad25f47dbe286a97f0c45eaf98663a3105c49c (patch)
tree21d0fb59a50f9c36fa51688c523d1a2039a518a7
parent0c46004cd921aed337c5b995afe253d65c15eeb4 (diff)
Fix NextUp
-rw-r--r--Jellyfin.Server.Implementations/Item/BaseItemRepository.cs15
1 files changed, 12 insertions, 3 deletions
diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
index 76769c33e7..f31fef6a19 100644
--- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
+++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
@@ -788,14 +788,23 @@ public sealed class BaseItemRepository
})
.ToList();
- var allNextPlayedCandidates = allCandidatesWithPlayedStatus
- .Where(c => includeWatchedForRewatching)
+ // For regular NextUp: unplayed episodes
+ var allNextUpCandidates = allCandidatesWithPlayedStatus
+ .Where(c => !c.IsPlayed)
.Select(c => new { c.Id, c.SeriesPresentationUniqueKey, c.ParentIndexNumber, c.EpisodeNumber })
.ToList();
+ // For rewatching: played episodes (only used when includeWatchedForRewatching is true)
+ var allNextPlayedCandidates = includeWatchedForRewatching
+ ? allCandidatesWithPlayedStatus
+ .Where(c => c.IsPlayed)
+ .Select(c => new { c.Id, c.SeriesPresentationUniqueKey, c.ParentIndexNumber, c.EpisodeNumber })
+ .ToList()
+ : [];
+
foreach (var seriesKey in seriesKeys)
{
- var candidates = allNextPlayedCandidates
+ var candidates = allNextUpCandidates
.Where(c => c.SeriesPresentationUniqueKey == seriesKey);
if (lastWatchedInfo.TryGetValue(seriesKey, out var lwId) && lwId != Guid.Empty)