Example #1
0
        private async Task StartImporting()
        {
            if (!String.IsNullOrEmpty(deckPrefix))
            {
                long?id = destCol.Deck.AddOrResuedDeck(deckPrefix);
                if (id == null)
                {
                    return;
                }
                destCol.Deck.Select((long)id);
            }
            PrepareTimeStamp();
            PrepareModels();

            ImporterStateChangeEvent?.Invoke("Importing notes...");
            await ImportNotes();

            ImporterStateChangeEvent?.Invoke("Importing cards...");
            ImportCards();

            //In AnkiU we don't support static media
            //ImporterStateChangeEvent?.Invoke("Importing static media...");
            //await ImportStaticMedia();

            ImporterStateChangeEvent?.Invoke("Cleaning...");
            PostImport();
        }
Example #2
0
        private async Task PrepareFiles()
        {
            ImporterStateChangeEvent?.Invoke("Preparing collections...");
            sourceCol = await Storage.OpenOrCreateCollection(sourceFolder, relativePathToFile);

            deckMapSourceToDest = new Dictionary <long, long>();

            //WARNING: Not in java and python ver.
            await MakeSureNoConflictDeckName();
        }