mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 10:32:57 +01:00
Merge pull request #148 from zurdi15/feature/multi_file_game
more logs improvement
This commit is contained in:
@@ -75,6 +75,7 @@ async def updateRom(req: Request, p_slug: str) -> dict:
|
||||
data: dict = await req.json()
|
||||
rom: dict = data['rom']
|
||||
updatedRom: dict = data['updatedRom']
|
||||
log.info(f"Updating {COLORS['orange']}{updatedRom['file_name']}{COLORS['reset']} details")
|
||||
r_igdb_id, file_name_no_tags, r_slug, r_name, summary, url_cover = igdbh.get_rom_details(updatedRom['file_name'], rom['p_igdb_id'], updatedRom['r_igdb_id'])
|
||||
path_cover_s, path_cover_l, has_cover = fs.get_cover_details(True, p_slug, updatedRom['file_name'], url_cover)
|
||||
updatedRom['file_name_no_tags'] = file_name_no_tags
|
||||
|
||||
@@ -136,7 +136,9 @@ def _rom_exists(p_slug: str, file_name: str) -> bool:
|
||||
def rename_rom(p_slug: str, old_name: str, new_name: str) -> None:
|
||||
if new_name != old_name:
|
||||
rom_path = _get_roms_structure(p_slug)
|
||||
if _rom_exists(p_slug, new_name): raise HTTPException(status_code=500, detail=f"Can't rename: {new_name} already exists.")
|
||||
if _rom_exists(p_slug, new_name):
|
||||
log.info(f"Can't rename {old_name} to {new_name}. {new_name} already exists")
|
||||
raise HTTPException(status_code=500, detail=f"Can't rename: {new_name} already exists.")
|
||||
os.rename(f"{rom_path}/{old_name}", f"{rom_path}/{new_name}")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user