[ui] ThumbnailCache: check cache dir existence before cleaning

This commit is contained in:
Loïc Vital 2023-01-06 12:47:02 +01:00
parent bfdcfb52cc
commit b372946516

View file

@ -102,6 +102,11 @@ class ThumbnailCache(QObject):
Scan the thumbnail directory and Scan the thumbnail directory and
remove all thumbnails that have not been used for more than storageTimeLimit days. remove all thumbnails that have not been used for more than storageTimeLimit days.
""" """
# Check if thumbnail directory exists
if not os.path.exists(ThumbnailCache.thumbnailDir):
logging.debug('[ThumbnailCache] Thumbnail directory does not exist yet.')
return
# Get current time # Get current time
now = time.time() now = time.time()