From bd72d0a037b76bff140a5c6db2294d403b54f7c1 Mon Sep 17 00:00:00 2001 From: RabbyDevs <67389402+RabbyDevs@users.noreply.github.com> Date: Wed, 16 Apr 2025 11:02:10 +0300 Subject: [PATCH] some better error handling so i can figure out why it doesnt work on linux --- src/main.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index a6a9e43..d084a88 100644 --- a/src/main.rs +++ b/src/main.rs @@ -170,11 +170,16 @@ fn get_game_background(game: &PossibleGames) -> Element { temp_file.write_all(&file.data.clone()).unwrap(); let temp_path = temp_file.path().to_str().unwrap().to_string(); - let mut video = - Video::new(url::Url::from_file_path(temp_path).unwrap()).unwrap(); - video.set_looping(true); + match Video::new(url::Url::from_file_path(temp_path).unwrap()) { + Ok(mut video) => { + video.set_looping(true); - VideoPlayer::new(video).into() + VideoPlayer::new(video).into() + }, + Err(err) => { + panic!("{:#?}", err) + }, + } } else { let img = ImageReader::new(Cursor::new(&file.data)) .with_guessed_format()