mirror of
https://github.com/aljazceru/njump.git
synced 2026-01-31 11:44:34 +01:00
turn kind1063Metadata into a struct.
This commit is contained in:
@@ -231,10 +231,10 @@ func renderEvent(w http.ResponseWriter, r *http.Request) {
|
||||
SeenOn: data.relays,
|
||||
Npub: data.npub,
|
||||
Nprofile: data.nprofile,
|
||||
Magnet: data.kind1063Metadata["magnet"],
|
||||
Dim: data.kind1063Metadata["dim"],
|
||||
Size: data.kind1063Metadata["size"],
|
||||
Summary: data.kind1063Metadata["summary"],
|
||||
Magnet: data.kind1063Metadata.magnet,
|
||||
Dim: data.kind1063Metadata.dim,
|
||||
Size: data.kind1063Metadata.size,
|
||||
Summary: data.kind1063Metadata.summary,
|
||||
}
|
||||
|
||||
switch data.templateId {
|
||||
@@ -285,7 +285,7 @@ func renderEvent(w http.ResponseWriter, r *http.Request) {
|
||||
VideoType: data.videoType,
|
||||
})
|
||||
case FileMetadata:
|
||||
thisImage := data.kind1063Metadata["image"]
|
||||
thisImage := data.kind1063Metadata.image
|
||||
if thisImage == "" && data.image != "" {
|
||||
thisImage = data.image
|
||||
}
|
||||
@@ -298,7 +298,7 @@ func renderEvent(w http.ResponseWriter, r *http.Request) {
|
||||
},
|
||||
DetailsPartial: detailsData,
|
||||
ClientsPartial: ClientsPartial{
|
||||
Clients: generateClientList(code, data.event),
|
||||
Clients: generateClientList(style, code, data.event),
|
||||
},
|
||||
|
||||
AuthorLong: data.authorLong,
|
||||
@@ -315,16 +315,16 @@ func renderEvent(w http.ResponseWriter, r *http.Request) {
|
||||
TwitterTitle: twitterTitle,
|
||||
Video: data.video,
|
||||
VideoType: data.videoType,
|
||||
Url: data.kind1063Metadata["url"],
|
||||
M: data.kind1063Metadata["m"],
|
||||
Aes256Gcm: data.kind1063Metadata["aes-256-gcm"],
|
||||
X: data.kind1063Metadata["x"],
|
||||
I: data.kind1063Metadata["i"],
|
||||
Blurhash: data.kind1063Metadata["blurhash"],
|
||||
Thumb: data.kind1063Metadata["thumb"],
|
||||
Url: data.kind1063Metadata.url,
|
||||
M: data.kind1063Metadata.m,
|
||||
Aes256Gcm: data.kind1063Metadata.aes256gcm,
|
||||
X: data.kind1063Metadata.x,
|
||||
I: data.kind1063Metadata.i,
|
||||
Blurhash: data.kind1063Metadata.blurhash,
|
||||
Thumb: data.kind1063Metadata.thumb,
|
||||
Image: thisImage,
|
||||
Alt: data.kind1063Metadata["alt"],
|
||||
MType: strings.Split(data.kind1063Metadata["m"], "/")[0],
|
||||
Alt: data.alt,
|
||||
MType: strings.Split(data.kind1063Metadata.m, "/")[0],
|
||||
})
|
||||
case Other:
|
||||
err = OtherTemplate.Render(w, &OtherPage{
|
||||
|
||||
Reference in New Issue
Block a user