kra-mo / cartridges

A GTK4 + Libadwaita game launcher
GNU General Public License v3.0
661 stars 35 forks source link

Can't import Retroarch #276

Open RFLEpicGamer opened 4 months ago

RFLEpicGamer commented 4 months ago

Describe the bug If i try to import retroarch i get utf-8 error

To Reproduce Steps to reproduce the behavior:

  1. Open Cartridges
  2. Click on Add Game
  3. Import Game

Expected behavior Import Retroarch Sucessfully

Screenshots image

Logs root INFO - Scanning source desktop root INFO - Source bottles skipped, bad location root INFO - Source heroic skipped, bad location root INFO - Source legendary skipped, bad location root INFO - Scanning source flatpak root INFO - Scanning source itch root INFO - Scanning source retroarch root INFO - Scanning source steam root INFO - Scanning source lutris root ERROR - UnicodeDecodeError in retroarch Traceback (most recent call last): File "/app/lib/python3.11/site-packages/cartridges/importer/importer.py", line 181, in source_task_thread_func iteration_result = next(iterator) ^^^^^^^^^^^^^^ File "/app/lib/python3.11/site-packages/cartridges/importer/retroarch_source.py", line 77, in iter playlist_json = json.load(open_file) ^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/json/init.py", line 293, in load return loads(fp.read(), ^^^^^^^^^ File "", line 322, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x91 in position 234: invalid start byte /home/rflepicgamer/.itch/itch root INFO - Import done

System (please complete the following information):

Additional context Idk if anyone else have this problem before

kra-mo commented 4 months ago

@RilicTheFox @GeoffreyCoulaud I defer to you on this one.

kra-mo commented 4 months ago

All of these labels were accidental…

sukarn-m commented 3 months ago

I'm seeing a similar error, but not exactly the same:

root INFO - Scanning source retroarch
root ERROR - UnicodeDecodeError in retroarch
Traceback (most recent call last):
  File "/app/lib/python3.11/site-packages/cartridges/importer/importer.py", line 181, in source_task_thread_func
    iteration_result = next(iterator)
                       ^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/cartridges/importer/retroarch_source.py", line 77, in __iter__
    playlist_json = json.load(open_file)
                    ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 293, in load
    return loads(fp.read(),
                 ^^^^^^^^^
  File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 105: invalid start byte

Flatpak based Cartridges and RetroArch.

L-28 commented 1 week ago

The error (in my case at least) probably lies in the RetroArch playlist files.

To fix it temporatily you can:

  1. Go to the RetroArch playlist files located in ~/.config/retroarch/playlists/
  2. Open the playlists files and delete all characters located between the second pair of quotation marks. "base_content_directory": "[HERE ]",
  3. Save the files, restart cartridges and import the games.