automations page: friendly labels + icons for the video maintenance actions

the video-prefixed maintenance actions (clean_search_history, clean_completed_downloads,
full_cleanup, backup_database) + the new refresh_airing_schedules weren't in the action
label/icon maps, so they fell back to the gear + raw action_type ('⚙️ video_full_cleanup').
added all five to both maps (🗓️/🗑️//🧹/💾, mirroring the music side). regression test
asserts every seeded video automation resolves a label AND an icon, so this can't recur.
This commit is contained in:
BoulderBadgeDad 2026-06-26 11:51:29 -07:00
parent 9aee723d1a
commit a30a70fafd
2 changed files with 17 additions and 0 deletions

View file

@ -110,6 +110,16 @@ def test_video_automations_poll_does_not_rebuild_when_unchanged():
assert 'var sig = JSON.stringify(' in _VAUTO
def test_every_video_automation_has_a_friendly_label_and_icon():
# regression: a video action missing from the label/icon maps falls back to the gear +
# raw action_type ("⚙️ video_clean_search_history") — inconsistent. Every seeded video
# automation must have an entry in BOTH maps in stats-automations.js.
import core.automation_engine as ae
types = {a.get("action_type") for a in ae.SYSTEM_AUTOMATIONS if a.get("owned_by") == "video"}
missing = [t for t in types if _STATS.count(t + ":") < 2] # icon map + label map
assert not missing, "video actions missing a label/icon: " + ", ".join(sorted(missing))
def test_video_system_automations_are_sorted_by_pipeline_order():
# The API returns newest-created-first (jumbled); the page re-sorts by an
# explicit order so it reads scans → processors → library → maintenance.

View file

@ -1780,6 +1780,9 @@ const _autoIcons = {
video_scan_watchlist_playlists: '\uD83C\uDFB5',
video_process_movie_wishlist: '\uD83C\uDFAC', video_process_episode_wishlist: '\uD83D\uDCFA',
video_process_youtube_wishlist: '\u2B07\uFE0F',
video_refresh_airing_schedules: '\uD83D\uDDD3\uFE0F',
video_clean_search_history: '\uD83D\uDDD1\uFE0F', video_clean_completed_downloads: '\u2705',
video_full_cleanup: '\uD83E\uDDF9', video_backup_database: '\uD83D\uDCBE',
};
// --- Inspiration Templates ---
@ -3380,6 +3383,10 @@ function _autoFormatAction(type) {
video_process_movie_wishlist: 'Process Movie Wishlist',
video_process_episode_wishlist: 'Process Episode Wishlist',
video_process_youtube_wishlist: 'Process YouTube Wishlist',
video_refresh_airing_schedules: 'Refresh Airing Schedules',
video_clean_search_history: 'Clean Search History',
video_clean_completed_downloads: 'Clean Completed Downloads',
video_full_cleanup: 'Full Cleanup', video_backup_database: 'Backup Database',
};
return labels[type] || type || 'Unknown';
}