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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate Element 105 | New (and completely different) entries are not generated properly #1

Closed
ohare93 opened this issue Nov 13, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@ohare93
Copy link
Contributor

ohare93 commented Nov 13, 2019

Thanks for the deck, mate. Glad you got it over to a Github repo! 馃憤

I pulled the latest version, as you suggested. You mentioned that 105 has changed from Hahnium to Dubnium, however my local card did not change, instead I got a duplicate! 馃槺

Looking at the card info of each (Select the card in the Browser, then click Cards -> Info) gives this for each card.

Old

Added	2017-01-20
Position	879
Card Type	Card 3
Note Type	PeriodicTable-d75c0
Deck	Miscellaneous::Periodic table memory pegs
Note ID	1484952780480
Card ID	1484952780603

New

Added	1970-01-01
Position	1
Card Type	Card 3
Note Type	PeriodicTable-d75c0
Deck	Miscellaneous::Periodic table memory pegs
Note ID	105
Card ID	419

From this it's easy to see that the Note and Card IDs are not generated as proper Guids. The same is true for the new element 106

Added	1970-01-01
Position	2
Card Type	Card 3
Note Type	PeriodicTable-d75c0
Deck	Miscellaneous::Periodic table memory pegs
Note ID	106
Card ID	423

What I believe is the solution to this:

  • Element 105 should have the same guid as it had before, in order for an import to be to update the previous card.
  • Element 106 (and all new entries) should have a new Guid generated, not simply the number of the element. Both for the Note and Card IDs. Otherwise you'll potentially run into these issues again in the future.

Thanks again for the deck mate 馃憤

@remiberthoz
Copy link
Owner

Hey! Thanks for the report.

I realise I made a mistake when updating element 105 from Hahnium to Dubnium. Anki compares notes based on a guid, which has to be conserved between updates. I failed to set the correct guid for element 105. I will fix this ASAP with a new commit and a release, but I need to figure a way to remove the duplicate.

Element 106 also as a guid set in the src/data.json file, which is imported into the sqlite3 database that you can browse by opening the .apkg file with a zip software. I do not know why Anki shows the Note ID field with a different value. I will explore this problem over the end of the week.

@remiberthoz
Copy link
Owner

remiberthoz commented Nov 13, 2019

Ok so commit 7bde7bf solves this issue partially. I will link to this comment as an update guide from version v2.1.


If you update from v2.1 to any later version, you need to manually remove the cards with Note ID 1484952780480. This cards are duplicates for Dubnium cards; so you will find them near Element 105 in the Anki cards browser. To see the Note ID of a card in the browser, right-click on a card and select Info.

@remiberthoz remiberthoz added the bug Something isn't working label Nov 13, 2019
@remiberthoz remiberthoz changed the title New (and completely different) entries are not generated properly Duplicate Element 105 | New (and completely different) entries are not generated properly Nov 13, 2019
@remiberthoz
Copy link
Owner

I spent more time on this issue today. As far as I can tell, the guid is the only value that is used to determine if imported cards are news or updates. Note ID and Card ID are internal to each Anki installation:

  • they have to remain unique in each installation
  • when importing, Anki will ensure there are no duplicates by changing the imported ID when necessary
  • the internal IDs of the database inside the .pkg file, have to be consistent from cards to notes (this is managed on creation through genanki scripts)

Thanks again to @ohare93 for reporting the issue. The guid has been fixed before, I think no more changes are required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants