diff --git a/app/core/record_manager.py b/app/core/record_manager.py index 89f070c..1809e52 100644 --- a/app/core/record_manager.py +++ b/app/core/record_manager.py @@ -28,7 +28,8 @@ class RecordingManager: self._ = {} self.load() self.initialize_dynamic_state() - self.platform_semaphores = defaultdict(lambda: asyncio.Semaphore(3)) + max_concurrent = int(self.settings.user_config.get("platform_max_concurrent_requests", 3)) + self.platform_semaphores = defaultdict(lambda: asyncio.Semaphore(max_concurrent)) @property def recordings(self): diff --git a/app/ui/views/settings_view.py b/app/ui/views/settings_view.py index 0d7b6fa..3b10f79 100644 --- a/app/ui/views/settings_view.py +++ b/app/ui/views/settings_view.py @@ -443,6 +443,16 @@ class SettingsPage(PageBase): on_change=self.on_change, ), ), + self.create_setting_row( + self._["platform_max_concurrent_requests"], + ft.TextField( + value=str(self.get_config_value("platform_max_concurrent_requests", 3)), + width=100, + data="platform_max_concurrent_requests", + on_change=self.on_change, + hint_text=self._["platform_max_concurrent_requests_tip"] + ), + ), ], is_mobile, ), diff --git a/config/default_settings.json b/config/default_settings.json index 8f463a5..35a2944 100644 --- a/config/default_settings.json +++ b/config/default_settings.json @@ -60,5 +60,6 @@ "recipient_email": "", "theme_color": "blue", "is_grid_view": true, - "theme_mode": "light" + "theme_mode": "light", + "platform_max_concurrent_requests": "3" } \ No newline at end of file diff --git a/locales/en.json b/locales/en.json index 131e6eb..f38ea25 100644 --- a/locales/en.json +++ b/locales/en.json @@ -353,7 +353,9 @@ "switch_video_format": "Switch video recording format", "switch_recording_quality": "Switch video recording quality", "switch_account_type": "Switch account type", - "switch_language_tip": "Tip: It is recommended to restart the program after switching languages" + "switch_language_tip": "Tip: It is recommended to restart the program after switching languages", + "platform_max_concurrent_requests": "Max concurrent recordings per platform", + "platform_max_concurrent_requests_tip": "The maximum number of concurrent requests allowed per platform. Default is 3." }, "about_page": { "about_project": "About This Application", diff --git a/locales/zh_CN.json b/locales/zh_CN.json index 62e4d9c..1a62f11 100644 --- a/locales/zh_CN.json +++ b/locales/zh_CN.json @@ -355,7 +355,9 @@ "switch_video_format": "切换视频录制格式", "switch_recording_quality": "切换视频录制质量", "switch_account_type": "切换账号类型", - "switch_language_tip": "提示: 建议切换语言后重启程序" + "switch_language_tip": "提示: 建议切换语言后重启程序", + "platform_max_concurrent_requests": "平台最大并发录制数", + "platform_max_concurrent_requests_tip": "每个平台允许同时发起请求的最大并发数,默认3" }, "about_page": { "about_project": "关于本程序",