This commit is contained in:
Bel LaPointe
2023-12-28 22:17:21 -05:00
parent c3d6cd1545
commit 4aede62dbb

View File

@@ -1,10 +1,8 @@
#![allow(non_snake_case)]
// import the prelude to get access to the `rsx!` macro and the `Scope` and `Element` types
use dioxus::prelude::*;
use dioxus::hooks::use_future;
use lib;
use base64::{engine::general_purpose, Engine as _};
use core::cmp::Ordering;
use std::str::FromStr;
fn main() {
@@ -216,7 +214,7 @@ async fn analyze(file: String) -> Analysis {
stop: content_span.stop.to_string(),
screenshot: match lib::video::screenshot_png(&file, ts) {
Ok(png) => general_purpose::STANDARD.encode(&png),
Err(_) => a_png.to_string(),
Err(_) => A_PNG.to_string(),
},
has_content: false,
}
@@ -259,9 +257,9 @@ async fn clipify(file: String, content_spans: Vec<lib::video::ContentSpan>) -> S
}
let _ = opener::open(d.clone());
match statuses.len() {
_ => statuses.join(", "),
0 => d,
_ => statuses.join(", "),
}
}
const a_png: &str = r"iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
const A_PNG: &str = r"iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";