add video file name in json metadata
Some checks failed
record-daemon / Build, check and test (push) Failing after 8s

This commit is contained in:
2026-03-27 23:24:01 +01:00
parent b64937601a
commit 1559f03eed
4 changed files with 16 additions and 19 deletions

View File

@@ -47,6 +47,9 @@ pub struct Timeline {
/// Raw end-of-game stats from `/lol-end-of-game/v1/eog-stats-block`. /// Raw end-of-game stats from `/lol-end-of-game/v1/eog-stats-block`.
#[serde(default)] #[serde(default)]
pub raw_end_game_stats: Option<serde_json::Value>, pub raw_end_game_stats: Option<serde_json::Value>,
/// Video file name (just the filename, not the full path).
#[serde(default)]
pub video_file: Option<String>,
} }
impl Timeline { impl Timeline {
@@ -72,6 +75,7 @@ impl Timeline {
raw_rune_page: None, raw_rune_page: None,
raw_live_client_data: None, raw_live_client_data: None,
raw_end_game_stats: None, raw_end_game_stats: None,
video_file: None,
} }
} }

View File

@@ -71,6 +71,8 @@ pub struct RecordingMetadata {
pub duration: Duration, pub duration: Duration,
/// Output file path. /// Output file path.
pub file_path: Option<PathBuf>, pub file_path: Option<PathBuf>,
/// Video file name (just the filename, not the full path).
pub video_file: Option<String>,
/// File size in bytes. /// File size in bytes.
pub file_size: Option<u64>, pub file_size: Option<u64>,
/// Number of events. /// Number of events.
@@ -107,6 +109,7 @@ impl RecordingMetadata {
end_time: Some(result.end_time), end_time: Some(result.end_time),
duration: result.duration, duration: result.duration,
file_path: Some(result.path.clone()), 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(), file_size: result.file_size(),
event_count: 0, event_count: 0,
finalized: false, finalized: false,
@@ -164,6 +167,7 @@ impl TimelineStore {
end_time: None, end_time: None,
duration: Duration::zero(), duration: Duration::zero(),
file_path: None, file_path: None,
video_file: None,
file_size: None, file_size: None,
event_count: 0, event_count: 0,
finalized: false, finalized: false,
@@ -215,6 +219,7 @@ impl TimelineStore {
end_time: Some(result.end_time), end_time: Some(result.end_time),
duration: result.duration, duration: result.duration,
file_path: Some(result.path.clone()), 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(), file_size: result.file_size(),
event_count: 0, event_count: 0,
finalized: true, finalized: true,
@@ -318,6 +323,7 @@ impl TimelineStore {
raw_rune_page: metadata.raw_rune_page.clone(), raw_rune_page: metadata.raw_rune_page.clone(),
raw_live_client_data: metadata.raw_live_client_data.clone(), raw_live_client_data: metadata.raw_live_client_data.clone(),
raw_end_game_stats: metadata.raw_end_game_stats.clone(), raw_end_game_stats: metadata.raw_end_game_stats.clone(),
video_file: metadata.video_file.clone(),
}) })
} }
@@ -361,6 +367,7 @@ impl TimelineStore {
raw_rune_page: metadata.raw_rune_page, raw_rune_page: metadata.raw_rune_page,
raw_live_client_data: metadata.raw_live_client_data, raw_live_client_data: metadata.raw_live_client_data,
raw_end_game_stats: metadata.raw_end_game_stats, raw_end_game_stats: metadata.raw_end_game_stats,
video_file: metadata.video_file,
}; };
let file_path = self.storage_dir.join(format!("{}.json", id)); let file_path = self.storage_dir.join(format!("{}.json", id));
@@ -396,6 +403,7 @@ impl TimelineStore {
let raw_rune_page = timeline.raw_rune_page; let raw_rune_page = timeline.raw_rune_page;
let raw_live_client_data = timeline.raw_live_client_data; let raw_live_client_data = timeline.raw_live_client_data;
let raw_end_game_stats = timeline.raw_end_game_stats; let raw_end_game_stats = timeline.raw_end_game_stats;
let video_file = timeline.video_file;
let events = timeline.events; let events = timeline.events;
let metadata = RecordingMetadata { let metadata = RecordingMetadata {
@@ -411,6 +419,7 @@ impl TimelineStore {
end_time, end_time,
duration, duration,
file_path: None, file_path: None,
video_file,
file_size: None, file_size: None,
event_count, event_count,
finalized: true, finalized: true,

View File

@@ -53,25 +53,7 @@ const showTeamStats = ref(false);
const selectedPlayerPuuid = ref<string | null>(null); const selectedPlayerPuuid = ref<string | null>(null);
// Derived video filename from start_time // Derived video filename from start_time
const videoFilename = computed(() => { const videoFilename = props.game.video_file;
// Parse start_time like "2026-03-27T16:42:55.800338300Z"
const startTime = props.game.start_time;
if (!startTime) return null;
try {
const date = new Date(startTime);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day}_${hours}-${minutes}-${seconds}_unknown.mp4`;
} catch {
return null;
}
});
// Get video URL for playback using Tauri's convertFileSrc // Get video URL for playback using Tauri's convertFileSrc
const videoUrl = computed(() => { const videoUrl = computed(() => {

View File

@@ -146,6 +146,8 @@ export interface Timeline {
raw_live_client_data: Record<string, unknown> | null; raw_live_client_data: Record<string, unknown> | null;
/** Raw end-of-game stats from `/lol-end-of-game/v1/eog-stats-block`. */ /** Raw end-of-game stats from `/lol-end-of-game/v1/eog-stats-block`. */
raw_end_game_stats: Record<string, unknown> | null; raw_end_game_stats: Record<string, unknown> | null;
/** Video file name (just the filename, not the full path). */
video_file: string | null;
} }
/** /**