JackGruber / joplin-plugin-hotfolder

A plugin to Monitor a locale folder and import the files as a new note.
46 stars 4 forks source link

remove/mark imported files #7

Closed ameisbe closed 3 years ago

ameisbe commented 3 years ago

Would it be possible to remove or mark already imported files, so they do not get imported again? I had the situation, that I hat duplicate copies of the files in my hot folder and I had to manually move them out of the folder to not get even more duplicates.

Otherwise a great plugin!!

JackGruber commented 3 years ago

After the import the file would be deleted in the hotfolder. Did you get some errors in the console?

ameisbe commented 3 years ago

I had a look and yes I get the following error after placing a new file into the hotfolder

C:\Users\ame…n\lib\Logger.js:181 07:02:04: Request (1613628124068): Creating resources from paths: 0
C:\Users\ame…n\lib\Logger.js:181 07:02:04: Request (1613628124068): Saving note...
C:\Users\ame…n\lib\Logger.js:181 07:02:04: Request (1613628124068): Created note 973d02b852b64d4db141553eeda22a9e
C:\Users\ame…n\lib\Logger.js:181 07:02:14: SearchEngine: Updating FTS table...
C:\Users\ame…n\lib\Logger.js:181 07:02:14: SearchEngine: Updated FTS table in 102ms. Inserted: 1. Deleted: 0
C:\Users\ame…n\lib\Logger.js:181 07:02:34: Preparing scheduled sync
C:\Users\ame…n\lib\Logger.js:181 07:02:34: Could not run background sync:
C:\Users\ame…n\lib\Logger.js:181 07:02:34: Error: Error: Could not create directory: . Path: 
    at FileApiDriverLocal.fsErrorToJsError_ (C:\Users\ame…-driver-local.js:20)
    at FileApiDriverLocal.mkdir (C:\Users\ame…driver-local.js:120)
    at async SyncTargetFilesystem.initFileApi (C:\Users\ame…getFilesystem.js:35)
    at async SyncTargetFilesystem.fileApi (C:\Users\ame…aseSyncTarget.js:70)
    at async SyncTargetFilesystem.initSynchronizer (C:\Users\ame…getFilesystem.js:40)
    at async SyncTargetFilesystem.synchronizer (C:\Users\ame…seSyncTarget.js:106)
    at async Timeout.timeoutCallback [as _onTimeout] (C:\Users\ame…lib\registry.js:107)
JackGruber commented 3 years ago
ameisbe commented 3 years ago

Does every file remain? Yes, every file I put into the Inbox-Folder remains. Witch OS Windows 10 How big are the files? The files are between 9 KB to 2.3 MB (Textfiles, PDF, XLSX) Can you post a screenshot of the Hotfolder config I attatch a screenshon 2021-02-18 18_46_05-Joplin - Options The posted error is from the Joplin Sync (Do you have a sync target configured?) I do not have a sync target configured. I also add a screenshot

2021-02-18 18_51_20-Joplin - Options_sync-target

JackGruber commented 3 years ago

Could you please do the following steps:

Cloud you please post the output from a file imoport.

dist.zip

ameisbe commented 3 years ago

problem_hotfolder.log

I hope this works

JackGruber commented 3 years ago

@ameisbe ok I have found the reason four your problem.

The tag imp (31a07fb734b948208377a5b6a66a48c6 and db98b88cbd854581928092f7d10fb57f) occurese twice in your database. This led to an error when the tag was assigned to the note. Therefore the file was not deleted. I have release a fix for this tagging problem.

How the tag came into the Joplin database twice I don't know. Were notes imported from evernote with this tag?

ameisbe commented 3 years ago

I was looking at the stack trace a couple of minutes ago myself and got the idea to remove the tag from the preferences.It worked!

Reading our reply I do see now, that I have the "imp"tag appear twice in the sidebar. But I am pretty sure, that they were both added by my import. But I combined to imported text files with the "combine notes" plugin. Maybe thsi introduced the duplication . Just tried it and could not reproduce it. Many thanks for your analysis. And also many thnanks for your great plugin(s)