jdlorimer / incremental-reading

Anki add-on providing incremental reading features
https://ankiweb.net/shared/info/935264945
ISC License
216 stars 38 forks source link

Exception caused by moving up the schedule in organizer. #39

Closed levodopa closed 6 years ago

levodopa commented 6 years ago

Hey there, when I started to try the extraction feature I found a new bug :)

For explanation I wrote a plugin for importing IR Cards directly from the website of my learning system. This allows me to split down the whole content of a chapter into more subchapters to anki. I reused the just the importer part of your plugin in a separate plugin, what works so far and seems not to collide with your plugin.

But to come to the point. For me it is important that the order of the cards in review mode stays the same, so i marked in "Options" - "Scheduling" to shedule by position and turned off "Randomize".

During review the card order stays, but when i did use the extraction function to reduce the learning card to a more smaller card. It put the new card to the end of the scheduler (and of course to the end of the cardbrowser because of generating a new card with a newer date)

To get the extract in the correct schedule order again I tried to move it in the schedule in the organizer widow. Below in the screenshot you see the situation before I press the Up-Button: image Now I get the following exception:

Anki 2.1.0beta23 Python 3.6.1 Qt 5.9.2 PyQt 5.9 Platform: Windows 10 Flags: frz=True ao=True

Caught exception: File "O:\OneDrive\AnkiData 2.1\addons21\1081195335\schedule.py", line 91, in _moveUp self.cardListWidget.insertItem(newRow, row) <class 'TypeError'>: arguments did not match any overloaded call: insertItem(self, int, QListWidgetItem): argument 2 has unexpected type 'int' insertItem(self, int, str): argument 2 has unexpected type 'int' And as you see Position 7 in the order has vanished. image After clicking on "Save" and reopening the original position 7 has moved to the end of the schedule. image Moving down the schedule works!

Sorry that I wrote that much. Big thanks for your work! Your Plugin is really great!

jdlorimer commented 6 years ago

Thanks for the report. I can't believe I didn't notice this myself - it's very easy to reproduce.

Should be fixed now (d96189d).

levodopa commented 6 years ago

Thanks for the quick fix. I applied it and it seems to work!