Remove confusing connect timeout configuration

This commit is contained in:
FooIbar committed 2025-08-16 22:19:58 +08:00
1 parent 88c9e5e902
commit 90534c3c9f
6 files changed
+5 -14

No files matched your search

@@ -95,7 +95,6 @@ object Settings : DataStorePreferences(null) {
val mediaScan = boolPref("media_scan", false).observed(::updateWhenKeepMediaStatusChanges)
val multiThreadDownload = intPref("download_thread_2", 3)
val downloadDelay = intPref("download_delay_3", 1000)
val connTimeout = intPref("conn_timeout", 10)
val timeoutSpeed = intPref("timeout_speed_level", 6)
val preloadImage = intPref("preload_image_2", 5)
val downloadOriginImage = boolPref("download_origin_image", false)
@@ -72,8 +72,9 @@ suspend inline fun <R> timeoutBySpeed(
) = coroutineScope {
val onTimeout = AtomicReference<OnTimeout?>(t).let { { e: IOException -> it.exchange(null)?.invoke(e) } }
val watchdog = launch {
delay(Settings.connTimeout.value.seconds)
onTimeout(ConnectTimeoutException(url, Settings.connTimeout.value * 1000L))
val timeout = 10.seconds
delay(timeout)
onTimeout(ConnectTimeoutException(url, timeout.inWholeMilliseconds))
}
val tracker = SpeedTracker(2.seconds)
request {
@@ -191,12 +191,6 @@ fun AnimatedVisibilityScope.DownloadScreen(navigator: DestinationsNavigator) = S
entryValueRes = com.hippo.ehviewer.R.array.download_delay_entry_values,
state = downloadDelay,
)
IntSliderPreference(
maxValue = 10,
minValue = 2,
title = stringResource(id = R.string.settings_download_connection_timeout),
state = Settings.connTimeout.asMutableState(),
)
IntSliderPreference(
maxValue = 10,
minValue = MIN_SPEED_LEVEL,
@@ -340,8 +340,7 @@
<string name="settings_download_concurrency_summary">Up to %s images</string>
<string name="settings_download_download_delay">Download delay</string>
<string name="settings_download_download_delay_summary">Delay %s ms per download</string>
<string name="settings_download_connection_timeout">Connection timeout (in seconds)</string>
<string name="settings_download_timeout_speed">Minimum response speed (in KB/s)</string>
<string name="settings_download_timeout_speed">Minimum download speed (in KB/s)</string>
<string name="settings_download_preload_image">Preload image</string>
<string name="settings_download_preload_image_summary">Preload next %s image</string>
<string name="settings_download_download_origin_image">Download original image</string>
@@ -327,7 +327,6 @@
<string name="settings_download_concurrency_summary">同時に最大 %s 枚の画像をダウンロードします</string>
<string name="settings_download_download_delay">ダウンロードの遅延</string>
<string name="settings_download_download_delay_summary">ダウンロードで %s ミリ秒の遅延をさせます</string>
<string name="settings_download_connection_timeout">接続のタイムアウト (秒数)</string>
<string name="settings_download_timeout_speed">最小の応答速度 (KB/s 単位)</string>
<string name="settings_download_preload_image">画像をプリロード</string>
<string name="settings_download_preload_image_summary">%s 枚の画像をプリロードします</string>
@@ -451,8 +451,7 @@
<string name="download_start_all_reversed">全部开始(倒序)</string>
<string name="settings_download_download_delay">下载延时</string>
<string name="settings_download_download_delay_summary">每次下载延时 %s 毫秒</string>
<string name="settings_download_connection_timeout">连接超时(秒)</string>
<string name="settings_download_timeout_speed">最低响应速度(KB/s)</string>
<string name="settings_download_timeout_speed">最低下载速度(KB/s)</string>
<string name="no_browser_installed">请安装一个浏览器。</string>
<string name="toplist_alltime">从始至终</string>
<string name="toplist_pastyear">过去一年</string>