mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-24 18:47:53 -06:00
refactor: one list of the names a core goes by
model.profiles.profile_names(key, profile) gives a profile's key then
the names its cores: lists, and core_key moves there from contentlayout
with core_key_index, upstream_profile_index keyed by it. The inline
{key, *cores} sets and scans in resolve and packs read profile_names;
the two roms folder matchers read core_key_index. The parameter of
select_emulator_profiles is renamed requested.
Matching stays exact everywhere it was exact. Folding case and -/_
everywhere would merge distinct profiles: dosbox_pure (Batocera,
AmberELEC, EmuELEC) would also name dosbox-pure-unleashed, and
pcsx_rearmed would also name pcsx_rearmed_standalone (RetroPie's
pcsx-rearmed). Only roms folder rows (retrobat BSNES, Snes9x, mGBA,
emudeck vice-x64sc...) depend on the fold, and those already fold.
The alias lookup of select_emulator_profiles now compares string core
names, as every other reader does. No output change.
This commit is contained in:
1 parent
0095b23512
commit
48eb208786
10 files changed
+59
-38
No files matched your search
@@ -18,17 +18,13 @@ from resolve.layout import (
|
||||
standalone_layout_path,
|
||||
)
|
||||
from model.declarations import ROMS_ROOT, outer_layout
|
||||
from model.profiles import core_key, profile_names
|
||||
from core.paths import REPO_ROOT
|
||||
|
||||
|
||||
LIBRETRO_RUNNERS = frozenset({"libretro", "retroarch", "retroarch32", "retrorun"})
|
||||
|
||||
|
||||
def core_key(name: str) -> str:
|
||||
"""A core name as two platforms spell it alike: mame2003-plus, mame2003_plus."""
|
||||
return str(name).lower().replace("-", "_")
|
||||
|
||||
|
||||
# Set on a platform config built for one board (generate_pack, verify
|
||||
# --target): a core a roms folder offers on other boards only is not placed
|
||||
# there.
|
||||
@@ -403,7 +399,7 @@ def content_layout(
|
||||
return {**view, "files": files}
|
||||
if CONTENT_SCOPE_TAG not in tags:
|
||||
return view
|
||||
names = {core_key(n) for n in {emu_name, *(str(c) for c in view.get("cores") or [])}}
|
||||
names = {core_key(n) for n in profile_names(emu_name, view)}
|
||||
searches = [
|
||||
json.loads(t[len(ROM_SEARCH_PREFIX):])
|
||||
for t in tags if t.startswith(ROM_SEARCH_PREFIX)
|
||||
|
||||
Reference in new issue
Block a user