This conversion itself doesn't touch the user's collection, we don't use any information from the import dialog in this conversion and there's nothing in the final CrowdAnki deck object that's not in the initial JSON. Also, the earlier we do the conversion, the less dependent we're on the specifics of the JSON implementation if we end up having alternative storage formats.
The main con might be that the conversion might be slow? (I don't think it is — AFAIU most of our slowness comes from interfacing with the Anki database — i.e. converting from our internal object to Anki's.)
(Low priority.)
To reproduce:
\n\n{{Back}}", "bafmt": "", "bfont": "", "bqfmt": "", "bsize": 0, "did": null, "name": "Card 1", "ord": 0, "qfmt": "{{Front}}" } ], "type": 0 } ], "notes": [], "reviewLimit": null, "reviewLimitToday": null } ```
Expected behaviour
The "Deck Parts to Use" says:
Actual behaviour
The "Deck Parts to Use" says:
This is because we currently only check in the main deck itself.
If we had a CrowdAnki deck object (rather than a pure JSON), we could use the
deck.get_note_count
function, so perhaps we should carry out the "deck initialization from JSON" (i.e. the conversion from JSON to "internal CrowdAnki object") before showing the dialog?This conversion itself doesn't touch the user's collection, we don't use any information from the import dialog in this conversion and there's nothing in the final CrowdAnki deck object that's not in the initial JSON. Also, the earlier we do the conversion, the less dependent we're on the specifics of the JSON implementation if we end up having alternative storage formats.
The main con might be that the conversion might be slow? (I don't think it is — AFAIU most of our slowness comes from interfacing with the Anki database — i.e. converting from our internal object to Anki's.)
(I believe the same applies to media counts.)