mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 18:53:21 +01:00
Improve compatibility of DownloadArchive (#3078)
Other programs can add additional columns to the table without affecting gallery-dl
This commit is contained in:
parent
300bc03deb
commit
455e34113e
@ -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,))
|
||||
|
Loading…
Reference in New Issue
Block a user