Podcast episodes play; servers with NodeInfo2 only are described
Castopod announces an episode with a Note that only links to the episode's page, which serves a PodcastEpisode. PrivaPub reads PodcastEpisode (its words in description, its sound in audio, its cover in image), and a Note that is only a link to its author's own episode takes the episode's sound, title, cover and words, so the post plays. A server that publishes no NodeInfo is described from NodeInfo2 (/.well-known/x-nodeinfo2), as Castopod publishes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
3df3c333bf
commit
69ab8e50eb
7 files changed
+163
-3
No files matched your search
@@ -35,6 +35,26 @@ namespace PrivaPub.Tests.Federation
|
||||
}
|
||||
""";
|
||||
|
||||
// Castopod's episode: its words in description, its sound in audio, the sound's name for a title
|
||||
[Fact]
|
||||
public void A_podcast_episode_is_read_with_its_words_sound_and_cover()
|
||||
{
|
||||
var episode = NoteParser.Parse(JsonNode.Parse("""
|
||||
{"id":"https://castopod.test/@pod/episodes/one","type":"PodcastEpisode","published":"2026-10-06T09:08:17+00:00",
|
||||
"to":["https://www.w3.org/ns/activitystreams#Public"],"attributedTo":"https://castopod.test/@pod",
|
||||
"description":{"type":"Note","mediaType":"text/markdown","content":"Listen to the **meadow**","contentMap":{"en":"<p>Listen to the meadow</p>"}},
|
||||
"image":{"type":"Image","mediaType":"image/png","url":"https://castopod.test/media/cover.png"},
|
||||
"audio":{"id":"https://castopod.test/audio/one.mp3","type":"Audio","name":"Episode one","size":16791,"duration":4.02,
|
||||
"url":{"href":"https://castopod.test/audio/one.mp3","type":"Link","mediaType":"audio/mpeg"}}}
|
||||
"""));
|
||||
|
||||
Assert.Equal(("PodcastEpisode", "Episode one", "https://castopod.test/media/cover.png"), (episode.Type, episode.Title, episode.CoverURL));
|
||||
Assert.Contains("<strong>meadow</strong>", episode.ContentHtml);
|
||||
var sound = Assert.Single(episode.Attachments);
|
||||
Assert.Equal(("https://castopod.test/audio/one.mp3", "audio/mpeg"), (sound.RemoteURL, sound.ContentType));
|
||||
Assert.Equal(4.02, episode.Audio.DurationSeconds);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Reads_a_mastodon_note()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user