From 90fad87b9720888d2acc7ac437b47dbe37507534 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Sat, 21 Nov 2026 00:35:10 +0100 Subject: [PATCH] refactor: place core reads through gap_destination --- scripts/packs/extras.py | 6 ++---- scripts/packs/slots.py | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/scripts/packs/extras.py b/scripts/packs/extras.py index 9119c5540..911200c1b 100644 --- a/scripts/packs/extras.py +++ b/scripts/packs/extras.py @@ -29,6 +29,7 @@ from model.declarations import OUTER_ROOTS, outer_layout from core.paths import declared_destination, sanitize_pack_path from resolve.content import declares_shape, shape_fits, size_fits from resolve.validation import deliverable, read_by_build, read_from_save_dir, read_from_system_dir +from packs.gaps import gap_destination from packs.paths import libretro_systems, save_destination, save_layout from resolve.regions import FILE_GROUP @@ -1716,10 +1717,7 @@ def _second_pass_copy( if not _copies_entry(f, is_standalone, scope): return None fname = f.get("name", "") - if is_standalone: - raw = f.get("standalone_path") or f.get("path") or fname - else: - raw = system_dir_path(f, f.get("path") or fname) + raw = gap_destination(f, fname, is_standalone, False) dest = f"{raw}{fname}" if raw.endswith("/") and not fname.endswith("/") else raw # A bare name is a destination too: the core reads it at the root # of the directory core files go to, which the platform may not diff --git a/scripts/packs/slots.py b/scripts/packs/slots.py index 0162ae1d3..d5d0ea825 100644 --- a/scripts/packs/slots.py +++ b/scripts/packs/slots.py @@ -9,6 +9,7 @@ from typing import TYPE_CHECKING from core.hashing import parse_md5_list from model.declarations import declared_slot from model.profiles import entry_system_ids, lists_files +from packs.gaps import gap_destination from resolve import nativemode from resolve.archives import archive_entry, holds_required_members from core.paths import comparable_destination @@ -201,11 +202,7 @@ def profile_claims( # the member put FBNeo's msx.zip contents loose at the root. if entry.get("archive"): continue - dest = ( - (entry.get("standalone_path") or entry.get("path")) - if is_standalone - else system_dir_path(entry, entry.get("path") or entry.get("name") or "") - ) or entry.get("name") or "" + dest = gap_destination(entry, entry.get("name") or "", is_standalone, False) if not dest: continue if placement is None: