-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings_schema.py
More file actions
100 lines (96 loc) · 2.63 KB
/
Copy pathsettings_schema.py
File metadata and controls
100 lines (96 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
"""Settings key registry: one source of truth for keys in state["settings"].
Unknown keys are dropped on save; when adding a setting, add it here and validate it in _save_settings_locked.
"""
KNOWN_SETTINGS = {
# watch folders and import
"watch_folders",
"storefront_auto_import",
"emulator_scan_configs",
"import_exclusions",
# launch and sessions
"track_session_history",
"tracking_mode",
"tracking_delay",
"tracking_frequency",
"tracking_process_name",
"progress_automation_enabled",
"progress_automation_play_minutes",
"progress_automation_idle_days",
"progress_on_first_play",
"auto_close_store_clients",
"apply_perf",
# library presentation
"library_view",
"cover_grouping",
"list_columns",
"image_group",
"image_group_by_platform",
"image_group_by_playlist",
"badge_visibility",
"hidden_sidebar_sections",
"sidebar_sections",
"theme",
"theme_by_platform",
"platform_categories",
"platform_documents",
"custom_field_defs",
"filter_presets",
# media and metadata
"media_download_limit",
"auto_import_media_types",
"region_priority",
"video_priority",
"library_music",
"video_bgm_mix",
"active_media_packs",
# big box and display
"bigbox_mode",
"bigbox_quick",
"bigbox_startup_video",
"bigbox_shutdown_commands",
"attract_mode_seconds",
"screensaver_seconds",
"locale",
# commands
"startup_commands",
"shutdown_commands",
# backup and cloud
"backup_on_close",
"save_backup_limit",
"cloud_folder",
"last_cloud_sync",
"last_update_check",
# integrations
"obs_auto_attach",
"obs_recording_path",
"gameyfin_url",
"gameyfin_username",
"gameyfin_password",
"gameyfin_password_set",
"gameyfin_provider",
"gameyfin_install_dir",
"ludusavi_backup_path",
# webhooks
"webhooks",
"webhook_attempts",
"webhook_timeout",
# controller prompts and mapping
"controller_map",
"controller_prompt_hint",
"controller_prompt_pack",
# window and tray
"tray_enabled",
"minimize_to_tray",
# onboarding
"welcome_completed",
# misc UI toggles
"show_playlist_actions",
"dynamic_play_button",
"gamescope_guest",
}
def sanitize_settings(settings):
"""Return a copy of settings containing only known keys; unknown keys are dropped (names returned)."""
if not isinstance(settings, dict):
return {}, []
dropped = [key for key in settings if key not in KNOWN_SETTINGS]
return {key: value for key, value in settings.items() if key in KNOWN_SETTINGS}, dropped