record-daemon: refactor and cleanup
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user