First working POC

This commit is contained in:
2026-01-26 22:21:54 +01:00
commit cfddc1edea
255 changed files with 77606 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
use std::sync::Arc;
use tauri::State;
use crate::session_poller::{PollingHint, SessionPollerManager};
use crate::jellyfin::client::SessionInfo;
/// Tauri state wrapper for SessionPollerManager
pub struct SessionPollerWrapper(pub Arc<SessionPollerManager>);
/// Set polling frequency hint based on UI state
#[tauri::command]
pub fn sessions_set_polling_hint(
poller: State<'_, SessionPollerWrapper>,
hint: String,
) -> Result<(), String> {
let parsed_hint = match hint.as_str() {
"cast_active" => PollingHint::CastActive,
"cast_discovery" => PollingHint::CastDiscovery,
"normal" => PollingHint::Normal,
_ => return Err(format!("Invalid polling hint: {}", hint)),
};
poller.0.set_polling_hint(parsed_hint);
Ok(())
}
/// Manually trigger a session poll (for refresh button)
#[tauri::command]
pub async fn sessions_poll_now(
poller: State<'_, SessionPollerWrapper>,
) -> Result<Vec<SessionInfo>, String> {
poller.0.poll_now().await
}