//! Recording output files and results. use std::path::PathBuf; use chrono::{DateTime, Duration, Utc}; use serde::{Deserialize, Serialize}; /// An active recording output. #[derive(Debug, Clone)] pub struct RecordingOutput { /// Output file path. pub path: PathBuf, /// Game ID if available. pub game_id: Option, /// Champion name if available. pub champion: Option, } /// Result of a completed recording. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct RecordingResult { /// Output file path. pub path: PathBuf, /// Game ID if available. pub game_id: Option, /// Champion name if available. pub champion: Option, /// Recording start time. pub start_time: DateTime, /// Recording end time. pub end_time: DateTime, /// Recording duration. pub duration: Duration, } impl RecordingResult { /// Get the file size in bytes, if the file still exists. pub fn file_size(&self) -> Option { std::fs::metadata(&self.path).ok().map(|m| m.len()) } }