ep1cman / unifi-protect-backup

Python tool to backup unifi event clips in realtime
MIT License
576 stars 25 forks source link

Support Rclone concurrency #153

Open cyberpower678 opened 3 weeks ago

cyberpower678 commented 3 weeks ago

Just a fair warning, I actually haven't tested this code due to lack of time, but it SHOULD in theory work as expected. Setting RCLONE_TRANSFERS will trigger the concurrency, and it will default to 1 if absent.

I also fixed a possible bug where a failed upload might drop from the missing upload event IDs list because the current_event variable may not get reset to None if something goes wrong during upload.

ep1cman commented 3 weeks ago

Thanks for this, I appreciate it. I will test this out soon and give you feedback.

cyberpower678 commented 3 weeks ago

Thoughts?

ep1cman commented 3 weeks ago

Sorry havent't had a chance to test it out yet. One initial comment I can make though, rather than loading in the env var like that, it should instead be added as a click command line parameter, which will also add an env var. Just copy whats already there.

FYI, might be worth trying to get your new download functionality into: https://github.com/uilibs/uiprotect - This is where HA have forked from and I might switch to it to avoid a certain prickly individual

cyberpower678 commented 3 weeks ago

Ah, I never looked at that file, since I run in Docker, and these code changes, I literally wrote in the GitHub edit window. :p