fonol / 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
178 stars 24 forks source link

PDF could not be loaded after bug occurring. #237

Closed lb19940508 closed 3 years ago

lb19940508 commented 3 years ago

Bug suddenly occurred after adding cards by opening another card editor aside.

Here's the code.

Problems could be solved after restart.

Anki 2.1.35 (84dcaa86) Python 3.8.0 Qt 5.14.2 PyQt 5.14.2
Platform: Mac 10.15.7
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-03-11 22:08:53
相关扩展:⁨Searching PDF Reading  Note-Taking in Add Dialog⁩

Caught exception:
Traceback (most recent call last):
  File "aqt/webview.py", line 37, in cmd
  File "aqt/webview.py", line 123, in _onCmd
  File "aqt/webview.py", line 541, in _onBridgeCmd
  File "aqt/gui_hooks.py", line 2959, in __call__
  File "/Users/leo/Library/Application Support/Anki2/addons21/1781298089/src/command_parsing.py", line 1099, in expanded_on_bridge_cmd
    Reader.show_highlights_for_page(page)
  File "/Users/leo/Library/Application Support/Anki2/addons21/1781298089/src/web/reading_modal.py", line 1813, in show_highlights_for_page
    highlights = get_highlights(cls.note_id, page)
  File "/Users/leo/Library/Application Support/Anki2/addons21/1781298089/src/notes.py", line 1211, in get_highlights
    res = conn.execute(f"select rowid, * from highlights where nid = {nid} and page = {page}").fetchall()
sqlite3.OperationalError: no such column: None
fonol commented 3 years ago

Hi, did you maybe have an Add window and an Edit window open at the same time? The add-on doesn't work properly with two instances initialized, so that might be the issue.