diff --git a/AppImage/scripts/notification_templates.py b/AppImage/scripts/notification_templates.py index b9e04bae..9fd8f521 100644 --- a/AppImage/scripts/notification_templates.py +++ b/AppImage/scripts/notification_templates.py @@ -904,9 +904,14 @@ def render_template(event_type: str, data: Dict[str, Any]) -> Dict[str, Any]: 'packages': '', 'pve_packages': '', 'version': '', 'issue_list': '', 'error_key': '', 'storage_name': '', 'storage_type': '', + 'important_list': 'none', } variables.update(data) + # Ensure important_list is never blank (fallback to 'none') + if not variables.get('important_list', '').strip(): + variables['important_list'] = 'none' + try: title = template['title'].format(**variables) except (KeyError, ValueError): @@ -1256,6 +1261,10 @@ Your task is to translate and reformat incoming server alert messages into {lang - detailed → full technical breakdown of all available fields 8. Keep the "hostname: " prefix in the title. Translate only the descriptive part. Example: "pve01: Updates available" → "pve01: Actualizaciones disponibles" +9. EMPTY LIST VALUES — if the input contains a list field that is empty, "none", or "0": + - Always write the translated word for "none" on the line after the label, never leave it blank. + - Example (English input "none"): šŸ“‹ Important packages:\nšŸ“‹ none + - Example (Spanish output): šŸ“‹ Paquetes importantes:\nšŸ“‹ ninguno {emoji_instructions} ═══ KNOWN MESSAGE TYPES AND HOW TO FORMAT THEM ═══ @@ -1384,7 +1393,19 @@ AI_EMOJI_INSTRUCTIONS = """ - VM events with a reason: after the main status line, before Reason / Node / Target lines - Health events: after the category/status line, before duration or detail lines - EXAMPLE — updates message: + EXAMPLE — updates message (no important packages): + [TITLE] + šŸ“¦ amd: Updates available + [BODY] + šŸ“¦ Total updates: 55 + šŸ”’ Security updates: 0 + šŸ”„ Proxmox updates: 0 + āš™ļø Kernel updates: 0 + + šŸ“‹ Important packages: + šŸ“‹ none + + EXAMPLE — updates message (with important packages): [TITLE] šŸ“¦ amd: Updates available [BODY]