ObsidianToAnki / Obsidian_to_Anki

Script to add flashcards from text/markdown files to Anki
GNU General Public License v3.0
1.54k stars 136 forks source link

A more efficient way of updating tags + Scan current file only #584

Open MisterPresident opened 6 months ago

MisterPresident commented 6 months ago

This pull request is just a more efficient way of updating tags (using updateNoteTags vs. removeTags + addTags). This speeds up the generation task, especially if you have a big vault (2k notes) and a lot of tags in Anki (64k cards with ~16k tags). Alltogehter It should prevent Anki from dying due to a big request-payload.

Moreover, I added a command to scan the current file only.

image

This should fix #565. Maybe helps on #428, #354, #326.

rpj-07 commented 3 months ago

I just tried to download the data for the plugin from your pull request and add it to Obsidian, but it always failed with the error "Failed to load Obsidian_to_anki". Is this not the entire code that you inserted in the test_vault? I would be very interested in your modification, as I need just such a function.

MisterPresident commented 3 months ago

I think you didn't compile the code?

rpj-07 commented 3 months ago

I think you didn't compile the code?

Can you explain what do you mean with "compile"? I have github-desktop and that ist why I have copy me the/your "text_vault" and attempt the activation of the plugin "obsidian_to_anki" in this to my desktop copied vault? Is that a false way to copy that?

MisterPresident commented 2 months ago

Sorry for the late response, I'm on vacation.

You need to run the build script from the package.json"build": "rollup --config rollup.config.js", Then replace the old main.js with the new one.

I think you could also use BRAT but I never tried it.

rpj-07 commented 2 months ago

You need to run the build script from the package.json"build": "rollup --config rollup.config.js", Then replace the old main.js with the new one.

Thank you, that is work! This is a very huge improvement for my workflow, thank you very much!! Unfortunately I am not very affin with Github, if there is an official update from Obsidian_to_anki, then I have to decide whether I want to have your modified version or the new version installed, since the main.js file is changed during the update, right?

MisterPresident commented 2 months ago

Did it work? I hope that the author accepts my changes. Then this pull request would be integrated into the official version.

rpj-07 commented 2 months ago

Did it work?

Yes, it works very well! Thank for your pull request!