switching to a zip for results

This commit is contained in:
2025-12-15 21:18:11 +01:00
parent b9621a15f6
commit d847e4c173
4 changed files with 13 additions and 7 deletions

View File

@@ -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"]

BIN
assets/results.zip git.filemode.normal_file

Binary file not shown.

View File

@@ -737,10 +737,15 @@ fn PaginationPlaceholder(small: bool) -> Element {
}
async fn get_results() -> Result<String> {
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)
}

View File

@@ -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)
);