From 05f445a4cf18a5cd3c20fb80380565fc8834fb1a Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Thu, 17 Sep 2026 07:17:51 -0400 Subject: [PATCH] refactor(scan): ask the handler whether a rom is a folder `directory_exists` and `Rom.full_path` already spell out the check the scan does at its own call site, so the path is no longer rebuilt here. Co-Authored-By: Claude Opus 5 (1M context) --- backend/handler/filesystem/roms_handler.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/handler/filesystem/roms_handler.py b/backend/handler/filesystem/roms_handler.py index b38640dbc..5aba04cfd 100644 --- a/backend/handler/filesystem/roms_handler.py +++ b/backend/handler/filesystem/roms_handler.py @@ -11,8 +11,6 @@ from dataclasses import dataclass, field from pathlib import Path from typing import Any, Final, NotRequired, TypedDict -from anyio import Path as AnyioPath - from adapters.services.sigil import ( SIGIL_PLATFORM_SLUGS, SWITCH_PLATFORM_SLUGS, @@ -600,7 +598,7 @@ class FSRomsHandler(FSHandler): # non-hashable platforms like Switch. sigil_platform = extract_title_ids and rom.platform_slug in SIGIL_PLATFORM_SLUGS is_switch = rom.platform_slug in SWITCH_PLATFORM_SLUGS - is_multi_part = await AnyioPath(f"{abs_fs_path}/{rom.fs_name}").is_dir() + is_multi_part = await self.directory_exists(rom.full_path) sigil_extractions: list[SigilExtractionResult] = [] embed_candidates: list[TitleIdEmbedCandidate] = [] title_id_sources: list[_TitleIdSource] = []