z411 / trackma

Open multi-site list manager for Unix-like systems. (ex-wMAL)
https://z411.github.io/trackma
GNU General Public License v3.0
761 stars 82 forks source link

[Qt] Crash when trying to open Settings menu #709

Closed alsoGAMER closed 9 months ago

alsoGAMER commented 9 months ago
❯ export QT_QPA_PLATFORM=xcb trackma-qt
Trackma-qt v0.8.6
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Engine: Trackma v0.8.6 - using account alsoGAMER(anilist).
Engine: Reading config files...
Data: Initializing...
libanilist: Initializing...
Data: Using libanilist (anime)
libanilist: Downloading list...
Engine: Parsing redirection file...
Ready.
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/trackma/ui/qt/mainwindow.py", line 1268, in s_settings
    dialog = SettingsDialog(
             ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/trackma/ui/qt/settings.py", line 479, in __init__
    self._load()
  File "/usr/lib/python3.11/site-packages/trackma/ui/qt/settings.py", line 498, in _load
    self.tracker_update_wait.setValue(
TypeError: setValue(self, val: int): argument 1 has unexpected type 'float'
zsh: IOT instruction (core dumped)  export QT_QPA_PLATFORM=xcb trackma-qt
alsoGAMER commented 9 months ago

Root cause identified Some other frontend is setting tracker_update_wait_s value as a float, a type that the QT frontend can't handle (even though at least the GTK one, can).

Manually changing the value inside the config file fixes the issue, though this should be investigated further in my opinion. cc @FichteFoll @z411

config.json content:

{
    "auto_date_change": true,
    "auto_status_change": true,
    "auto_status_change_if_scored": true,
    "autoretrieve": "always",
    "autoretrieve_days": 3,
    "autosend": "size",
    "autosend_at_exit": true,
    "autosend_minutes": 60,
    "autosend_size": 4,
    "debug_disable_lock": true,
    "jellyfin_api_key": "",
    "jellyfin_apikey": "",
    "jellyfin_host": "localhost",
    "jellyfin_port": "8096",
    "jellyfin_user": "",
    "kodi_host": "localhost",
    "kodi_obey_update_wait_s": false,
    "kodi_passwd": "",
    "kodi_port": "8080",
    "kodi_user": "",
    "library_autoscan": false,
    "library_full_path": false,
    "player": "/home/alsog/mpv",
    "plex_host": "localhost",
    "plex_obey_update_wait_s": false,
    "plex_passwd": "",
    "plex_port": "32400",
    "plex_ssl": false,
    "plex_user": "",
    "plex_uuid": "0cfa7634-44e3-11ed-ba02-a41731a218f3",
    "redirections_time": 1,
    "redirections_url": "https://raw.githubusercontent.com/erengy/anime-relations/master/anime-relations.txt",
    "scan_whole_list": false,
    "searchdir": [
        "~/Videos"
    ],
    "title_parser": "aie",
    "tracker_enabled": false,
    "tracker_ignore_not_next": true,
    "tracker_interval": 10,
    "tracker_not_found_prompt": false,
    "tracker_process": "mplayer|mplayer2|mpv",
    "tracker_type": "local",
    "tracker_update_close": false,
    "tracker_update_prompt": false,
    "tracker_update_wait_s": 123.0,
    "use_hooks": true
}
z411 commented 9 months ago

It's most probably the GTK interface; I'm assuming this should use get_value_as_int():

https://github.com/z411/trackma/blob/master/trackma/ui/gtk/settingswindow.py#L403

alsoGAMER commented 9 months ago

Just tried that on my local machine and that seemed to be the issue, which is now fixed. I'm gonna make a pull request asap.