From a58ea9929854bc9e7588c91c7d5c3c953f372627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Thu, 7 Apr 2022 21:16:20 +0200 Subject: Fix rate_episode. --- pl/episode_data.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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'). -- cgit v1.2.3