Compare commits
No commits in common. "be7268cc964172b4262535efcb4f9fc71120b36a" and "4ae2171061d87d6419a4fe79148d0d712d0b9380" have entirely different histories.
be7268cc96
...
4ae2171061
4 changed files with 6 additions and 33 deletions
|
|
@ -1,9 +0,0 @@
|
|||
package com.github.damontecres.wholphin
|
||||
|
||||
/** Wolfskin-specific defaults kept in one place to keep upstream diffs small. */
|
||||
object WolfskinDefaults {
|
||||
const val SEERR_URL = "https://seerr.justinvisser.org"
|
||||
}
|
||||
|
||||
/** Returns [url] when it has content, otherwise the Wolfskin Seerr URL so the user can still edit it. */
|
||||
fun seerrUrlPrefill(url: String = ""): String = if (url.isBlank()) WolfskinDefaults.SEERR_URL else url
|
||||
|
|
@ -30,7 +30,6 @@ import androidx.compose.ui.unit.dp
|
|||
import androidx.tv.material3.MaterialTheme
|
||||
import androidx.tv.material3.Text
|
||||
import com.github.damontecres.wholphin.R
|
||||
import com.github.damontecres.wholphin.seerrUrlPrefill
|
||||
import com.github.damontecres.wholphin.ui.PreviewTvSpec
|
||||
import com.github.damontecres.wholphin.ui.components.Button
|
||||
import com.github.damontecres.wholphin.ui.components.EditTextBox
|
||||
|
|
@ -55,7 +54,7 @@ fun AddSeerrServerApiKey(
|
|||
.padding(16.dp)
|
||||
.wrapContentSize(),
|
||||
) {
|
||||
var url by remember { mutableStateOf(seerrUrlPrefill()) }
|
||||
var url by remember { mutableStateOf("") }
|
||||
var apiKey by remember { mutableStateOf("") }
|
||||
|
||||
val focusRequester = remember { FocusRequester() }
|
||||
|
|
@ -167,7 +166,7 @@ fun AddSeerrServerUsername(
|
|||
.padding(16.dp)
|
||||
.wrapContentSize(),
|
||||
) {
|
||||
var url by remember { mutableStateOf(seerrUrlPrefill()) }
|
||||
var url by remember { mutableStateOf("") }
|
||||
var username by remember { mutableStateOf(username) }
|
||||
var password by remember { mutableStateOf("") }
|
||||
|
||||
|
|
|
|||
|
|
@ -89,6 +89,10 @@ fun ChooseSeerrLoginType(
|
|||
title = stringResource(R.string.seerr_login),
|
||||
items =
|
||||
listOf(
|
||||
DialogItem(
|
||||
text = stringResource(R.string.api_key),
|
||||
onClick = { onChoose.invoke(SeerrAuthMethod.API_KEY) },
|
||||
),
|
||||
DialogItem(
|
||||
text = stringResource(R.string.seerr_jellyfin_user),
|
||||
onClick = { onChoose.invoke(SeerrAuthMethod.JELLYFIN) },
|
||||
|
|
@ -97,10 +101,6 @@ fun ChooseSeerrLoginType(
|
|||
text = stringResource(R.string.seerr_local_user),
|
||||
onClick = { onChoose.invoke(SeerrAuthMethod.LOCAL) },
|
||||
),
|
||||
DialogItem(
|
||||
text = stringResource(R.string.api_key),
|
||||
onClick = { onChoose.invoke(SeerrAuthMethod.API_KEY) },
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
package com.github.damontecres.wholphin
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
class WolfskinDefaultsTest {
|
||||
@Test
|
||||
fun emptyUrlIsPrefilledWithWolfskinSeerrUrl() {
|
||||
assertEquals(WolfskinDefaults.SEERR_URL, seerrUrlPrefill())
|
||||
assertEquals(WolfskinDefaults.SEERR_URL, seerrUrlPrefill(" "))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun enteredUrlIsKept() {
|
||||
assertEquals("https://seerr.example.org", seerrUrlPrefill("https://seerr.example.org"))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue