Commit 36687cf

benny-dou <60535774+benny-dou@users.noreply.github.com>
2025-08-04 01:55:11
fix(podcast): ensure item is a list before iterating
1 parent 1da2bd1
Changed files (1)
src
others
src/others/podcast.py
@@ -278,7 +278,10 @@ def update_item(feed_xml: dict, item: dict, prefix_desc: str):
     hit = False
     description = glom(item, Coalesce("description", "content:encoded"), default="") or ""
     description = convert_html(prefix_desc) + "<p>----------------------------------</p>" + description
-    for x in glom(feed_xml, "rss.channel.item", default=[]):
+    items = glom(feed_xml, "rss.channel.item", default=[])
+    if not isinstance(items, list):
+        feed_xml["rss"]["channel"]["item"] = [items]
+    for x in feed_xml["rss"]["channel"]["item"]:
         x.pop("content:encoded", None)
         if x["link"] == item["link"]:
             x["description"] = description