krmanik / Sentence-Adder-Anki-Addon

Add sentences to Anki editor window in one click
GNU Affero General Public License v3.0
14 stars 6 forks source link

Error in Batch Adder #11

Closed BurakKrkmz closed 2 years ago

BurakKrkmz commented 2 years ago

Hello, I've been using this add-on for a while and I love it. You've saved me hours of work. Thank you.

After the last update, I am able to add sentences to a single card but I'm getting an error when I'm trying to batch add them to multiple cards. I've tried reinstalling but nothing changed.


Debug info:
Anki 2.1.44 (b2b3275f) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2022-06-20 22:58:12

Caught exception:
Traceback (most recent call last):
  File "C:\Users\.....\AppData\Roaming\Anki2\addons21\1682655437\batch_edit.py", line 111, in <lambda>
    action.triggered.connect(lambda x, b=browser: onSentenceBatchEdit(b))
  File "C:\Users\......\AppData\Roaming\Anki2\addons21\1682655437\batch_edit.py", line 103, in onSentenceBatchEdit
    dlg = SentenceBatchEdit(browser, nids)
  File "C:\Users\.....\AppData\Roaming\Anki2\addons21\1682655437\batch_edit.py", line 39, in __init__
    note_type = self.mw.col.get_note(nid).note_type()
AttributeError: 'Collection' object has no attribute 'get_note'

Btw I'm really glad that you've added a limiter to sentences lengths, if I could give one suggestion it would be the ability to blacklist words. Tatoeba's English depository have a lot of sentences with Albania for some reason.

krmanik commented 2 years ago

get_note implemented in Anki 2.1.53 and your Anki version is 2.1.44 so it needs to revert the changes. Next update will have the fixes.

BurakKrkmz commented 2 years ago

Oh, now that I updated anki it works. Thank you very much!