mirror of https://github.com/vladmandic/automatic
Fix type enforcement
parent
6f00ad4643
commit
18bfa4b031
|
|
@ -120,9 +120,9 @@ def atomically_save_image():
|
|||
if not fn.endswith('.json'):
|
||||
fn += '.json'
|
||||
entries = shared.readfile(fn, silent=True)
|
||||
idx = len(list(entries))
|
||||
if idx == 0:
|
||||
if not isinstance(entries, list):
|
||||
entries = []
|
||||
idx = len(entries)
|
||||
entry = { 'id': idx, 'filename': filename, 'time': datetime.datetime.now().isoformat(), 'info': exifinfo }
|
||||
entries.append(entry)
|
||||
shared.writefile(entries, fn, mode='w', silent=True)
|
||||
|
|
|
|||
Loading…
Reference in New Issue