librephotos icon indicating copy to clipboard operation
librephotos copied to clipboard

Allow external process to signal file addition

Open mramirkhan opened this issue 1 year ago • 2 comments

Describe the enhancement you'd like A clear and concise description of what you want to happen.

The ability to call the backend with a file path and any new parameters that are required.

Describe why this will benefit the LibrePhotos A clear and concise explanation on why this will make LibrePhotos better.

A full scan takes quite some time, but if I'm uploading a file then there are much faster ways of detecting a file had been recently uploaded.

If this was possible then once a new file is found, calling a librephotos API to register the new file would make it appear in the photos section much faster. Also works not cause the same level of resource use disk io, cpu etc etc

This is similar to how Google photos appear instantly.

Additional context Add any other context or screenshots about the enhancement request here.

There are many things to watch for directory changes e.g

https://github.com/samuelcolvin/watchfiles https://github.com/devilbox/watcherd

mramirkhan avatar Jun 25 '23 19:06 mramirkhan

alternatively, if there is API in librephotos to scan specified file(s), we can use inotify to monitor the file changes, and call the API once changes (addtions, deletions, etc) detected.

glynnt avatar Jun 26 '23 05:06 glynnt

seems the api already supports to scan specified file(s):

python3 manage.py scan --scan-files path_to_file

glynnt avatar Jul 02 '23 03:07 glynnt