Caution, for video we are assuming this is the "parent_input" we bounce between self.input and input It's possible for this to be called multiple times? So if it's already success just return
(
self,
input: Input)
| 1321 | return parent_input |
| 1322 | |
| 1323 | def declare_success( |
| 1324 | self, |
| 1325 | input: Input): |
| 1326 | """ |
| 1327 | Caution, for video we are assuming this is the "parent_input" |
| 1328 | we bounce between self.input and input |
| 1329 | |
| 1330 | It's possible for this to be called multiple times? |
| 1331 | So if it's already success just return |
| 1332 | """ |
| 1333 | |
| 1334 | if input.status == "success": |
| 1335 | return |
| 1336 | if input.file_id is None and input.file is not None: |
| 1337 | input.file_id = input.file.id |
| 1338 | |
| 1339 | logger.debug(f'Success Processing Input: {input.id} {input.mode} - {input.type}') |
| 1340 | Event.new_deferred( |
| 1341 | session = self.session, |
| 1342 | kind = 'input_file_uploaded', |
| 1343 | project_id = input.project_id, |
| 1344 | directory_id = input.directory_id, |
| 1345 | input_id = input.id, |
| 1346 | file_id = input.file_id, |
| 1347 | wait_for_commit = True |
| 1348 | ) |
| 1349 | input.percent_complete = 100 |
| 1350 | input.status = "success" |
| 1351 | input.time_completed = datetime.datetime.utcnow() |
| 1352 | |
| 1353 | if input.batch_id is not None: |
| 1354 | input.batch.check_for_completion_and_complete(self.session) |
| 1355 | |
| 1356 | return input |
| 1357 | |
| 1358 | def update_sequences(self): |
| 1359 | """ |
no test coverage detected