roxgib / anki-contanki

Contanki is an add-on for Anki which allows users to control Anki using a gamepad or other controller device. To install, visit AnkiWeb or use the install code 1898790263.
GNU Affero General Public License v3.0
37 stars 4 forks source link

Add-on works initially then fails after that #80

Closed Jacwag closed 10 months ago

Jacwag commented 10 months ago

Anki 23.12.1 (1a1d4d54) (ao) Python 3.9.15 Qt 6.5.3 PyQt 6.5.3 Platform: macOS-12.6.8-x86_64-i386-64bit

When loading Contanki - Controller Support for Anki beta: Traceback (most recent call last): File "/Users/jacobwagner/Library/Application Support/Anki2/addons21/1898790263/funcs.py", line 156, in get_custom_actions key = keys[0].key() IndexError: sequence index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "aqt.addons", line 245, in loadAddons File "/Users/jacobwagner/Library/Application Support/Anki2/addons21/1898790263/init.py", line 8, in from .contanki import Contanki File "/Users/jacobwagner/Library/Application Support/Anki2/addons21/1898790263/contanki.py", line 43, in class Contanki(AnkiWebView): File "/Users/jacobwagner/Library/Application Support/Anki2/addons21/1898790263/contanki.py", line 59, in Contanki custom_actions = get_custom_actions() File "/Users/jacobwagner/Library/Application Support/Anki2/addons21/1898790263/funcs.py", line 159, in get_custom_actions key = keys[0] # type: ignore IndexError: sequence index out of range

Jacwag commented 10 months ago

Turns out you can't have a custom action that doesn't have any input or it will crash the add-on and won't let it launch again unless you delete and re-add it.

roxgib commented 10 months ago

Thanks, I couldn't reproduce this so I planned to come back to it after knocking out a few other issues. The crash is fixed with c50682f