Skip to content

Bulk asynchronous downloader for multiple file hosts

Some SQL verification

Jules-WinnfieldX0abb64ff9b44
diff --git a/cyberdrop_dl/__init__.py b/cyberdrop_dl/__init__.py
index 5ad8e5095..c6710ef75 100644
--- a/cyberdrop_dl/__init__.py
+++ b/cyberdrop_dl/__init__.py
@@ -1 +1 @@
-__version__ = "2.20.2"
+__version__ = "2.20.3"
diff --git a/cyberdrop_dl/utils/sql_helper.py b/cyberdrop_dl/utils/sql_helper.py
index 8bad94552..5c4679971 100644
--- a/cyberdrop_dl/utils/sql_helper.py
+++ b/cyberdrop_dl/utils/sql_helper.py
@@ -26,6 +26,23 @@ class SQLHelper:
);"""
self.curs.execute(create_table_query)
self.conn.commit()
+ await self.check_columns()
+
+ async def check_columns(self):
+ self.curs.execute("""SELECT COUNT(*) AS CNTREC FROM pragma_table_info('downloads') WHERE
+ name='path'""")
+ sql_check = self.curs.fetchone()[0]
+ if sql_check == (0):
+ self.curs.execute("""DROP TABLE downloads""")
+ self.conn.commit()
+ create_table_query = """CREATE TABLE IF NOT EXISTS downloads (
+ path TEXT,
+ downloaded_filename TEXT,
+ completed INTEGER NOT NULL,
+ PRIMARY KEY (path)
+ );"""
+ self.curs.execute(create_table_query)
+ self.conn.commit()
async def sql_check_existing(self, path):
if self.ignore_history: