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) <noreply@anthropic.com>
This commit is contained in:
Georges-Antoine Assi
2026-09-17 07:17:51 -04:00
parent c28059c328
commit 05f445a4cf

View File

@@ -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] = []