From 91a57cc780c3ab9ec5a34434ae2b6c26eec0f2a3 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 24 Sep 2021 16:58:48 +0700 Subject: [PATCH] fix duplication issue with download_now --- tubearchivist/home/src/helper.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tubearchivist/home/src/helper.py b/tubearchivist/home/src/helper.py index 4ea6b768..c3413525 100644 --- a/tubearchivist/home/src/helper.py +++ b/tubearchivist/home/src/helper.py @@ -146,6 +146,7 @@ class RedisQueue: def add_priority(self, to_add): """add single video to front of queue""" + self.clear_item(to_add) self.conn.execute_command("LPUSH", self.key, to_add) def get_next(self): @@ -161,6 +162,10 @@ class RedisQueue: """delete list from redis""" self.conn.execute_command("DEL", self.key) + def clear_item(self, to_clear): + """remove single item from list if it's there""" + self.conn.execute_command("LREM", self.key, 0, to_clear) + class DurationConverter: """