Skip to content

fix: select most specific launcher instead of first match#537

Merged
wizzomafizzo merged 1 commit intomainfrom
fix/launcher-specificity-selection
Feb 12, 2026
Merged

fix: select most specific launcher instead of first match#537
wizzomafizzo merged 1 commit intomainfrom
fix/launcher-specificity-selection

Conversation

@wizzomafizzo
Copy link
Member

Summary

  • Add specificity scoring to FindLauncher() so system-specific launchers (Folders, SystemID, Schemes) take precedence over generic ones — fixes Generic .sh launcher preempting the Ports esapi.APILaunch launcher on Batocera
  • Move Batocera's Generic launcher definition after the esde.SystemMap loop as defense-in-depth
  • Add 8 tests covering specificity scoring, scheme priority, folder+system vs system-only, generic-alone, no-match, allowlist, and tie-breaking

Closes #535

FindLauncher() used first-match-wins which caused Generic launchers to
take precedence over system-specific launchers when they appeared earlier
in the array. On Batocera, this meant .sh files in /roms/ports/ launched
via Generic (exec.Command) instead of the Ports launcher (esapi.APILaunch).

Add specificity scoring (Schemes +1000, Folders +100, SystemID +10) and
pick the highest-scoring match. Also reorder Batocera's Generic launcher
to appear after esde.SystemMap launchers as defense-in-depth.
@sentry
Copy link

sentry bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 84.37500% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/platforms/batocera/platform.go 44.44% 4 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@wizzomafizzo wizzomafizzo merged commit a1e7185 into main Feb 12, 2026
11 checks passed
@wizzomafizzo wizzomafizzo deleted the fix/launcher-specificity-selection branch February 12, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zaparoo fails to correctly launch native Linux games on Batocera v42

1 participant