From 870ab7b6fc6a10c4c214818acf336f1b0acde364 Mon Sep 17 00:00:00 2001 From: "Tanner Collin (aider)" Date: Tue, 3 Jun 2025 15:39:30 -0600 Subject: [PATCH] feat: Link items to articles by title and set unique_id --- swap_guids.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/swap_guids.py b/swap_guids.py index 4f9fb56..1e87166 100644 --- a/swap_guids.py +++ b/swap_guids.py @@ -13,7 +13,14 @@ def modify_feed(context, feed): articles[article.title] = article for item in feed.items: - pass + article = articles.get(item.title) + if not article: + raise Exception(f"Article not found for title: {item.title}") + + if not hasattr(article, 'guid') or not article.guid: + raise Exception(f"Article '{article.title}' is missing a guid.") + + item.unique_id = article.guid def register():