From d503e44e7866f213f93fe80c368dee0ce3a692c9 Mon Sep 17 00:00:00 2001 From: Michael Black Date: Wed, 10 Jun 2026 13:25:26 -0500 Subject: [PATCH] simplify jsonld post urls --- bskyweb/cmd/bskyweb/jsonld.go | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/bskyweb/cmd/bskyweb/jsonld.go b/bskyweb/cmd/bskyweb/jsonld.go index 4f49f6afc2..4178250493 100644 --- a/bskyweb/cmd/bskyweb/jsonld.go +++ b/bskyweb/cmd/bskyweb/jsonld.go @@ -493,14 +493,8 @@ func buildPostNode(pv *appbsky.FeedDefs_PostView, replies []*appbsky.FeedDefs_Th thumb = images[0] } - postURL := bskyPostURLFromATURI(pv.Author.Handle, pv.Uri) + postURL := bskyPostURLFromATURIWithDIDFallback(pv.Author.Handle, pv.Uri) postText := postRecordText(pv) - // videoEmbedURL prefers the handle-form URL but falls back to DID-form - // for handle.invalid authors so VideoObject.embedUrl is never empty. - videoEmbedURL := postURL - if videoEmbedURL == "" { - videoEmbedURL = bskyPostURLFromATURIWithDIDFallback(pv.Author.Handle, pv.Uri) - } node := discussionForumPosting{ Type: "DiscussionForumPosting", @@ -510,7 +504,7 @@ func buildPostNode(pv *appbsky.FeedDefs_PostView, replies []*appbsky.FeedDefs_Th Text: postText, Image: images, ThumbnailURL: thumb, - Video: buildVideoObject(pv, videoEmbedURL, postText, embedHidden), + Video: buildVideoObject(pv, postURL, postText, embedHidden), DatePublished: pv.IndexedAt, InteractionStat: buildPostStats(pv), } @@ -573,12 +567,8 @@ func buildReplyNode(pv *appbsky.FeedDefs_PostView, hideLabels map[string]bool) c if len(images) > 0 { thumb = images[0] } - postURL := bskyPostURLFromATURI(pv.Author.Handle, pv.Uri) + postURL := bskyPostURLFromATURIWithDIDFallback(pv.Author.Handle, pv.Uri) postText := postRecordText(pv) - videoEmbedURL := postURL - if videoEmbedURL == "" { - videoEmbedURL = bskyPostURLFromATURIWithDIDFallback(pv.Author.Handle, pv.Uri) - } return comment{ Type: "Comment", URL: postURL, @@ -587,7 +577,7 @@ func buildReplyNode(pv *appbsky.FeedDefs_PostView, hideLabels map[string]bool) c Text: postText, Image: images, ThumbnailURL: thumb, - Video: buildVideoObject(pv, videoEmbedURL, postText, embedHidden), + Video: buildVideoObject(pv, postURL, postText, embedHidden), DatePublished: pv.IndexedAt, } }