diff options
| author | 2021-06-22 22:30:36 -0400 | |
|---|---|---|
| committer | 2021-06-22 22:30:36 -0400 | |
| commit | 32de2b06db501c7de81678bce8e3e0c3e63d340c (patch) | |
| tree | fd58a26618a73de0faaf3e9c435a806aed7eced3 /gallery_dl/cache.py | |
| parent | 8a644b7a06c504263a478d3681eed10b4161b5be (diff) | |
New upstream version 1.18.0.upstream/1.18.0
Diffstat (limited to 'gallery_dl/cache.py')
| -rw-r--r-- | gallery_dl/cache.py | 9 |
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() |
