-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Cancel on Change note type doesn't cancel #143
Comments
Yes, this is an ugly, if known, behaviour of CrowdAnki. (See #21 and here in the source code.) Sorry!
What are the * Alternatively, you could check by using this debug console snippet (you can access the debug console with repeated = {}
for model in filter(lambda model: 'crowdanki_uuid' in model,
self.col.models.all()):
cu = model["crowdanki_uuid"]
if cu in repeated:
repeated[cu] = True
else:
repeated[cu] = False
if any(repeated.values()):
print("WARNING! There are repeated Note Model uuids!")
else:
print("There are no repeated Note Model uuids! Everything is OK!") Otherwise, I'm also mystified. |
Ah this old issue. Wasn't this cancel issue fixed? Can you link us to your repo (or the PR) to see the differences between these two decks in the Brain Brew yaml? 🙏 How did you go about creating the second deck in the first place? If you exported it via CrowdAnki and put that into your repo via a Brain Brew init then there should be no issue. If you just copy/pasted your orginal deck objects in your Brain Brew repo, then perhaps your deck uuid is indeed the same 😅 |
hmmm.... Looks like I do indeed have repeaated Note Model uuids. And yes since the note types can be complicated I do clone them. And my deck has been around for a few years now as well. A lot of water has flowed under the bridge. So what is the best way to remediate this? Can I just manually go and edit/differentiate the crowdanki_uuid?
|
Make a deck in Anki, export it with CrowdAnki, copy the Uuid of the deck, and copy paste it into your new one you created in Brain Brew? Could be that simple 😅 Would probably be good to allow CrowdAnki to continue processing if the Deck Uuid is blank, and it would assume this is a new deck. |
You can indeed just edit the note model I'd recommend running the following console script which will disambiguate the non-unique from uuid import uuid1
uuids = []
for model in filter(lambda model: 'crowdanki_uuid' in model,
sorted(self.col.models.all(), key=lambda m: m["id"])):
# we're sorting in the hope that note models with higher ids
# (which mostly corresponds to creation date) were created later,
# so we change the uuid of the copies, not the original
cu = model["crowdanki_uuid"]
if cu in uuids:
new_uuid = str(uuid1())
print("Replacing UUID for note model " + model["name"] + " with " + new_uuid + " !")
model["crowdanki_uuid"] = new_uuid
self.col.models.save(model)
else:
uuids.append(cu) I hope this helps! Sorry for the problem!
Unfortunately not. :( From what I recall, it's annoying since the dialogue pops up in the middle of the import, so it's not even clear what's the right thing to do. Do we cancel the entire import (and undo any changes that have already been made) or just not modify the notes with the "problematic" note model (but what do we do with new notes with the problematic note model (just not import them?); also the user is then left in a confusing partially-imported/partially-not state)? |
Yes it did. I did have to do a brainbrew init on the crowdanki export. But everything seems to be ok now. Thanks very much for the help here! Awesome project. Crowdanki and brainbrew are the two best Anki plugins!!! |
Thanks again @aplaice, you are the king maintainer of CrowdAnki 👏 |
Hi,
I'm having an issue that probably involves also brainbrew and/or assetmanager. I have been trying to set up a second deck (lets call it Examples) to import from crowdanki. Crowdanki + brainbrew for Deck A is working just fine. Then I set up the Examples deck (ie export via crowdanki, run brainbrew init and re-import via crowdanki). Now when I go back to Import from Crowdanki and select my A deck.json, Crowdanki tells me that it is currently using the note type from the Examples Deck (see screenshot). I know this is very wrong and won't work, so I click 'Cancel'. Crowdanki imports the deck anyways with the wrong note type, and the only way I can correct this is to restore a backup.
What does appear to me to be clearly a crowdanki issue is clicking cancel and then the import proceeds.
However the fact that the wrong note type is recognized seems a mystery to me. And I totally realize that I have no error message or more information. I am wondering whether Assetmanager or Brainbrew is causing this issue. But since you guys are the experts you might have some idea or opionion on where the problem might be coming from. What could cause crowdanki to not recognize the note type for a particular deck? Thanks!
The text was updated successfully, but these errors were encountered: