Fix demo sorting and store data in analysis-input instead of always loading it

This commit is contained in:
Lol3rrr
2024-10-19 00:02:16 +02:00
parent 966bd4f413
commit f22c1a1420
6 changed files with 56 additions and 33 deletions

View File

@@ -84,7 +84,7 @@ async fn list(
// Sort this
let mut output = demos.into_values().collect::<Vec<_>>();
output.sort_unstable_by_key(|d| d.uploaded_at);
output.sort_unstable_by_key(|d| std::cmp::Reverse(d.uploaded_at));
Ok(axum::response::Json(output))
}
@@ -130,7 +130,9 @@ async fn upload(
let demo_file_path = user_folder.join(format!("{}.dem", demo_id));
super::stream_to_file(demo_file_path, file_field).await.unwrap();
super::stream_to_file(demo_file_path, file_field)
.await
.unwrap();
let mut db_con = crate::db_connection().await;