feat: return nip94 as tag array in blossom (#9)
Some checks failed
continuous-integration/drone Build is failing

This commit is contained in:
2025-06-10 11:39:41 +01:00
committed by GitHub
parent ca2d23508b
commit 0554f1220f

View File

@ -13,7 +13,6 @@ use rocket::response::Responder;
use rocket::serde::json::Json;
use rocket::{routes, Data, Request, Response, Route, State};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use tokio::io::AsyncRead;
use tokio_util::io::StreamReader;
@ -27,7 +26,7 @@ pub struct BlobDescriptor {
pub mime_type: Option<String>,
pub created: u64,
#[serde(rename = "nip94", skip_serializing_if = "Option::is_none")]
pub nip94: Option<HashMap<String, String>>,
pub nip94: Option<Vec<Vec<String>>>,
}
impl BlobDescriptor {
@ -46,14 +45,7 @@ impl BlobDescriptor {
size: value.size,
mime_type: Some(value.mime_type.clone()),
created: value.created.timestamp() as u64,
nip94: Some(
Nip94Event::from_upload(settings, value)
.tags
.iter()
.map(|r| (r[0].clone(), r[1].clone()))
.collect(),
),
}
nip94: Some(Nip94Event::from_upload(settings, value).tags),
}
}