fix(nextup): include completed or partially watched items in NextUp query

This commit is contained in:
Quick
2026-06-29 10:46:22 -04:00
parent 8afe783277
commit 75cf5e3b11
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -199,6 +199,7 @@ func buildListNextUpQuery(q NextUpQuery, limit int) (string, []interface{}) {
WHERE uwp2.user_id = $1
AND uwp2.profile_id = $2
AND uwp2.media_item_id = e2.content_id
AND (uwp2.completed = TRUE OR uwp2.position_seconds > 0)
)
ORDER BY e2.season_number, e2.episode_number
LIMIT 1
+1
View File
@@ -20,6 +20,7 @@ func TestBuildListNextUpQuery_PrefersRecentCompletedOverOlderPartialProgress(t *
"uwp_ip.updated_at > ce.updated_at",
"FROM user_history_hidden_items hhi",
"uwp.updated_at <= hhi.hidden_before",
"AND (uwp2.completed = TRUE OR uwp2.position_seconds > 0)",
"ORDER BY e.series_id, uwp.updated_at DESC, e.season_number DESC, e.episode_number DESC",
"LIMIT $3",
}