last fixes

This commit is contained in:
Georges-Antoine Assi
2026-04-03 11:49:32 -04:00
parent bae0d0c698
commit 6abf60b0fe
4 changed files with 7 additions and 8 deletions

View File

@@ -99,9 +99,9 @@ XML_TAG_MAP: Final = {
def _make_file_uri(platform_dir: str, raw_text: str) -> str:
cleaned_text = raw_text.replace("./", "")
joined_path = os.path.join(platform_dir, cleaned_text)
fs_platform_handler.validate_path(joined_path)
return f"file://{joined_path}"
joined_path = Path(platform_dir, cleaned_text)
fs_platform_handler.validate_path(str(joined_path))
return f"file://{joined_path.as_posix()}"
def extract_media_from_gamelist_rom(

View File

@@ -258,7 +258,7 @@ class HLTBHandler(MetadataHandler):
:return: A dictionary with the json result.
:raises HTTPException: If the request fails or the service is unavailable.
"""
if not self.security_token:
if not self.security_token or not self.hp_key or not self.hp_val:
return {}
httpx_client = ctx_httpx_client.get()
@@ -273,8 +273,7 @@ class HLTBHandler(MetadataHandler):
}
# Some HLTB endpoints require the key:val in the payload
if self.hp_key and self.hp_val:
payload[self.hp_key] = self.hp_val
payload[self.hp_key] = self.hp_val
log.debug(
"HowLongToBeat API request: URL=%s, Headers=%s, Payload=%s, Timeout=%s",

View File

@@ -20,7 +20,7 @@ def file_uri_for_local_path(path: Path) -> str | None:
relative = path.resolve().relative_to(LAUNCHBOX_LOCAL_DIR.resolve())
except ValueError:
return None
return f"file://{str(relative)}"
return f"file://{relative.as_posix()}"
def coalesce(*values: object | None) -> str | None:

View File

@@ -86,7 +86,7 @@ def test_empty_config_loader():
)
)
assert loader.config.EXCLUDED_PLATFORMS == DEFAULT_EXCLUDED_DIRS
assert loader.config.EXCLUDED_PLATFORMS == sorted(DEFAULT_EXCLUDED_DIRS)
assert loader.config.EXCLUDED_SINGLE_EXT == sorted(
{e.lower() for e in DEFAULT_EXCLUDED_EXTENSIONS}
)