refactor(launcher): use launch_profiles only\n\nRemove the temporary launch_scripts compatibility alias and keep the launcher

configuration surface focused on launch_profiles everywhere in the Svelte app and
docs.
This commit is contained in:
Scott Idem
2026-05-13 10:30:10 -04:00
parent b697126495
commit 49c6a2351e
4 changed files with 7 additions and 19 deletions

View File

@@ -81,7 +81,6 @@ export async function launch_from_cache({
* - Shell command: prefix with "shell:" → e.g. "shell:open \"{{path}}\""
*
* Configure via event_device.data_json.launch_profiles or $events_loc.launcher.launch_profiles.
* Legacy launch_scripts keys are still accepted by the Svelte resolver for older records.
* If null, Electron falls through to its built-in hardcoded defaults.
*/
script_template?: string | null;

View File

@@ -119,25 +119,17 @@ let screen_saver_exts = ['jpg', 'png', 'PNG', 'webp'];
* Resolves the LaunchProfile for a given file extension and optional per-file
* display override. Checked in priority order:
* 1. event_device.data_json.launch_profiles (API-driven, per-device)
* 2. event_device.data_json.launch_scripts (legacy alias)
* 3. $events_loc.launcher.launch_profiles (local persistent override)
* 4. $events_loc.launcher.launch_scripts (legacy alias)
* 5. DEFAULT_LAUNCH_PROFILES[ext] (Svelte built-in defaults)
* 6. DEFAULT_LAUNCH_PROFILES['default'] (catch-all)
* 2. $events_loc.launcher.launch_profiles (local persistent override)
* 3. DEFAULT_LAUNCH_PROFILES[ext] (Svelte built-in defaults)
* 4. DEFAULT_LAUNCH_PROFILES['default'] (catch-all)
* Per-file display_override from event_file.cfg_json overrides display_mode only.
*/
function get_launch_profile(
extension: string,
file_obj?: any
): LaunchProfile {
const device_profiles =
($ae_loc as any).native_device?.launch_profiles ??
($ae_loc as any).native_device?.launch_scripts ??
null;
const local_profiles =
($events_loc as any).launcher?.launch_profiles ??
($events_loc as any).launcher?.launch_scripts ??
null;
const device_profiles = ($ae_loc as any).native_device?.launch_profiles ?? null;
const local_profiles = ($events_loc as any).launcher?.launch_profiles ?? null;
const display_override = file_obj?.cfg_json?.display_override ?? null;
return resolve_launch_profile(extension, display_override, device_profiles, local_profiles);
}