Skip to content

Commit 847e0af

Browse files
committed
fix error with items that are already large images
1 parent 9b3b067 commit 847e0af

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

server/dive_tasks/tasks.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ def convert_images(self: Task, folderId, user_id: str, user_login: str):
648648
command = ["ffmpeg", "-i", str(item_path), str(new_item_path)]
649649
utils.stream_subprocess(self, context, manager, {'args': command})
650650
gc.uploadFileToFolder(folderId, new_item_path)
651-
gc.delete(f"item/{item['_id']}")
651+
gc.delete(f"item/{str(item['_id'])}")
652652

653653
gc.addMetadataToFolder(
654654
str(folderId),
@@ -677,7 +677,12 @@ def convert_large_images(self: Task, folderId, user_id: str, user_login: str):
677677
]
678678
for item in items_to_convert:
679679
# Assumes 1 file per item
680-
gc.post(f'item/{item["_id"]}/tiles')
680+
try:
681+
gc.get(f'item/{str(item["_id"])}/tiles')
682+
manager.write(f'Skipping {item["name"]}, already a large image\n')
683+
continue
684+
except Exception:
685+
gc.post(f'item/{str(item["_id"])}/tiles')
681686
gc.addMetadataToFolder(
682687
str(folderId),
683688
{"type": constants.LargeImageType}, # mark the parent folder as able to annotate.

0 commit comments

Comments
 (0)