diff --git a/Cargo.toml b/Cargo.toml index 7ebbe73..b25c307 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ dioxus-sdk-time = "0.7.0" dioxus-primitives = { git = "https://github.com/DioxusLabs/components", version = "0.0.1", default-features = false } reqwest = "0.12.25" strum = { version = "0.27.2", default-features = false, features = ["derive"] } +async_zip = { version = "0.0.18", features = ["full-wasm"] } [features] default = ["web"] diff --git a/assets/results.zip b/assets/results.zip new file mode 100644 index 0000000..2d2a399 Binary files /dev/null and b/assets/results.zip differ diff --git a/src/landing.rs b/src/landing.rs index de6b6cd..b4d4f92 100644 --- a/src/landing.rs +++ b/src/landing.rs @@ -737,10 +737,15 @@ fn PaginationPlaceholder(small: bool) -> Element { } async fn get_results() -> Result { - Ok( - reqwest::get(format!("{}/assets/results.csv", std::env!("URL"))) - .await? - .text() - .await?, - ) + use async_zip::base::read::mem::ZipFileReader; + let archive = reqwest::get(format!("{}/assets/results.zip", std::env!("URL"))) + .await? + .bytes() + .await? + .to_vec(); + let zip = ZipFileReader::new(archive).await?; + let mut string = String::new(); + let mut reader = zip.reader_with_entry(0).await?; + reader.read_to_string_checked(&mut string).await?; + Ok(string) } diff --git a/src/main.rs b/src/main.rs index 826e1db..5e8a12f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,7 +17,7 @@ const FAVICON: Asset = asset!("/assets/favicon.ico"); const TAILWIND_CSS: Asset = asset!("/assets/tailwind.css"); const COMPONENTS_CSS: Asset = asset!("/assets/dx-components-theme.css"); const RESULT: Asset = asset!( - "/assets/results.csv", + "/assets/results.zip", AssetOptions::builder().with_hash_suffix(false) );