Parse intents to search, view, or play media (#1688)

## Description
Adds parsing for intents to search, view, or play media based on the
action and parameters. This allows for remotely opening Wholphin and
starting playback.

This is considered experimental, so the syntax or behaviors may change!

See the `Intents.md` file in this PR for syntax and examples.

### Related issues
Replaces https://github.com/damontecres/Wholphin/pull/738
Closes https://github.com/damontecres/Wholphin/discussions/1095

### Testing
Emulator with the test commands in the docs

## Screenshots
N/A

## AI or LLM usage
None
This commit is contained in:
Damontecres 2026-07-20 10:04:34 -04:00 • committed by GitHub
parent 4f5cd3e7b1
commit b1f9c32a19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 415 additions and 78 deletions

View file

@ -496,6 +496,7 @@ private const val COMBINED_ROW = TAB_ROW + 1
@Composable
fun SearchPage(
initialQuery: String,
userPreferences: UserPreferences,
modifier: Modifier = Modifier,
viewModel: SearchViewModel = hiltViewModel(),
@ -513,7 +514,7 @@ fun SearchPage(
val voiceSearchButtonVisible = prefs.showVoiceSearchButton
// val query = rememberTextFieldState()
var query by rememberSaveable { mutableStateOf("") }
var query by rememberSaveable { mutableStateOf(initialQuery) }
val focusRequesters = remember { List(SEERR_ROW + 1) { FocusRequester() } }
val seerrActive by viewModel.seerrActive.collectAsState(initial = false)

View file

@ -54,10 +54,11 @@ sealed class Destination(
) : Destination(true)
@Serializable
data object UserAppPreferences : Destination(true)
data class Search(
val query: String = "",
) : Destination()
@Serializable
data object Search : Destination()
data object UserAppPreferences : Destination(true)
@Serializable
data class SeriesOverview(

View file

@ -351,9 +351,10 @@ fun DestinationContent(
LicenseInfo(modifier)
}
Destination.Search -> {
is Destination.Search -> {
LaunchedEffect(Unit) { onClearBackdrop.invoke() }
SearchPage(
initialQuery = destination.query,
userPreferences = preferences,
modifier = modifier,
)

View file

@ -409,7 +409,7 @@ fun NavDrawer(
interactionSource = interactionSource,
onClick = {
viewModel.setIndex(SEARCH_INDEX)
viewModel.navigationManager.navigateToFromDrawer(Destination.Search)
viewModel.navigationManager.navigateToFromDrawer(Destination.Search())
},
modifier =
Modifier