hahaa
This commit is contained in:
35
gui_app.py
35
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:
|
||||
|
||||
Reference in New Issue
Block a user