fix: uploaded timestamp blossom

This commit is contained in:
kieran 2025-02-07 14:36:01 +00:00
parent c885a71295
commit 3b4bb866ab
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941
2 changed files with 9 additions and 3 deletions

View File

@ -73,7 +73,13 @@ async fn main() -> Result<(), Error> {
.attach(Shield::new()) // disable
.mount(
"/",
routes![root, get_blob, head_blob, routes::void_cat_redirect, routes::void_cat_redirect_head],
routes![
root,
get_blob,
head_blob,
routes::void_cat_redirect,
routes::void_cat_redirect_head
],
)
.mount("/admin", routes::admin_routes());

View File

@ -25,7 +25,7 @@ pub struct BlobDescriptor {
pub size: u64,
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub mime_type: Option<String>,
pub created: u64,
pub uploaded: u64,
#[serde(rename = "nip94", skip_serializing_if = "Option::is_none")]
pub nip94: Option<HashMap<String, String>>,
}
@ -45,7 +45,7 @@ impl BlobDescriptor {
sha256: id_hex,
size: value.size,
mime_type: Some(value.mime_type.clone()),
created: value.created.timestamp() as u64,
uploaded: value.created.timestamp() as u64,
nip94: Some(
Nip94Event::from_upload(settings, value)
.tags