summaryrefslogtreecommitdiffstats
path: root/gallery_dl/cache.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/cache.py')
-rw-r--r--gallery_dl/cache.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/gallery_dl/cache.py b/gallery_dl/cache.py
index 5ab68bf..7a49b61 100644
--- a/gallery_dl/cache.py
+++ b/gallery_dl/cache.py
@@ -168,7 +168,7 @@ def cache(maxage=3600, keyarg=None):
return wrap
-def clear(module="all"):
+def clear(module):
"""Delete database entries for 'module'"""
db = DatabaseCacheDecorator.db
if not db:
@@ -176,19 +176,18 @@ def clear(module="all"):
rowcount = 0
cursor = db.cursor()
- module = module.lower()
try:
- if module == "all":
+ if module == "ALL":
cursor.execute("DELETE FROM data")
else:
cursor.execute(
"DELETE FROM data "
"WHERE key LIKE 'gallery_dl.extractor.' || ? || '.%'",
- (module,)
+ (module.lower(),)
)
except sqlite3.OperationalError:
- pass # database is not initialized, can't be modified, etc.
+ pass # database not initialized, cannot be modified, etc.
else:
rowcount = cursor.rowcount
db.commit()