Improve changelog

This commit is contained in:
2026-09-11 16:46:30 +02:00
committed by djib
parent d36d39f799
commit 3322b02ef9
+30 -3
View File
@@ -149,8 +149,36 @@ def create_rss_feed(apps_data, feed_name, feed_description, output_file):
screenshot_url = str(app['screenshot_url'])
description_sections.append(f'<img src="{screenshot_url}" alt="Screenshot" style="max-width: 100%; height: auto;" />')
# Add latest release notes if available
if 'latest_release_notes' in app and app['latest_release_notes']:
# Add changelog if available
if 'changelog' in app and isinstance(app['changelog'], list) and len(app['changelog']) > 0:
description_sections.append('<h3>Changelog</h3>')
changelog_html = []
for entry in app['changelog']:
if isinstance(entry, dict):
version = entry.get('version', 'Unknown')
release_notes = entry.get('release_notes', '')
published_date = entry.get('published_date', '')
changelog_html.append(f'<h4>Version {version}</h4>')
if published_date:
try:
# Parse and format the date nicely
pub_date = datetime.fromisoformat(published_date.replace('Z', '+00:00'))
formatted_date = pub_date.strftime('%Y-%m-%d %H:%M UTC')
changelog_html.append(f'<p><em>Released: {formatted_date}</em></p>')
except (ValueError, AttributeError):
changelog_html.append(f'<p><em>Released: {published_date}</em></p>')
if release_notes:
formatted_notes = format_description(release_notes)
changelog_html.append(formatted_notes)
else:
changelog_html.append('<p>No release notes provided.</p>')
description_sections.append('\n'.join(changelog_html))
# Add latest release notes if available (and changelog isn't already shown)
elif 'latest_release_notes' in app and app['latest_release_notes']:
release_notes = str(app['latest_release_notes']).strip()
if release_notes:
formatted_notes = format_description(release_notes)
@@ -234,4 +262,3 @@ def main():
if __name__ == "__main__":
main()