1package tinyclient23import (4 "encoding/json"5 "html/template"67 "github.com/FelineStateMachine/tinyrelay/internal/event"8 "github.com/FelineStateMachine/tinyrelay/internal/podcasts"9)1011func socialPodcastEvent(row map[string]any) event.Event {12 if nested := row["event"]; nested != nil {13 var native event.Event14 if raw, err := json.Marshal(nested); err == nil && json.Unmarshal(raw, &native) == nil {15 return native16 }17 }18 return event.Event{ID: plainString(row["id"]), PubKey: plainString(row["pubkey"]),19 Kind: int(unixSeconds(row["kind"])), CreatedAt: unixSeconds(row["created_at"]),20 Tags: roomTags(row), Content: plainString(row["content"])}21}2223func podcastEpisode(value any) podcasts.Episode {24 episode, _ := podcasts.ParseEpisode(socialPodcastEvent(valueMap(value)))25 return episode26}2728func (a *App) podcastNotes(value any) template.HTML {29 return renderMarkdownWith(plainString(valueMap(value)["content"]), a.blocks())30}3132func podcastProfile(profile, show any) map[string]any {33 metadata := valueMap(show)34 if plainString(metadata["id"]) == "" {35 return valueMap(profile)36 }37 result := map[string]any{"name": metadata["title"], "picture": metadata["image"], "about": metadata["description"]}38 if sites := stringValues(metadata["websites"]); len(sites) > 0 {39 result["website"] = sites[0]40 }41 return result42}