Skip to content

Commit 3e350f6

Browse files
Vaghinak BasentsyanVaghinak Basentsyan
authored andcommitted
SAS-3944 prepare export for video projects
1 parent 5a2dccb commit 3e350f6

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

superannotate/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
SPECIAL_CHARACTERS_IN_PROJECT_FOLDER_NAMES = set('/\\:*?"<>|')
2121

22-
_PROJECT_TYPES = {"Vector": 1, "Pixel": 2}
22+
_PROJECT_TYPES = {"Vector": 1, "Pixel": 2, "Video": 3}
2323

2424
_ANNOTATION_STATUSES = {
2525
"NotStarted": 1,

superannotate/db/exports.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ def prepare_export(
127127
"""
128128
if not isinstance(project, dict):
129129
project = get_project_metadata_bare(project)
130+
if project["type"] == "Video":
131+
if include_fuse or only_pinned:
132+
raise SABaseException(
133+
0,
134+
"The function does not support include fuse and pin arguments "
135+
"for projects containing videos attached with URLs"
136+
)
137+
130138
upload_state = upload_state_int_to_str(project.get("upload_state"))
131139
if upload_state == "External" and include_fuse == True:
132140
logger.info(
@@ -144,11 +152,14 @@ def prepare_export(
144152
current_time = datetime.now().strftime("%b %d %Y %H:%M")
145153
json_req = {
146154
"include": annotation_statuses,
147-
"fuse": int(include_fuse),
148-
"is_pinned": int(only_pinned),
149155
"coco": 0,
150156
"time": current_time
151157
}
158+
if project["type"] != "Video":
159+
json_req["fuse"] = int(include_fuse)
160+
json_req["is_pinned"] = int(only_pinned)
161+
json_req["coco"] = 0
162+
152163
if folder_names is not None:
153164
json_req["folder_names"] = folder_names
154165
params = {'team_id': team_id, 'project_id': project_id}

0 commit comments

Comments
 (0)