Fix return value of (photo, is_new) for digest.
This commit is contained in:
parent
bdf2ba6334
commit
4f063cd90e
1 changed files with 2 additions and 3 deletions
|
@ -1321,15 +1321,14 @@ class PDBUtilMixin:
|
||||||
otherwise create it and then return it.
|
otherwise create it and then return it.
|
||||||
'''
|
'''
|
||||||
try:
|
try:
|
||||||
photo = (self.get_photo_by_path(filepath), False)
|
return (self.get_photo_by_path(filepath), False)
|
||||||
return photo
|
|
||||||
except exceptions.NoSuchPhoto:
|
except exceptions.NoSuchPhoto:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
result = check_renamed(filepath)
|
result = check_renamed(filepath)
|
||||||
if isinstance(result, objects.Photo):
|
if isinstance(result, objects.Photo):
|
||||||
result.relocate(filepath.absolute_path)
|
result.relocate(filepath.absolute_path)
|
||||||
return result
|
return (result, False)
|
||||||
elif isinstance(result, dict) and 'sha256' in result:
|
elif isinstance(result, dict) and 'sha256' in result:
|
||||||
sha256 = result['sha256']
|
sha256 = result['sha256']
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue