Rescan corrupted albums.
This commit is contained in:
parent
7e48878a81
commit
271afa6611
@ -23,13 +23,17 @@ class TreeWalker:
|
|||||||
cached_album = None
|
cached_album = None
|
||||||
if os.path.exists(cache):
|
if os.path.exists(cache):
|
||||||
print "Has cache %s" % path
|
print "Has cache %s" % path
|
||||||
cached_album = Album.from_cache(cache)
|
try:
|
||||||
if file_mtime(path) <= file_mtime(cache):
|
cached_album = Album.from_cache(cache)
|
||||||
print "Album is fully cached"
|
if file_mtime(path) <= file_mtime(cache):
|
||||||
cached = True
|
print "Album is fully cached"
|
||||||
album = cached_album
|
cached = True
|
||||||
for photo in album.photos:
|
album = cached_album
|
||||||
self.all_photos.append(photo)
|
for photo in album.photos:
|
||||||
|
self.all_photos.append(photo)
|
||||||
|
except:
|
||||||
|
print "Cache is corrupted. Rescanning album."
|
||||||
|
cached_album = None
|
||||||
if not cached:
|
if not cached:
|
||||||
album = Album(path)
|
album = Album(path)
|
||||||
for entry in os.listdir(path):
|
for entry in os.listdir(path):
|
||||||
|
Loading…
Reference in New Issue
Block a user