tauri-app: fix video file name extraction
This commit is contained in:
@@ -52,9 +52,6 @@ const exportMessage = ref<string | null>(null);
|
|||||||
const showTeamStats = ref(false);
|
const showTeamStats = ref(false);
|
||||||
const selectedPlayerPuuid = ref<string | null>(null);
|
const selectedPlayerPuuid = ref<string | null>(null);
|
||||||
|
|
||||||
// Derived video filename from start_time
|
|
||||||
const videoFilename = props.game.video_file;
|
|
||||||
|
|
||||||
// Get video URL for playback using Tauri's convertFileSrc
|
// Get video URL for playback using Tauri's convertFileSrc
|
||||||
const videoUrl = computed(() => {
|
const videoUrl = computed(() => {
|
||||||
if (videoPath.value) {
|
if (videoPath.value) {
|
||||||
@@ -324,20 +321,16 @@ async function loadVideoPath() {
|
|||||||
try {
|
try {
|
||||||
const recordingsDir = await invoke<string>("get_recordings_dir");
|
const recordingsDir = await invoke<string>("get_recordings_dir");
|
||||||
|
|
||||||
if (videoFilename.value) {
|
// Try to find the video file
|
||||||
// Try to find the video file
|
const path = await invoke<string | null>("find_video_file", {
|
||||||
const path = await invoke<string | null>("find_video_file", {
|
recordingsDir,
|
||||||
recordingsDir,
|
filename: props.game.video_file,
|
||||||
filename: videoFilename.value,
|
});
|
||||||
});
|
|
||||||
|
if (path) {
|
||||||
if (path) {
|
videoPath.value = path;
|
||||||
videoPath.value = path;
|
|
||||||
} else {
|
|
||||||
videoError.value = `Video file not found: ${videoFilename.value}`;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
videoError.value = "Could not determine video filename from timeline";
|
videoError.value = `Video file not found: ${props.game.video_file}`;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
videoError.value = `Failed to load video: ${error}`;
|
videoError.value = `Failed to load video: ${error}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user