Skip to content

Commit 839b546

Browse files
Handle unknown desktop hostname
1 parent 8c61c23 commit 839b546

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

buildSrc/src/main/kotlin/plugins/spmp/Dependencies.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class SpMpDeps(extra: Map<String, Any>) {
3636
license_url = "https://github.com/toasterofbread/spmp-server/blob/6dde651ffc102d604ac7ecd5ac7471b1572fd2e6/LICENSE"
3737
),
3838
"dev.toastbits.composekit" to DependencyInfo(
39-
version = "d3828b3d42",
39+
version = "e189b7ba8a",
4040
name = "ComposeKit",
4141
author = "toasterofbread",
4242
url = "https://github.com/toasterofbread/composekit",

shared/src/commonMain/kotlin/com/toasterofbread/spmp/platform/playerservice/SpMsPlayerService.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import com.toasterofbread.spmp.platform.download.DownloadStatus
1616
import com.toasterofbread.spmp.platform.getUiLanguage
1717
import com.toasterofbread.spmp.resources.getString
1818
import com.toasterofbread.spmp.model.radio.RadioState
19+
import dev.toastbits.composekit.platform.getPlatformHostName
20+
import dev.toastbits.composekit.platform.getPlatformOSName
1921
import io.ktor.http.Headers
2022
import io.ktor.util.flattenEntries
2123
import kotlinx.coroutines.*
@@ -53,8 +55,8 @@ abstract class SpMsPlayerService(val plays_audio: Boolean): PlatformServiceImpl(
5355
internal abstract fun onRadioCancelRequested()
5456

5557
private fun getClientName(): String {
56-
val os: String = Platform.getOSName()
57-
var host: String = Platform.getHostName()
58+
val os: String = getPlatformOSName()
59+
val host: String = getPlatformHostName() ?: getString("unknown_host_name")
5860
return getString("app_name") + " [$os, $host]"
5961
}
6062

shared/src/commonMain/resources/assets/values-ja-JP/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@
263263
<string name="report_error">報告する</string>
264264
<string name="wrap_text_switch_label">折り返す</string>
265265
<string name="upload_to_paste_dot_ee">Paste.eeにアップロード</string>
266+
<string name="unknown_host_name">不明</string>
266267

267268
<string name="lpm_action_radio">ラジオを始める</string>
268269
<string name="lpm_action_play">再生</string>

shared/src/commonMain/resources/assets/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@
294294
<string name="report_error">Report</string>
295295
<string name="wrap_text_switch_label">Wrap text</string>
296296
<string name="upload_to_paste_dot_ee">Upload to Paste.ee</string>
297+
<string name="unknown_host_name">Unknown</string>
297298

298299
<string name="lpm_action_radio">Start radio</string>
299300
<string name="lpm_action_play">Play</string>

0 commit comments

Comments
 (0)