Skip to content

Commit

Permalink
Handle unknown desktop hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
toasterofbread committed Aug 1, 2024
1 parent 8c61c23 commit 839b546
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/plugins/spmp/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class SpMpDeps(extra: Map<String, Any>) {
license_url = "https://github.com/toasterofbread/spmp-server/blob/6dde651ffc102d604ac7ecd5ac7471b1572fd2e6/LICENSE"
),
"dev.toastbits.composekit" to DependencyInfo(
version = "d3828b3d42",
version = "e189b7ba8a",
name = "ComposeKit",
author = "toasterofbread",
url = "https://github.com/toasterofbread/composekit",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import com.toasterofbread.spmp.platform.download.DownloadStatus
import com.toasterofbread.spmp.platform.getUiLanguage
import com.toasterofbread.spmp.resources.getString
import com.toasterofbread.spmp.model.radio.RadioState
import dev.toastbits.composekit.platform.getPlatformHostName
import dev.toastbits.composekit.platform.getPlatformOSName
import io.ktor.http.Headers
import io.ktor.util.flattenEntries
import kotlinx.coroutines.*
Expand Down Expand Up @@ -53,8 +55,8 @@ abstract class SpMsPlayerService(val plays_audio: Boolean): PlatformServiceImpl(
internal abstract fun onRadioCancelRequested()

private fun getClientName(): String {
val os: String = Platform.getOSName()
var host: String = Platform.getHostName()
val os: String = getPlatformOSName()
val host: String = getPlatformHostName() ?: getString("unknown_host_name")
return getString("app_name") + " [$os, $host]"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@
<string name="report_error">報告する</string>
<string name="wrap_text_switch_label">折り返す</string>
<string name="upload_to_paste_dot_ee">Paste.eeにアップロード</string>
<string name="unknown_host_name">不明</string>

<string name="lpm_action_radio">ラジオを始める</string>
<string name="lpm_action_play">再生</string>
Expand Down
1 change: 1 addition & 0 deletions shared/src/commonMain/resources/assets/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@
<string name="report_error">Report</string>
<string name="wrap_text_switch_label">Wrap text</string>
<string name="upload_to_paste_dot_ee">Upload to Paste.ee</string>
<string name="unknown_host_name">Unknown</string>

<string name="lpm_action_radio">Start radio</string>
<string name="lpm_action_play">Play</string>
Expand Down

0 comments on commit 839b546

Please sign in to comment.