aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-10-02 20:53:28 -0700
committerPinapelz <yukais@pinapelz.com>2025-10-02 20:53:28 -0700
commit9b6920e633cfc98900d1cb817c8f59ab6b88af3a (patch)
tree5f0ff14b2d274b3df145e96f53ff57d3f7745e43
parentd9197178248156cc8c09824a8e7e54cc64539805 (diff)
fix: generate rss feed even when cached json is used
-rw-r--r--generate.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/generate.py b/generate.py
index 1fe11ce..f5c6b37 100644
--- a/generate.py
+++ b/generate.py
@@ -86,15 +86,6 @@ def generate_news_file(filename, url, version=None, formatted_name: str = None):
with open(path, "w", encoding="utf-8") as f:
json.dump(attach_news_meta_data(news_data), f, indent=2, ensure_ascii=False)
- if GENERATE_RSS_FEEDS:
- rss_file_path = f"{OUTPUT_DIR}/{filename}.xml"
- log_output(f"Generating RSS Feed: {rss_file_path}")
- if not formatted_name:
- formatted_name = filename
- title = f"{formatted_name} News RSS Feed"
- description = f"The latest information for {formatted_name} from official sources"
- build_rss_from_news_feed(title, description, path, rss_file_path)
-
elif os.path.exists(path):
log_output(
f"Failed. Couldn't fetch {filename.upper()} data. Using previously scraped data",
@@ -105,6 +96,16 @@ def generate_news_file(filename, url, version=None, formatted_name: str = None):
else:
log_output(f"Failed. Couldn't fetch {filename.upper()} data. Skipping...", "NEWS")
+ return news_data
+
+ if GENERATE_RSS_FEEDS:
+ rss_file_path = f"{OUTPUT_DIR}/{filename}.xml"
+ log_output(f"Generating RSS Feed: {rss_file_path}")
+ if not formatted_name:
+ formatted_name = filename
+ title = f"{formatted_name} News RSS Feed"
+ description = f"The latest information for {formatted_name} from official sources"
+ build_rss_from_news_feed(title, description, path, rss_file_path)
return news_data
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage