fix 2 issues in gallery:

- use empty string when representative is not set
- make all subdirectories
This commit is contained in:
Simon
2012-11-09 13:05:38 +01:00
parent c9f3b70e34
commit b06c381833

View File

@@ -68,7 +68,8 @@ class Gallery:
self.paths[relpath].update(get_metadata(path))
if relpath != '.':
alb_thumb = self.paths[relpath]['representative']
alb_thumb = self.paths[relpath].setdefault('representative',
'')
if (not alb_thumb) or \
(not os.path.isfile(os.path.join(path, alb_thumb))):
alb_thumb = self.find_representative(relpath)
@@ -189,4 +190,4 @@ def check_or_create_dir(path):
"Create the directory if it does not exist"
if not os.path.isdir(path):
os.mkdir(path)
os.makedirs(path)