aboutsummaryrefslogtreecommitdiff
path: root/pl/episode_data.pl
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-04-07 21:16:20 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-04-07 21:16:20 +0200
commita58ea9929854bc9e7588c91c7d5c3c953f372627 (patch)
tree2060326b0139070c3119938836d66250d92721bd /pl/episode_data.pl
parent85add87933a1cb5a47049b87fbb224448385afae (diff)
downloadEpisodeBrowser-a58ea9929854bc9e7588c91c7d5c3c953f372627.tar.gz
Fix rate_episode.
Diffstat (limited to 'pl/episode_data.pl')
-rw-r--r--pl/episode_data.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/pl/episode_data.pl b/pl/episode_data.pl
index 557cddf..11bc22a 100644
--- a/pl/episode_data.pl
+++ b/pl/episode_data.pl
@@ -52,7 +52,11 @@ rate_episode(Ep, R) :-
dif(R, 0),
( episode_rating(Ep, R)
-> true
- ; assert_episode_rating(Ep, R)
+ ; ( episode_rating(Ep, _)
+ -> retractall_episode_rating(Ep, _)
+ ; true
+ ),
+ assert_episode_rating(Ep, R)
).
tv_original(Ep) :- episode_datum(Ep, 'Source', 'TV Original').