Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ability to set review order of notes #80

Merged
merged 5 commits into from
May 28, 2021
Merged

Implement ability to set review order of notes #80

merged 5 commits into from
May 28, 2021

Conversation

z1lc
Copy link
Contributor

@z1lc z1lc commented May 15, 2021

No description provided.

Copy link
Owner

@kerrickstaley kerrickstaley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to validate this with a test verifying that when you insert a few notes with varying due values, the cards for the Note with the lowest due value comes up first when reviewing. You may have to poke around in Anki's internal API to find the "get next card to review" method.

If you don't have time to do this, I will probably get to it in the next ~week. I think this is a good change and worth merging :)

genanki/note.py Outdated
@@ -49,11 +49,12 @@ def insert(self, i, tag):
class Note:
_INVALID_HTML_TAG_RE = re.compile(r'<(?!/?[a-z0-9]+(?: .*|/?)>)(?:.|\n)*?>')

def __init__(self, model=None, fields=None, sort_field=None, tags=None, guid=None):
def __init__(self, model=None, fields=None, sort_field=None, tags=None, guid=None, due=None):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can achieve almost exactly the same behavior by changing this to due=0 and removing the @property and its setter, so I think it'd be good to simplify it.

@z1lc
Copy link
Contributor Author

z1lc commented May 23, 2021

Thanks for the fast review -- I don't know when I'll get a chance to get to it but if/when I do I'll post an update here so we don't both concurrently work on this!

@kerrickstaley kerrickstaley changed the title Implement ability to set ordering of notes Implement ability to set review order of notes May 28, 2021
@kerrickstaley kerrickstaley merged commit 6ceffc1 into kerrickstaley:master May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants