-
Notifications
You must be signed in to change notification settings - Fork 17
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
Writing to collection destroys tags #50
Comments
Right, the example definitely is just wrong, thanks for reporting this! |
Yes, as for the tags, this is something I also spotted yesterday. I have already added a quick warning message when writing out that tags will probably have hickups. I'm not yet sure how to fix this though. I don't understand the database in this respect yet. |
I see. Due to the wording or maybe my misinterpretation, I thought it meant problems regarding syncing with the anki-server and not that anki will be unable to find the tagged cards.
|
True, I also didn't expect that there would also be issues with even finding the cards... (or that even existing tags can't be found). This is quite bad indeed. |
Though I have to say that I'm still surprised that this should affect existing tags. Because basically we don't even touch the part of the database which might contain some information about the tags, but really only write out the notes table if this is the one that was modified. |
I can confirm that this is happening. :/ |
Hi @exc4l I'm currently not sure if I can fix this properly, as writing info metadata (tags) and the like to anki doesn't work and I don't know how to fix this. However, here is a workaround: If you first select "Notes > Clear unused notes" and then "Tools > Check Database", it seems to work for me. |
Can you confirm if this is working? |
Doesn't work for me. Is your message wrong or do you actually mean clear unused notes instead of tags? |
No, for me it worked as I described above. Hmm :/ |
This will probably require more reverse engineering about how to access anki's "tags" SQL table. Unfortunately, it's using something called "unicase" in this table yet which I have yet to somehow include in order to even open the table.... |
Perhaps we should look for someone who's working on ankidroid or similar projects to help out here.. |
I can confirm that this wokaround is working for anki 2.1.35 Guess something changed with the newer versions and it didn't work on my main due to me using an older anki version. |
Oh, I'm relieved! Still, I hope we can figure out how to do this properly in the long run.... |
MWE:
col.summarize_changes() for this:
This doesn't result in an immediate error but after opening anki the card browser is unable to find notes/cards by tag.
In the testing profile, I do have 32 notes tagged with 'leech'.
After writing when searching by the leech tag it shows no notes.
The notes are still there and if I search for them manually I can see that they indeed do have the leech tag.
If I, after now manually selecting them, do a search again for the leech tag, they do appear but also only the ones I selected manually.
When using the .add_tag() function the new tags do show up in the notes but it's the same with the leech tag. The card browser is only able to find the new tag after I manually selected the cards.
This isn't fixed by anki's "check database" function.
As mentioned before I'm using an older anki version. If you aren't able to reproduce this let me know and I will see that I try the same with the newest anki version.
Furthermore, as you might see I'm doing the selection a bit different than your example in the readme. This example:
results in:
Could the first part be relating to #32 ? In my case no duplicates seem to be created though.
The text was updated successfully, but these errors were encountered: