Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Suggestion: Directory import watchdog #25

Open
jkrenzer opened this issue Jun 20, 2023 · 1 comment
Open

Feature Suggestion: Directory import watchdog #25

jkrenzer opened this issue Jun 20, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@jkrenzer
Copy link

Hi!

Just wanted to suggest a new feature, which would let papermerge-cli watch a directory and run an import action on a queue of new files. I think this could be implemented using the watchdog package. It supports patterns to limit the reaction to a defined set of filepath structures.

This way one could quite easily get documents scanned by a document scanning system into a directory structure to upload to papermerge. By using multiple instances of the papermerge-cli with diffferent settings, the upload could go into different folders of papermeerge dependend on naming or path of the files.

Outline

Goal would be to go over the queue with a rate limit (to not blast the papermerge api when many files added) and first check against papermerge if a document of the same file-hash is already known. If yes, the file would be ignored and the identified object-id in the database logged. If the file is not known, start an import.

If the papermerge instance is not reachable, log and recheck after a settable timespan. If the file upload fails due to reasons concerning the file, not the papermerge instance (filetype rejected for example) ignore it until the watchdog is restarted.


I would be willing familiarize myself with the code and to prepare a PR, if this feature is wanted. Just be warned, this may take some time due to a very busy schedule.

Thanks!

Jörn

@ciur ciur added the enhancement New feature or request label Jun 22, 2023
@ciur
Copy link
Member

ciur commented Jun 22, 2023

Thank you for opening this feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants