Below are some useful threads (and a github issue) that I found searching the forums.
Just FYI I found these by searching the term "deleting notes", below is the first thread to come up and I clicked through it to get the rest.
Hi all,
Hope you’re able to point me in the right direction on how to achieve this!
Scenario:
Note A is created with attached images X
Note B is created with attached images Y
Note A is deleted
Note B is deleted
Note C is created with attach image Z
Question:
How do we bulk delete the all images from deleted notes (i.e. delete images X, Y but NOT images Z) under JoplinProfile\resources gracefully from the app frontend?
Note:
I’m aware Tools -> Note Attachments is possible, however this…
In general, are images deleted if I delete their links from a note?
While browsing my resources folder, I noticed hundreds of photos that no longer are related to a note. Deleting them through the attachments view is tedious as I can only delete one at a time, and then must scroll through the list again to locate the next deletion.
Could I simply delete these from the resources table folder without causing harms to the database? That would be much simpler as I can quickly see the problem files and delete in bulk.
Again, what harm, if any, would I cause by dire…
opened 07:01AM - 30 Oct 18 UTC
closed 04:49PM - 05 Oct 21 UTC
bug
high
### Operating system
- macOS
- Android
- iOS
### Application
… - Desktop
- Mobile
- Terminal
For some reason orphaned resources are not deleted. I'm currently using the latest versions on Android and iOS. On macOS I'm using 1.0.111, although I also tried 1.0.114 (until I saw that internal anchors don't work anymore - I'll open anothe issue for that one).
Here's an export of the `note_resources` table. As you can see quite a few of them don't have an associated page, yet they still exist in my `.resources` directory.
[note_resources.csv.txt](https://github.com/laurent22/joplin/files/2528370/note_resources.csv.txt)
Please let me know, if you need anything else. (There's nothing suspicious in the debug.log)
Please note that these scripts will become obsolete in the future, when the resource bugs are fixed!
A word of caution: I use the scripts myself and haven’t experienced any issues. However, use them at your own risk! It’s always a good idea to create a backup first. There’s also the --dry-run or -n option to see what happens without actually doing anything.
Use at your own risk!
Why are there 2 scripts to remove resources?
The first script jnrmor removes orphaned resources from the database a…