diff --git a/tabs/video_remixer_ui.py b/tabs/video_remixer_ui.py index 58c5f995..dc4cfe88 100644 --- a/tabs/video_remixer_ui.py +++ b/tabs/video_remixer_ui.py @@ -1802,10 +1802,12 @@ def next_button1(self, format_markdown(f"Crop values should be <= Resize values", "warning"),\ *empty_args - if crop_offset_x < -1 or crop_offset_x > crop_w - 1 or \ - crop_offset_y < -1 or crop_offset_y > crop_h - 1: + if crop_offset_x < -1 or \ + crop_offset_x > resize_w - crop_w or \ + crop_offset_y < -1 or \ + crop_offset_y > resize_h - crop_h: return gr.update(selected=self.TAB_REMIX_SETTINGS), \ - format_markdown(f"Crop Offset values should be >= -1 and less than Crop values", + format_markdown(f"Crop Offset values should be >= -1 and <= (Resize - Crop)", "warning"),\ *empty_args @@ -2445,6 +2447,11 @@ def _next_button5(self, scene_files = get_files(self.state.clips_path) if scene_files: try: + scene_filenames = [] + for scene_file in scene_files: + _, filename, ext = split_filepath(scene_file) + scene_filenames.append(filename + ext) + self.state.purge_files(self.state.project_path, scene_filenames) move_files(self.state.clips_path, self.state.project_path) for file in scene_files: messages.append(f"Scene video {file} moved to {self.state.project_path}") diff --git a/video_remixer.py b/video_remixer.py index a86029cd..c7f83a2d 100644 --- a/video_remixer.py +++ b/video_remixer.py @@ -478,6 +478,12 @@ def delete_path(self, path): else: return None + def purge_files(self, path : str, files : list, purged_path=None, additional_path=""): + if not path or not files: + return None + file_paths = [os.path.join(path, filename) for filename in files] + return self.purge_paths(file_paths, purged_path, False, additional_path) + def purge_paths(self, path_list : list, keep_original=False, purged_path=None, skip_empty_paths=False, additional_path=""): """Purge a list of paths to the purged content directory