MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / validate_screen_recording_seconds

Function validate_screen_recording_seconds

packages/server/src/api/routes.rs:2560–2573  ·  view source on GitHub ↗
(seconds: Option<f64>)

Source from the content-addressed store, hash-verified

2558}
2559
2560fn validate_screen_recording_seconds(seconds: Option<f64>) -> Result<f64, AppError> {
2561 let seconds = seconds.unwrap_or(5.0);
2562 if !seconds.is_finite() || seconds <= 0.0 {
2563 return Err(AppError::bad_request(
2564 "`seconds` must be finite and greater than zero.",
2565 ));
2566 }
2567 if seconds > 120.0 {
2568 return Err(AppError::bad_request(
2569 "`seconds` must be 120 or less for API screen recordings.",
2570 ));
2571 }
2572 Ok(seconds)
2573}
2574
2575async fn refresh_stream(
2576 State(state): State<AppState>,

Callers 1

screen_recordingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected