From 84429ad91bad33a0580784c43db8ca15d265d4d7 Mon Sep 17 00:00:00 2001
From: SimoneMariaRomeo <180769497+SimoneMariaRomeo@users.noreply.github.com>
Date: Wed, 13 May 2026 02:56:44 +0700
Subject: [PATCH] Fix Atom feed thumbnail XML
---
node/bottube_feed.py | 2 +-
tests/test_bottube_feed.py | 14 ++++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/node/bottube_feed.py b/node/bottube_feed.py
index df0c8916d..82c1fd2f4 100644
--- a/node/bottube_feed.py
+++ b/node/bottube_feed.py
@@ -595,7 +595,7 @@ def _build_entry(self, entry: Dict[str, Any]) -> str:
# Thumbnail
if entry.get("thumbnail_url"):
lines.append(
- f' '
+ f' '
)
lines.append("")
diff --git a/tests/test_bottube_feed.py b/tests/test_bottube_feed.py
index 59a9dfbaf..e4c0a7639 100644
--- a/tests/test_bottube_feed.py
+++ b/tests/test_bottube_feed.py
@@ -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
@@ -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('', xml)
+ ET.fromstring(xml)
+
class TestConvenienceFunctions(unittest.TestCase):
"""Test convenience functions."""