Released plugin Joplin Batch

Released Joplin plugin Joplin Batch version 0.1.0. Previously, it was a web application called Joplin Batch Web. Now it can be directly installed as a Joplin plugin for offline use. In the future, I will attempt to support mobile platforms.

Handle some batch operations that Joplin itself doesn't support, compatible with Joplin desktop/mobile versions.

  • Clean up unused attachment resources
  • Search and replace across all notes



Download link: Release joplin-batch@0.1.0 · rxliuli/joplin-utils · GitHub

16 Likes

Great work! Thanks.

1 Like

Release 0.2.0, Compatible with mobile devices.

Download link: Release joplin-batch@0.2.0 · rxliuli/joplin-utils · GitHub

11 Likes

Use with caution!
Deletes pictures from notes in history.
Recovering such a note will be than incomplete, pictures are gone.

1 Like

Yes, this will clean up the images in the history, but this is where the preview images come into play. Users should be able to check through the previews whether an image should be deleted or not. in any case, a backup should be made before performing any bulk operations.

1 Like

Thanks for Your reply.

But what is the sense?

  1. not deleteting a note in history but holding it without the important part (pictures).
  2. the effort needed, to go through all deletable pictures can be heavy too. At the end: For what?

Is it possible to use regex for 'search and replace' function?

E.g. I converted from evernote to joplin and have now many notes with e.g. the following text/link in it:

Bestellung: #[028-5659582-7620329](https://www.amazon.de/gp/r.html?C=EY07A4VFU)

I want to remove all those # which stands in front of the links.
E.g. search for Bestellung: #[ and replace it with Bestellung: [?

Do I have to escape #[ characters in any way?

Could I fine tune this search to include some regex to check for e.g. at least 3 digits (\d) after the [?

Thanks

1 Like

After some refactoring or cleanup of notes, there will be a lot of unlinked resources left. If I check on any resources without link in Joplin with this utility, I can free a lot of memory in the resources folder.

Release joplin-batch@0.2.2, Fixed an issue where notes without any matching items would be searched, ref: #104


2 Likes

Hi, I'm using the Joplin desktop client, and installed the Joplin batch plugin.

Where in the client interface do I trigger this plugin?
Specifically, I want to check /home/blackfrank/.config/joplin-desktop/resources/ for orphaned files... per a manual check I suspect I have approx 26k deletable orphan files (7+ GB)


Joplin 3.0.13 (prod, linux)
Client ID: 7965d57c4ca34af58aebfa5c83dd20f5
Sync Version: 3
Profile Version: 47
Keychain Supported: No
Revision: 599cf5b
Joplin Batch: 0.2.2
Markdown Prettier: 0.1.0
image

I do not have that menu option?
image
EDIT - I just upgraded to Joplin 3.0.15, still don't have that menu option.

Strange, are there any errors in DevTools?

I followed these instructions - How to enable debugging | Joplin

Full console history here - joplinconsole.txt (41.1 KB)

Possibly relevant finding -

plugin markdown-prettier follows this 3 step load pattern -
step 1
/tmp/.mount_JoplincMcIPY/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:270 17:03:52: PluginService: Loading plugin from /home/blackfrank/.config/joplin-desktop/cache/shufo.markdown-prettier
step 2
/tmp/.mount_JoplincMcIPY/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:270 17:03:53: joplin.plugins: Starting plugin: shufo.markdown-prettier
step 3
/tmp/.mount_JoplincMcIPY/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:270 17:03:53: joplin.plugins: Finished running onStart handler: shufo.markdown-prettier (Took 226ms)

but for plugin joplin-batch I only see this 1 step load pattern -
step 1
/tmp/.mount_JoplincMcIPY/resources/app.asar/node_modules/@joplin/utils/dist/Logger.js:270 17:03:52: PluginService: Loading plugin from /home/blackfrank/.config/joplin-desktop/cache/rxliuli.joplin-batch

Should there be a step 2 and maybe step 3 as with markdown-prettier?

Nothing useful in log.txt

I apologize for the late reply. Currently, I'm using a Mac and haven't encountered this issue. I don't have a laptop with Linux installed, but I'll try to reproduce this error later using a virtual machine

No worries, let me know if there's anything else I can do.
If it matters re yr VM setup - I use Ubuntu 22.04.4 LTS.

Sorry but it seems there is not any relate to Linux, I have the same Ubuntu 22.04.4 LTS, but I can see the menu option "Joplin Batch"
Screenshot from 2024-09-01 11-44-47

Perhaps you could try disabling other plugins first and only enable Joplin Batch. There might be conflicts between different plugins. Also, try this new version; I've added an error log. If an error occurs, it should be printed out.

rxliuli.joplin-batch.jpl (413 KB)

Solved, though I'm not sure exactly what fixed it...

  1. I disabled my sole other plugn-in --> markdown-prettier + restarted joplin - no change.
  2. uninstalled markdown-prettier + restarted joplin - no change.
  3. uninstalled joplin-batch, reinstalled old version + restarted joplin - no change.
  4. uninstalled joplin-batch, installed new version, restarted - FIXED.
  5. uninstalled new joplin-batch version, reinstalled old version, restarted - still FIXED
  6. reinstalled markdown-prettier, restarted - still FIXED.

Regardless, thanks for the help. The (old) plugin is now scanning for unused resources.

I don't understand... Is there anyone familiar with Joplin Plugin development who can help me review the code? The main thread code is less than 100 lines, and I don't understand what could be causing this situation.