Open RickBrasilRS opened 1 month ago
I was about to suggest this, nice!
In Rails, we use dependent: :destroy
when setting up relations in the model. I don't really know if there's something like this you (@daledesilva ) could do.
If you need any help investigating this, I'm up to it. I saw that you said you won't be opening to code contribution, but you didn't say anything about research contribution. But if you don't like it, it's okay.
I'm always open to any suggestions and thoughts/research you wanna put in here.
Off the top of my head, here's how I would probably implement it...
If a note is deleted, check if any ink embeds in the note have any writing in them. If they don't, delete the source of the ink embed silently.
Also, if the note isn't deleted, but the embed is removed from the note, do the same check.
If the ink files do have writing, in either case, check if it is embedded in any other notes. If it is, silently leave the ink source as is. If it's not in any other notes, ask the user if they want to delete the ink source files as well (as they are not used anywhere else).
The same would apply to drawings.
There's some potential for customisability here or automatic deletion with a times undo button and other refinements like that, but that's the general gist I think.
Thoughts?
Oh, actually, I think I'd check if it's used in other notes first. So you don't get confused if you purposely put an empty ink file in multiple notes so you can populate them later.
This plugin is excellent and I use it daily! Thank you for creating it! I think it would be a good idea to have an option to automatically delete files generated by Ink when the Obsidian note is deleted by the user. This option would allow you to reduce the volume of files in your vault, preventing Ink files from remaining in your vault unnecessarily. Thank you for you attention.