danvergara / morphos

Self-hosted file converter server
MIT License
750 stars 33 forks source link

[Feature Request] Hot folders! #56

Open C-Fu opened 2 months ago

C-Fu commented 2 months ago

A way to automagically convert whatever in a folder to another format would be wonderful.

Example Files in /data/toPDF Will be converted to PDF at /data/toPDF/_converted

/data/toPNG Will be converted to PNG at /data/toPNG/_converted

Or every to* directory will be converted and stored in /data/_converted

gedw99 commented 1 month ago

the code and does is nice and clean in this code base . Nice job @danvergara

I got to admit that folders with a config that drives the conversion for each folder makes a lot of sense.

It would also allow the outputs of one folder to then trigger another folders pipeline if we extended it a little bit.

The config could also be serialised and send to a http endpoint . So then you can have a box with all the files and the file notification firing off a web hook to the worker server that then does the conversion and returns the image.

gedw99 commented 1 month ago

Nats would be a good way to easily run faster by picking up the file notifications and sending the conversion config as the payload with NATS queue.

Will ensure only one worker per file and still scale it out.

Is there a golang type that describes a conversion “ job “ ? Had a brief look but don’t see one yet .