mirror of
https://github.com/rommapp/romm.git
synced 2026-06-27 22:35:57 +00:00
last fixes
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user