mirror of
https://github.com/v0l/route96.git
synced 2025-06-13 23:32:02 +00:00
feat: return nip94 as tag array in blossom (#9)
Some checks failed
continuous-integration/drone Build is failing
Some checks failed
continuous-integration/drone Build is failing
This commit is contained in:
@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user