diff --git a/rss-generator.py b/rss-generator.py index 01687a0..97fb685 100644 --- a/rss-generator.py +++ b/rss-generator.py @@ -143,11 +143,26 @@ def create_rss_feed(apps_data, feed_name, feed_description, output_file): description_sections.append('

Description

') description_sections.append(description) - # Add screenshot if available - if 'screenshot_url' in app and app['screenshot_url']: - description_sections.append('

Screenshot

') - screenshot_url = str(app['screenshot_url']) - description_sections.append(f'Screenshot') + # Add screenshots if available (now handles multiple) + if 'screenshots' in app and isinstance(app['screenshots'], list) and len(app['screenshots']) > 0: + description_sections.append('

Screenshots

') + screenshots_html = [] + for idx, screenshot in enumerate(app['screenshots'], 1): + if isinstance(screenshot, dict) and 'url' in screenshot: + url = str(screenshot['url']) + hardware = screenshot.get('hardware', '') + width = screenshot.get('width', 144) + height = screenshot.get('height', 168) + + # Add hardware label if available + if hardware: + screenshots_html.append(f'

Screenshot {idx} ({hardware})

') + else: + screenshots_html.append(f'

Screenshot {idx}

') + + screenshots_html.append(f'Screenshot {idx}') + + description_sections.append('\n'.join(screenshots_html)) # Add changelog if available if 'changelog' in app and isinstance(app['changelog'], list) and len(app['changelog']) > 0: @@ -200,9 +215,11 @@ def create_rss_feed(apps_data, feed_name, feed_description, output_file): else: fe.description("No description available") - # Add screenshot URL as a link with rel='enclosure' (for media) - backup for readers that support it - if 'screenshot_url' in app and app['screenshot_url']: - fe.link(href=str(app['screenshot_url']), rel='enclosure', type='image/png') + # Add all screenshot URLs as enclosures + if 'screenshots' in app and isinstance(app['screenshots'], list): + for screenshot in app['screenshots']: + if isinstance(screenshot, dict) and 'url' in screenshot: + fe.link(href=str(screenshot['url']), rel='enclosure', type='image/png') # Set publication date if available pub_date = None