Vilhelm-Ian / anki-search-inside-add-card

An add-on providing full-text-search and PDF reading functionality to Anki's Add card dialog
https://ankiweb.net/shared/info/1781298089
GNU Affero General Public License v3.0
11 stars 3 forks source link

Can't import pdf #8

Closed OuraN2O closed 6 months ago

OuraN2O commented 7 months ago

Describe the bug Can't import new pdf, pop-up appears with "anki encountered a problem"

To Reproduce Steps to reproduce the behavior:

  1. Try importing a new pdf (with the button of by dragging a pdf)
  2. See error

Expected behavior Should be able to import

Screenshots image Environment (please complete the following information):

OuraN2O commented 7 months ago

Seems to be working on linux (anki 23.12.1 and Qt6.6.2). Weird that it stopped on my windows machine because from the time I was able to import pdfs I didn't update nor change anything. (Didn't mean to close the issue a minute ago, missclick) Also works on windows 11 anki 23.12.1 Qt5.15.2

OuraN2O commented 7 months ago

Hello, same issue is appearing on my Linux device. I found a way to fix the problem. It was to download the files and copy them in the addon folder and rewrite. But it doesn't work anymore. Reinstalling the addon completely doesn't do much either. I have the same problems as my first post

OuraN2O commented 7 months ago

[Here is the debug info provided by anki]

Anki 23.12.1 (1a1d4d54) (src) (ao) Python 3.11.8 Qt 6.6.2 PyQt 6.6.1 Platform: Linux-6.7.8-arch1-1-x86_64-with-glibc2.39

Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/aqt/webview.py", line 50, in cmd return json.dumps(self.onCmd(str)) ^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/aqt/webview.py", line 157, in _onCmd return self._onBridgeCmd(str) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/aqt/webview.py", line 680, in _onBridgeCmd handled, result = gui_hooks.webview_did_receive_js_message( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/_aqt/hooks.py", line 4481, in call handled = filter(handled, message, context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/admin/.local/share/Anki2/addons21/572933442/src/command_parsing.py", line 345, in expanded_on_bridge_cmd elif handle_notes(self, cmd): ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/admin/.local/share/Anki2/addons21/572933442/src/cmds/cmds_notes.py", line 57, in handle NoteEditor(editor.parentWindow, id) File "/home/admin/.local/share/Anki2/addons21/572933442/src/dialogs/editor.py", line 188, in init self.setup_ui() File "/home/admin/.local/share/Anki2/addons21/572933442/src/dialogs/editor.py", line 224, in setup_ui self.create_tab = CreateTab(self) ^^^^^^^^^^^^^^^ File "/home/admin/.local/share/Anki2/addons21/572933442/src/dialogs/editor.py", line 601, in init self.slider = QtPrioritySlider(self.parent.priority, self.parent.note_id, show_spec_sched=False, show_similar=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/admin/.local/share/Anki2/addons21/572933442/src/dialogs/components.py", line 58, in init self.slider.setValue(prio_default) TypeError: setValue(self, a0: int): argument 1 has unexpected type 'float'

Arbitrate3280 commented 6 months ago

Same thing happening here, I'm on Windows 11

OuraN2O commented 6 months ago

Same thing happening here, I'm on Windows 11

Hello, I made a fork of this repo with the fixes that I made. You can go to it and download the files then copy them into your already existing addon's folder. https://github.com/OuraN2O/anki-search-inside-add-card-SIAC It should work right out of the box and if you find any bugs feel free to open an issue on my github.

Hope it suits you !