diff --git a/webui/static/script.js b/webui/static/script.js index 969c9b28..8218f1ab 100644 --- a/webui/static/script.js +++ b/webui/static/script.js @@ -56354,6 +56354,66 @@ const AUTO_HUB_GROUPS = [ { name: 'Guardian โ€” Notify', trigger_type: 'signal_received', trigger_config: { signal_name: 'guardian_quality_done' }, action_type: 'notify_only', action_config: {}, then_actions: [], group_name: 'Library Guardian', needs_notify: true }, ] }, + { + id: 'startup-recovery', icon: 'โšก', name: 'Startup Recovery', + desc: 'Self-heal after a restart. Scans your library, processes pending wishlist items, and cleans up automatically.', + category: 'Maintenance', badge: '3 automations', color: '#14b8a6', + steps: [ + { label: 'Scan Library', icon: '๐Ÿ“š', type: 'action' }, + { label: 'Process Wishlist', icon: '๐Ÿ“ฅ', type: 'action' }, + { label: 'Cleanup', icon: '๐Ÿงน', type: 'action' }, + ], + automations: [ + { name: 'Startup โ€” Scan Library', trigger_type: 'app_started', trigger_config: {}, action_type: 'scan_library', action_config: {}, then_actions: [{ type: 'fire_signal', config: { signal_name: 'startup_scanned' } }], group_name: 'Startup Recovery' }, + { name: 'Startup โ€” Process Wishlist', trigger_type: 'signal_received', trigger_config: { signal_name: 'startup_scanned' }, action_type: 'process_wishlist', action_config: {}, then_actions: [{ type: 'fire_signal', config: { signal_name: 'startup_processed' } }], group_name: 'Startup Recovery' }, + { name: 'Startup โ€” Cleanup', trigger_type: 'signal_received', trigger_config: { signal_name: 'startup_processed' }, action_type: 'full_cleanup', action_config: {}, then_actions: [], group_name: 'Startup Recovery' }, + ] + }, + { + id: 'import-pipeline', icon: '๐Ÿ“ฆ', name: 'Import Pipeline', + desc: 'After importing files, automatically scans your library, runs a quality check, and notifies you when complete.', + category: 'Maintenance', badge: '3 automations', color: '#a855f7', + steps: [ + { label: 'Scan Library', icon: '๐Ÿ“š', type: 'action' }, + { label: 'Quality Check', icon: 'โœ…', type: 'action' }, + { label: 'Notify', icon: '๐Ÿ””', type: 'notify' }, + ], + automations: [ + { name: 'Import โ€” Scan Library', trigger_type: 'import_completed', trigger_config: {}, action_type: 'scan_library', action_config: {}, then_actions: [{ type: 'fire_signal', config: { signal_name: 'import_scanned' } }], group_name: 'Import Pipeline' }, + { name: 'Import โ€” Quality Check', trigger_type: 'signal_received', trigger_config: { signal_name: 'import_scanned' }, action_type: 'start_quality_scan', action_config: {}, then_actions: [{ type: 'fire_signal', config: { signal_name: 'import_quality_done' } }], group_name: 'Import Pipeline' }, + { name: 'Import โ€” Notify', trigger_type: 'signal_received', trigger_config: { signal_name: 'import_quality_done' }, action_type: 'notify_only', action_config: {}, then_actions: [], group_name: 'Import Pipeline', needs_notify: true }, + ] + }, + { + id: 'weekly-deep-clean', icon: 'โœจ', name: 'Weekly Deep Clean', + desc: 'Comprehensive weekly sweep: find duplicates, check quality, clean up, back up, and report results.', + category: 'Maintenance', badge: '5 automations', color: '#ec4899', + steps: [ + { label: 'Duplicates', icon: '๐Ÿ“‹', type: 'action' }, + { label: 'Quality', icon: 'โœ…', type: 'action' }, + { label: 'Cleanup', icon: '๐Ÿงน', type: 'action' }, + { label: 'Backup', icon: '๐Ÿ’พ', type: 'action' }, + { label: 'Notify', icon: '๐Ÿ””', type: 'notify' }, + ], + automations: [ + { name: 'Deep Clean โ€” Duplicates', trigger_type: 'weekly_time', trigger_config: { days: ['sunday'], time: '02:00' }, action_type: 'run_duplicate_cleaner', action_config: {}, then_actions: [{ type: 'fire_signal', config: { signal_name: 'dc_dedup_done' } }], group_name: 'Weekly Deep Clean' }, + { name: 'Deep Clean โ€” Quality', trigger_type: 'signal_received', trigger_config: { signal_name: 'dc_dedup_done' }, action_type: 'start_quality_scan', action_config: {}, then_actions: [{ type: 'fire_signal', config: { signal_name: 'dc_quality_done' } }], group_name: 'Weekly Deep Clean' }, + { name: 'Deep Clean โ€” Cleanup', trigger_type: 'signal_received', trigger_config: { signal_name: 'dc_quality_done' }, action_type: 'full_cleanup', action_config: {}, then_actions: [{ type: 'fire_signal', config: { signal_name: 'dc_cleanup_done' } }], group_name: 'Weekly Deep Clean' }, + { name: 'Deep Clean โ€” Backup', trigger_type: 'signal_received', trigger_config: { signal_name: 'dc_cleanup_done' }, action_type: 'backup_database', action_config: {}, then_actions: [{ type: 'fire_signal', config: { signal_name: 'dc_backup_done' } }], group_name: 'Weekly Deep Clean' }, + { name: 'Deep Clean โ€” Notify', trigger_type: 'signal_received', trigger_config: { signal_name: 'dc_backup_done' }, action_type: 'notify_only', action_config: {}, then_actions: [], group_name: 'Weekly Deep Clean', needs_notify: true }, + ] + }, + { + id: 'beatport-fresh', icon: '๐ŸŽง', name: 'Beatport Fresh', + desc: 'Keep your Beatport charts and playlists up to date with a daily cache refresh.', + category: 'Discovery', badge: '1 automation', color: '#84cc16', + steps: [ + { label: 'Refresh Cache', icon: '๐Ÿ”„', type: 'action' }, + ], + automations: [ + { name: 'Beatport โ€” Daily Refresh', trigger_type: 'daily_time', trigger_config: { time: '05:00' }, action_type: 'refresh_beatport_cache', action_config: {}, then_actions: [], group_name: 'Beatport Fresh' }, + ] + }, ]; const AUTO_HUB_RECIPES = [ @@ -57130,7 +57190,7 @@ async function deployHubGroup(groupId) { if (created > 0) { showToast(`Deployed "${group.name}" โ€” ${created} automation${created > 1 ? 's' : ''} created${failed ? `, ${failed} failed` : ''}`, 'success'); - loadAutomationsPage(); + loadAutomations(); } else { showToast(`Failed to deploy "${group.name}"`, 'error'); }