From 455e34113ef6b4bcfea6065835a6fe9d7cc86bd8 Mon Sep 17 00:00:00 2001 From: ClosedPort22 <44864697+ClosedPort22@users.noreply.github.com> Date: Fri, 21 Oct 2022 21:56:40 +0800 Subject: [PATCH] Improve compatibility of DownloadArchive (#3078) Other programs can add additional columns to the table without affecting gallery-dl --- gallery_dl/util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gallery_dl/util.py b/gallery_dl/util.py index 1650b0a3..98b6d590 100644 --- a/gallery_dl/util.py +++ b/gallery_dl/util.py @@ -790,11 +790,11 @@ class DownloadArchive(): try: self.cursor.execute("CREATE TABLE IF NOT EXISTS archive " - "(entry PRIMARY KEY) WITHOUT ROWID") + "(entry TEXT PRIMARY KEY) WITHOUT ROWID") except sqlite3.OperationalError: # fallback for missing WITHOUT ROWID support (#553) self.cursor.execute("CREATE TABLE IF NOT EXISTS archive " - "(entry PRIMARY KEY)") + "(entry TEXT PRIMARY KEY)") def check(self, kwdict): """Return True if the item described by 'kwdict' exists in archive""" @@ -807,4 +807,4 @@ class DownloadArchive(): """Add item described by 'kwdict' to archive""" key = kwdict.get(self._cache_key) or self.keygen(kwdict) self.cursor.execute( - "INSERT OR IGNORE INTO archive VALUES (?)", (key,)) + "INSERT OR IGNORE INTO archive (entry) VALUES (?)", (key,))