dont fail if part has no timeline, look for timeline fallback from top

This commit is contained in:
j 2012-06-03 00:39:36 +02:00
parent eee7d1baef
commit 495a22dd97
2 changed files with 8 additions and 3 deletions

View file

@ -176,8 +176,13 @@ def join_tiles(source_paths, target_path):
cuts = [] cuts = []
offset = 0 offset = 0
for i, path in enumerate(source_paths): for i, path in enumerate(source_paths):
with open(os.path.join(path, 'cuts.json'), 'r') as f: p = os.path.join(path, 'cuts.json')
path_cuts = json.load(f) if os.path.exists(p)
with open(p, 'r') as f:
path_cuts = json.load(f)
else:
print p, 'missing'
path_cuts = []
if i > 0: if i > 0:
cuts.append(offset) cuts.append(offset)
for cut in path_cuts: for cut in path_cuts:

View file

@ -734,7 +734,7 @@ def timeline(request, id, size, position=-1, format='jpg', mode=None):
path = timeline() path = timeline()
while modes and not os.path.exists(path): while modes and not os.path.exists(path):
mode = modes.pop() mode = modes.pop(0)
path = timeline() path = timeline()
return HttpFileResponse(path, content_type='image/jpeg') return HttpFileResponse(path, content_type='image/jpeg')