mortii / anki-morphs

A MorphMan fork rebuilt from the ground up with a focus on simplicity, performance, and a codebase with minimal technical debt.
https://mortii.github.io/anki-morphs/
Mozilla Public License 2.0
55 stars 8 forks source link

fixed learn now #29

Closed Vilhelm-Ian closed 10 months ago

Vilhelm-Ian commented 10 months ago

also I suggest we add this function to recalc "mw.col.sched.reposition_new_cards(selected_cards, 0, 1, False, True)" instead of changing the due date of every card. The above functions takes True as an argument which tells it to readjust all the other cards

mortii commented 10 months ago

Wow, that looks like such a clean fix. I've been hesitant to use reposition because it updates the due of all the cards in the new-queue, but it is definitely a more robust approach.

mortii commented 10 months ago

I did some quick testing and it does seem to work. Thank you so much!

Vilhelm-Ian commented 10 months ago

Wow, that looks like such a clean fix. I've been hesitant to use reposition because it updates the due of all the cards in the new-queue, but it is definitely a more robust approach.

@mortii An issue I had since recently but didn't want to mention is after pressing recalc and sync a lot of cards need to be resynced. My hunch that the issue is manually setting the due date of a lot of cards.

mortii commented 10 months ago

@mortii An issue I had since recently but didn't want to mention is after pressing recalc and sync a lot of cards need to be resynced. My hunch that the issue is manually setting the due date of a lot of cards.

Aha, that does seem to be a problem, I just assumed that they were synced because they were rightfully updated. The old (and slow) approach of using mw.col.db.executemany() to update the cards actually had a bug that made sync not work, so by now using mw.col.update_cards() sync actually works.

We probably need to have an if-statement before setting any card properties in recalc to solve this issue...

Vilhelm-Ian commented 10 months ago

can you try with "mw.col.sched.reposition_new_cards" Because when I reposition a card from the anki browser and adjust other cards it dosen't lead to long sync

mortii commented 10 months ago

can you try with "mw.col.sched.reposition_new_cards" Because when I reposition a card from the anki browser and adjust other cards it dosen't lead to long sync

very interesting, maybe that means its updating the notes that is causing the problem? I'll experiment and try to fix it.