record-daemon: refactor and cleanup

This commit is contained in:
2026-03-21 00:05:46 +01:00
parent 1166424c29
commit 03e36d0f1b
12 changed files with 140 additions and 139 deletions
+4
View File
@@ -59,6 +59,9 @@ pub struct RecordingResult {
/// Recording duration.
// #[serde(with = "chrono::serde::seconds")]
pub duration: Duration,
/// Recording statistics (if available).
#[serde(skip_serializing_if = "Option::is_none")]
pub stats: Option<RecordingStats>,
}
impl RecordingResult {
@@ -209,6 +212,7 @@ mod tests {
start_time: Utc::now(),
end_time: Utc::now() + Duration::seconds(125),
duration: Duration::seconds(125),
stats: None,
};
assert_eq!(result.duration_human(), "2m 5s");