aboutsummaryrefslogtreecommitdiff
path: root/pl
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-04-23 22:59:23 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-04-23 22:59:23 +0200
commit9bc40139e57875a7e2d6c4c6a5e4e0e9a73f7539 (patch)
treeef2a1a98a16c9712e998b9a706332923ebbbc8d4 /pl
parent640db5500d4a33bf14d87d7782570d4f7e5f97cf (diff)
downloadEpisodeBrowser-9bc40139e57875a7e2d6c4c6a5e4e0e9a73f7539.tar.gz
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.
Diffstat (limited to 'pl')
-rw-r--r--pl/track_episodes.pl2
1 files changed, 1 insertions, 1 deletions
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).