chimera icon indicating copy to clipboard operation
chimera copied to clipboard

ROM shortcuts can't be deleted if there is a special character in game name

Open daddeltrotter opened this issue 3 years ago • 8 comments

I uploaded a game ROM and gave it a name with a special character (eg. "é" or "à"). I could not delete the game later on via steam buddy. If I select "Delete" I get a web with an error as response: "Error: 500 Internal Server Error Sorry, the requested URL 'http://gameros-sbc.local/shortcuts/delete' caused an error: Internal Server Error"

daddeltrotter avatar May 03 '21 22:05 daddeltrotter

Could you check out what the shortcut file is called? You can find it in ~/.local/share/steam-shortcuts/ somewhere

sharkwouter avatar May 04 '21 06:05 sharkwouter

In steam-buddy.gbc.yaml I have (Pokémon. I tried different versions of entering the name):

- banner: "/home/gamer/.local/share/steam-buddy/banners/gbc/Pok\xE9mon Pinball.png"
  cmd: gbc
  dir: '"/home/gamer/.local/share/steam-buddy/content/gbc"'
  hidden: false
  name: "Pok\xE9mon Pinball"
  params: "\"Pok\xE9mon Pinball.zip\""
  tags:
  - Game Boy Color
- banner: "/home/gamer/.local/share/steam-buddy/banners/gbc/Pok\xE9mon PB.png"
  cmd: gbc
  dir: '"/home/gamer/.local/share/steam-buddy/content/gbc"'
  hidden: false
  name: "Pok\xE9mon PB"
  params: "\"Pok\xE9mon PB.zip\""
  tags:
  - Game Boy Color

In steam-buddy.gba.yaml I have ried with an "à" ("Tetrisà" to check for a different emulator and a different character):

- banner: "/home/gamer/.local/share/steam-buddy/banners/gba/Tetris\xE0.png"
  cmd: gba
  dir: '"/home/gamer/.local/share/steam-buddy/content/gba"'
  hidden: false
  name: "Tetris\xE0"
  params: "\"Tetris\xE0.zip\""
  tags:
  - Game Boy Advance

daddeltrotter avatar May 04 '21 11:05 daddeltrotter

That makes a lot of sense, thanks! I think I know how to fix this. We just need to use html.unescape in some places.

sharkwouter avatar May 04 '21 12:05 sharkwouter

@sharkwouter did you figure it out how to fix this?

Samsagax avatar Jul 20 '21 23:07 Samsagax

I didn't test it, but you can probably just change this line: https://github.com/ChimeraOS/chimera/blob/202b75bc5d6537b61b0b4e502c7f025e4e924485/chimera_app/server.py#L195

To be the following:

name = html.unescape(name.strip())

sharkwouter avatar Jul 21 '21 08:07 sharkwouter

That change might be needed in shortcut delete as well. Not sure, would need testing.

sharkwouter avatar Jul 21 '21 08:07 sharkwouter

I think the solution is on urllib.parse.quote() function. Maybe https://github.com/ChimeraOS/chimera/pull/198 fixes this as well

Samsagax avatar Aug 14 '21 17:08 Samsagax

Just retested. Issue still exists.

daddeltrotter avatar Jan 19 '22 18:01 daddeltrotter