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

Method __copy_frame

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

Source from the content-addressed store, hash-verified

511 self.declare_success(input = self.input)
512
513 def __copy_frame(self):
514
515 file = File.get_by_id(self.session, self.input.file_id)
516
517 # The frame input has copies of this so we don't have to get parent
518
519 new_file = File.copy_file_from_existing(
520 session = self.session,
521 working_dir = None, # avoid detached session
522 working_dir_id = self.input.directory_id,
523 existing_file = file,
524 copy_instance_list = self.input.copy_instance_list,
525 add_link = self.input.add_link, # Not sure about making this dynamic
526 remove_link = self.input.remove_link,
527 sequence_map = self.input.sequence_map,
528 previous_video_parent_id = self.input.parent_file_id,
529 flush_session = True,
530 )
531 self.frame_completion_controller.mark_frame_complete(self.frame_number)
532 # Update Percent of parent input
533 self.video_status_updates()
534
535 # Should this be part of "declare success?
536 # Or use get_parent_with_retry()
537 if self.frame_number == self.total_frames:
538 # Perform sync operations
539 parent_input = self.input.parent_input(self.session)
540 perform_sync_events_after_file_transfer(
541 session = self.session,
542 source_directory = parent_input.source_directory,
543 destination_directory = parent_input.directory,
544 log = self.log,
545 log_sync_events = True,
546 transfer_action = 'copy',
547 file = parent_input.file,
548 member = self.member,
549 new_file = parent_input.newly_copied_file,
550 defer_sync = False,
551 sync_event_manager = None,
552 )
553
554 return new_file
555
556 def __copy_file(self):
557 logger.debug(f"Copying file type: {self.input.media_type} {self.input.file_id}")

Callers 1

__start_copy_fileMethod · 0.95

Calls 6

video_status_updatesMethod · 0.95
mark_frame_completeMethod · 0.80
parent_inputMethod · 0.80
get_by_idMethod · 0.45

Tested by

no test coverage detected