From ab924f66ee1d1d16c74ee27020031eec94276c00 Mon Sep 17 00:00:00 2001 From: 27942 Date: Mon, 26 Jan 2026 18:00:41 +0800 Subject: [PATCH] hahaa --- gui_app.py | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/gui_app.py b/gui_app.py index b692218..8d9e475 100644 --- a/gui_app.py +++ b/gui_app.py @@ -3769,6 +3769,10 @@ class MainWindow(QMainWindow): self.batch_pending_tasks = total_tasks video_extensions = ['.mp4', '.avi', '.mov', '.mkv', '.flv', '.wmv', '.webm'] + + # 获取用户是否勾选了"批量上传"复选框 + use_batch_upload = self.batch_upload_checkbox.isChecked() + self.log_text.append(f"批量上传模式: {'已勾选' if use_batch_upload else '未勾选'}") for user_id, items in grouped_by_user_id.items(): all_files = [] @@ -3784,8 +3788,9 @@ class MainWindow(QMainWindow): # 准备工作线程需要的配置(同一个多多ID共用基准配置) first_config = items[0].get('config', {}) - # 1. 批量视频任务 - if len(video_files) > 1: + # 根据用户是否勾选批量上传来决定处理方式 + if use_batch_upload and len(video_files) > 1: + # 勾选了批量上传且有多个视频:使用 action1 批量上传 self.batch_task_queue.append({ 'type': 'batch_video', 'config': first_config, @@ -3794,18 +3799,20 @@ class MainWindow(QMainWindow): 'count': len(video_files), 'config_indices': related_config_indices }) - elif len(video_files) == 1: - # 只有1个视频,也要找对应的 config_index - vid_index = video_files[0].get('index', '') - matching_idx = next((it['config_index'] for it in items if it['config'].get('序号') == vid_index), related_config_indices[0]) - self.batch_task_queue.append({ - 'type': 'single_video', - 'config': first_config, - 'files': video_files, - 'user_id': user_id, - 'count': 1, - 'config_indices': [matching_idx] - }) + else: + # 未勾选批量上传 或 只有1个视频:逐个使用 action 方法上传 + for video_file in video_files: + vid_index = video_file.get('index', '') + matching_idx = next((it['config_index'] for it in items if it['config'].get('序号') == vid_index), related_config_indices[0] if related_config_indices else 0) + matching_config = next((it['config'] for it in items if it['config'].get('序号') == vid_index), first_config) + self.batch_task_queue.append({ + 'type': 'single_video', + 'config': matching_config, + 'files': [video_file], + 'user_id': user_id, + 'count': 1, + 'config_indices': [matching_idx] + }) # 2. 图片文件夹任务 for img_folder in image_folders: