Skip to content

Bulk asynchronous downloader for multiple file hosts

insert or replace instead of update

Jules-WinnfieldX68052bbeddcf
diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py
index 09c419b16..8f57b15e9 100644
--- a/cyberdrop_dl/__init__.py
+++ b/cyberdrop_dl/__init__.py
@@ -1 +1 @@
-__version__ = "2.13.3"
+__version__ = "2.13.4"
diff --git a/cyberdrop_dl/utils/base_functions.py b/cyberdrop_dl/utils/base_functions.py
index 5d8048f11..eac8adcb2 100644
--- a/cyberdrop_dl/utils/base_functions.py
+++ b/cyberdrop_dl/utils/base_functions.py
@@ -87,8 +87,7 @@ async def sql_insert_file(connection: sqlite3.Connection, cursor: sqlite3.Cursor
async def sql_update_file(connection: sqlite3.Connection, cursor: sqlite3.Cursor, filename, size, completed):
- cursor.execute("""UPDATE downloads SET completed = %d WHERE
- filename = '%s' AND size = %d""" % (completed, filename, size))
+ cursor.execute("""INSERT OR REPLACE INTO downloads VALUES ('%s', %d, %d)""" % (filename, size, completed))
connection.commit()
diff --git a/cyberdrop_dl/utils/downloaders.py b/cyberdrop_dl/utils/downloaders.py
index 51feb916c..d851bf52c 100644
--- a/cyberdrop_dl/utils/downloaders.py
+++ b/cyberdrop_dl/utils/downloaders.py
@@ -135,8 +135,6 @@ class Downloader:
logging.debug("Skipping " + filename)
return
-
-
resume_point = 0
complete_file = (self.folder / self.title / filename)
temp_file = complete_file.with_suffix(complete_file.suffix + '.part')