add video file name in json metadata
All checks were successful
record-daemon / Build, check and test (push) Successful in 2m12s
All checks were successful
record-daemon / Build, check and test (push) Successful in 2m12s
This commit is contained in:
@@ -71,6 +71,8 @@ pub struct RecordingMetadata {
|
||||
pub duration: Duration,
|
||||
/// Output file path.
|
||||
pub file_path: Option<PathBuf>,
|
||||
/// Video file name (just the filename, not the full path).
|
||||
pub video_file: Option<String>,
|
||||
/// File size in bytes.
|
||||
pub file_size: Option<u64>,
|
||||
/// Number of events.
|
||||
@@ -107,6 +109,11 @@ impl RecordingMetadata {
|
||||
end_time: Some(result.end_time),
|
||||
duration: result.duration,
|
||||
file_path: Some(result.path.clone()),
|
||||
video_file: result
|
||||
.path
|
||||
.file_name()
|
||||
.and_then(|n| n.to_str())
|
||||
.map(String::from),
|
||||
file_size: result.file_size(),
|
||||
event_count: 0,
|
||||
finalized: false,
|
||||
@@ -164,6 +171,7 @@ impl TimelineStore {
|
||||
end_time: None,
|
||||
duration: Duration::zero(),
|
||||
file_path: None,
|
||||
video_file: None,
|
||||
file_size: None,
|
||||
event_count: 0,
|
||||
finalized: false,
|
||||
@@ -215,6 +223,11 @@ impl TimelineStore {
|
||||
end_time: Some(result.end_time),
|
||||
duration: result.duration,
|
||||
file_path: Some(result.path.clone()),
|
||||
video_file: result
|
||||
.path
|
||||
.file_name()
|
||||
.and_then(|n| n.to_str())
|
||||
.map(String::from),
|
||||
file_size: result.file_size(),
|
||||
event_count: 0,
|
||||
finalized: true,
|
||||
@@ -318,6 +331,7 @@ impl TimelineStore {
|
||||
raw_rune_page: metadata.raw_rune_page.clone(),
|
||||
raw_live_client_data: metadata.raw_live_client_data.clone(),
|
||||
raw_end_game_stats: metadata.raw_end_game_stats.clone(),
|
||||
video_file: metadata.video_file.clone(),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -361,6 +375,7 @@ impl TimelineStore {
|
||||
raw_rune_page: metadata.raw_rune_page,
|
||||
raw_live_client_data: metadata.raw_live_client_data,
|
||||
raw_end_game_stats: metadata.raw_end_game_stats,
|
||||
video_file: metadata.video_file,
|
||||
};
|
||||
|
||||
let file_path = self.storage_dir.join(format!("{}.json", id));
|
||||
@@ -396,6 +411,7 @@ impl TimelineStore {
|
||||
let raw_rune_page = timeline.raw_rune_page;
|
||||
let raw_live_client_data = timeline.raw_live_client_data;
|
||||
let raw_end_game_stats = timeline.raw_end_game_stats;
|
||||
let video_file = timeline.video_file;
|
||||
let events = timeline.events;
|
||||
|
||||
let metadata = RecordingMetadata {
|
||||
@@ -411,6 +427,7 @@ impl TimelineStore {
|
||||
end_time,
|
||||
duration,
|
||||
file_path: None,
|
||||
video_file,
|
||||
file_size: None,
|
||||
event_count,
|
||||
finalized: true,
|
||||
|
||||
Reference in New Issue
Block a user