rxliuli/joplin-utils

[Feat]: Please indicate the physical path of unused resources

ummmme opened this issue · 1 comments

app

joplin-batch-web

Is your feature request related to a problem? Please describe.

this is quite a good job for me to deal with the annoying orphaned files/attachments.
But I sortly got confused to figure out where the heck you actually find out the orphaned file list cause I've tried looking into the "C:\Users\balabala.config\joplin-desktop\resources" folder, and none of files on the list were found.

Do I miss anything?

Describe the solution you'd like

point out the path of every orphaned files/attachments on the web page. Or just give them a popup tips or quote area to help people knowing the phycical path where storage the orphaned attachments

Describe alternatives you've considered

nothing

Additional context

No response

But I sortly got confused to figure out where the heck you actually find out the orphaned file list

Its checking logic is

  1. Find all attachments via joplin data api
  2. Find if each attachment id has appeared in the note
  3. Filter the list of attachments that have never appeared in the note

point out the path of every orphaned files/attachments on the web page. Or just give them a popup tips or quote area to help people knowing the phycical path where storage the orphaned attachments

It's impossible to get the physical filesystem path in the web, but if you can see the image in the preview, you should be able to query it by id in the resources/ directory.
The method to get the id is

  1. Copy the image link, you will have a link like this http://localhost:41184/resources/b9a5138cf9e54f9ba9a1e58f438d884e/file?token=*
  2. The random string after /resources in the link is the id of the image