Commit 36687cf
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