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

Sort the list of decks in the deck selection #46

Open
gehacktesj opened this issue Jun 16, 2024 · 3 comments
Open

Sort the list of decks in the deck selection #46

gehacktesj opened this issue Jun 16, 2024 · 3 comments

Comments

@gehacktesj
Copy link

I really like the plugin, but the one thing that drives me crazy is that the deck selection shows the list of decks in a random order.
Given that there is not yet any support for sub decks (#45 ) this can make finding the deck to edit quite painful depending on one's deck hirarchy.

I have made some changes locally that achieve the sorting, and am happy to create a pull request, but as I am not familiar with anki's addon api my solution might be quite bad/inefficient.
(I feel like it should be possible to tell the db querry to give me the results in a sorted way, but haven't explored how/whether that's possible, so for now I sort the list and keep track of the original indices)

@TheRealXerox
Copy link

TheRealXerox commented Sep 7, 2024

init.zip

Hi, I'm some random person so don't think I'm a dev or anything. But I wanted the same thing so I just modified the code in the file "init.py"

just replace the file save the original as a backup, only the
"def add_pitch_dialog():"
method was changed

My edits both add alphabetical sort and support for subdecks.
@IllDepence
if you see this feel free to use this code. Chat GPT made it anyway lol but it works well.

@TheRealXerox
Copy link

Also if by any chance your using a deck with Html Ruby Formatting, this addon as well as many others dont handle it well, so I made an addon which converts the html ruby to somthing addons can use easier

https://ankiweb.net/shared/info/1090067124

@IllDepence
Copy link
Owner

@IllDepence
if you see this feel free to use this code. Chat GPT made it anyway lol but it works well.

Thank you for sharing and the honesty ^_^'

If you like, you could open a pull request with the changes, then we could go through the common process of code contribution to repositories like this one. If that sounds like a hassle, let me know and I’ll look at the code on my side and decide whether to integrate it or not.

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

No branches or pull requests

3 participants