mirror of
https://github.com/rommapp/romm.git
synced 2026-02-18 00:27:41 +01:00
stop RA from crashing when not available
This commit is contained in:
@@ -94,12 +94,18 @@ class RAHasherService:
|
||||
f"Executing {hl('RAHasher', color=LIGHTMAGENTA)} for platform: {hl(RA_ID_TO_SLUG[platform_id])} - file: {hl(file_path.split('/')[-1])}"
|
||||
)
|
||||
args = (str(platform_id), file_path)
|
||||
proc = await asyncio.create_subprocess_exec(
|
||||
"RAHasher",
|
||||
*args,
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
stderr=asyncio.subprocess.PIPE,
|
||||
)
|
||||
|
||||
try:
|
||||
proc = await asyncio.create_subprocess_exec(
|
||||
"RAHasher",
|
||||
*args,
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
stderr=asyncio.subprocess.PIPE,
|
||||
)
|
||||
except FileNotFoundError:
|
||||
log.error("RAHasher executable not found in PATH")
|
||||
return ""
|
||||
|
||||
return_code = await proc.wait()
|
||||
if return_code != 1:
|
||||
if proc.stderr is not None:
|
||||
|
||||
@@ -147,7 +147,7 @@ class FSResourcesHandler(FSHandler):
|
||||
shutil.rmtree(cover_path)
|
||||
except FileNotFoundError:
|
||||
log.warning(
|
||||
f"Couldn't remove cover from '{hl(entity.name or entity.id, color=BLUE)}' since '{cover_path}' doesn't exists."
|
||||
f"Couldn't remove cover from '{hl(entity.name or str(entity.id), color=BLUE)}' since '{cover_path}' doesn't exists."
|
||||
)
|
||||
|
||||
return {"path_cover_s": "", "path_cover_l": ""}
|
||||
|
||||
@@ -160,6 +160,7 @@ async def scan_platform(
|
||||
platform_attrs["igdb_id"]
|
||||
or platform_attrs["moby_id"]
|
||||
or platform_attrs["ss_id"]
|
||||
or platform_attrs["ra_id"]
|
||||
):
|
||||
log.info(
|
||||
emoji.emojize(
|
||||
@@ -264,12 +265,12 @@ async def scan_rom(
|
||||
"summary": rom.summary,
|
||||
"igdb_metadata": rom.igdb_metadata,
|
||||
"moby_metadata": rom.moby_metadata,
|
||||
"url_cover": rom.url_cover,
|
||||
"url_manual": rom.url_manual,
|
||||
"path_cover_s": rom.path_cover_s,
|
||||
"path_cover_l": rom.path_cover_l,
|
||||
"path_screenshots": rom.path_screenshots,
|
||||
"url_cover": rom.url_cover,
|
||||
"url_screenshots": rom.url_screenshots,
|
||||
"url_manual": rom.url_manual,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user