From 9bc40139e57875a7e2d6c4c6a5e4e0e9a73f7539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 23 Apr 2022 22:59:23 +0200 Subject: Fix most_recently_watched/1. The previous version finds the episode with the highest number among all watched episodes. This version finds the episode that was most recently marked as watched, regardless of its number. --- pl/track_episodes.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pl/track_episodes.pl b/pl/track_episodes.pl index ec1785b..f18e85c 100644 --- a/pl/track_episodes.pl +++ b/pl/track_episodes.pl @@ -90,7 +90,7 @@ toggle_episode(Ep) :- most_recently_watched(Ep) :- findall(N, episode_watched(N, true), All), - sort(0, @>, All, [Ep|_]). + last(All, Ep). watched(Ep) :- episode_watched(Ep, true). -- cgit v1.2.3