Today, I'm going to be working on the functionality to insert media like images and videos into documents for my notes app.
I'll concentrate on getting images working, but maybe I can even get support for videos implemented as well before the end of today.
**I have some decisions I need to make:**
- Where should media be saved? I'm thinking of creating an `/assets` folder automatically when the user imports some media.
- How should notes reference media? Should probably be the same way as Obsidian - just use a relative path. However, it's important that the path updates automatically if the user moves the media file elsewhere.
- What to do if there's a naming conflict? Either, the app can check if the imported media is identical - in that case, there's no reason to import a duplicate so just cancel the import and let the user know, that the media has already been imported. Otherwise, I could just add "(1)", "(2)" and so on after the file name. The last option is certainly easier, so I think I'll start with that, then I can improve it later...
Hopefully I can get it working before the end of today 🤞
Login to reply
Replies (1)
Regarding the `/assets` folder, it should just be the default location, but the user should be allowed to change it in settings. So if the user want media imports saved elsewhere, they can just choose the location.