Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion node/bottube_feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ def _build_entry(self, entry: Dict[str, Any]) -> str:
# Thumbnail
if entry.get("thumbnail_url"):
lines.append(
f' <media:thumbnail url="{xml_escape(entry["thumbnail_url"])}/>'
f' <media:thumbnail url="{xml_escape(entry["thumbnail_url"])}"/>'
)

lines.append("</entry>")
Expand Down
14 changes: 14 additions & 0 deletions tests/test_bottube_feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import sys
import time
import unittest
import xml.etree.ElementTree as ET
from datetime import datetime, timezone
from pathlib import Path

Expand Down Expand Up @@ -325,6 +326,19 @@ def test_media_content(self):
self.assertIn("media:content", xml)
self.assertIn("video.mp4", xml)

def test_thumbnail_is_valid_xml(self):
"""Test Atom media thumbnail extension produces valid XML."""
self.builder.add_entry(
title="Test",
entry_id="urn:test:1",
link="https://example.com/1",
summary="Test",
thumbnail_url="https://example.com/thumb.jpg"
)
xml = self.builder.build()
self.assertIn('<media:thumbnail url="https://example.com/thumb.jpg"/>', xml)
ET.fromstring(xml)


class TestConvenienceFunctions(unittest.TestCase):
"""Test convenience functions."""
Expand Down