MCPcopy Index your code
hub / github.com/diffgram/diffgram / __copy_video

Method __copy_video

walrus/methods/input/process_media.py:464–511  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

462 return True
463
464 def __copy_video(self):
465
466 logger.debug(f"Copying Video {self.input.file_id}")
467
468 self.input.newly_copied_file = File.copy_file_from_existing(
469 session = self.session,
470 working_dir = self.input.directory,
471 orginal_directory_id = self.input.source_directory_id,
472 existing_file = self.input.file,
473 copy_instance_list = False,
474 log = self.input.update_log,
475 add_link = True,
476 remove_link = False,
477 flush_session = True,
478 defer_copy = False,
479 batch_id = self.input.batch_id
480 )
481
482 if self.input.copy_instance_list is False:
483 # For declaring success on the video file when no frames are available (i.e no instances)
484 self.declare_success(input = self.input)
485 return
486
487 global New_video # important
488 from methods.video.video import New_video
489
490 # COPY INSTANCES, Sequences, and Frames
491 new_video = New_video(
492 session = self.session,
493 project = self.project,
494 input = self.input
495 )
496 new_video.add_sequence_map_to_input(
497 source_video_parent_file = self.input.file,
498 destination_video_parent_file_id = self.input.newly_copied_file.id)
499
500 # We commit session to ensure that when pushing the frames to queue below (that will be on multiple threads)
501 # they have access to the Sequences ID's on the DB.
502 self.try_to_commit()
503
504 # Push all the frames to the Queue
505 frames_list = new_video.push_frames_for_copy_to_queue(
506 source_video_parent_file_id = self.input.file_id,
507 destination_video_parent_file_id = self.input.newly_copied_file.id)
508
509 if len(frames_list) == 0:
510 # For declaring success on the video file when no frames are available (i.e no instances)
511 self.declare_success(input = self.input)
512
513 def __copy_frame(self):
514

Callers 1

__start_copy_fileMethod · 0.95

Calls 6

declare_successMethod · 0.95
try_to_commitMethod · 0.95
New_videoClass · 0.90

Tested by

no test coverage detected