mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-09 07:10:59 +00:00
fix duplication issue with download_now
This commit is contained in:
@@ -146,6 +146,7 @@ class RedisQueue:
|
|||||||
|
|
||||||
def add_priority(self, to_add):
|
def add_priority(self, to_add):
|
||||||
"""add single video to front of queue"""
|
"""add single video to front of queue"""
|
||||||
|
self.clear_item(to_add)
|
||||||
self.conn.execute_command("LPUSH", self.key, to_add)
|
self.conn.execute_command("LPUSH", self.key, to_add)
|
||||||
|
|
||||||
def get_next(self):
|
def get_next(self):
|
||||||
@@ -161,6 +162,10 @@ class RedisQueue:
|
|||||||
"""delete list from redis"""
|
"""delete list from redis"""
|
||||||
self.conn.execute_command("DEL", self.key)
|
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:
|
class DurationConverter:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user