fix
This commit is contained in:
+21
-3
@@ -283,11 +283,28 @@ def curate_from_rss(entry, original_source, source_name, link, page_url):
|
||||
logger.warning(f"Failed to insert link for RSS entry: {entry.title}")
|
||||
return None, None
|
||||
|
||||
post_data, author, category, image_url, image_source, uploader, page_url = prepare_post_data(final_summary, entry.title)
|
||||
if not post_data:
|
||||
# Call prepare_post_data and handle return values dynamically
|
||||
result = prepare_post_data(final_summary, entry.title)
|
||||
if not result:
|
||||
logger.info(f"Post preparation failed for RSS entry: {entry.title}")
|
||||
return None, None
|
||||
|
||||
# Log the number of values returned for debugging
|
||||
logger.debug(f"prepare_post_data returned {len(result)} values: {result}")
|
||||
|
||||
# Expect at least 7 values; handle additional values gracefully
|
||||
if len(result) < 7:
|
||||
logger.error(f"prepare_post_data returned too few values: {result}")
|
||||
return None, None
|
||||
|
||||
post_data = result[0]
|
||||
author = result[1]
|
||||
category = result[2]
|
||||
image_url = result[3]
|
||||
image_source = result[4]
|
||||
uploader = result[5]
|
||||
page_url = result[6]
|
||||
|
||||
share_text = f"Check out this tasty find: {post_data['title']}"
|
||||
share_text_encoded = quote(share_text)
|
||||
share_links_template = (
|
||||
@@ -333,7 +350,8 @@ def curate_from_rss(entry, original_source, source_name, link, page_url):
|
||||
page_url=page_url,
|
||||
interest_score=interest_score,
|
||||
post_id=post_id,
|
||||
should_post_tweet=False
|
||||
should_post_tweet=False,
|
||||
summary=final_summary
|
||||
)
|
||||
|
||||
if post_id:
|
||||
|
||||
Reference in New Issue
Block a user