ep1cman / unifi-protect-backup

Python tool to backup unifi event clips in realtime
MIT License
635 stars 31 forks source link

Destination file and path names, timezone #27

Closed ep1cman closed 2 years ago

ep1cman commented 2 years ago

Discussed in https://github.com/ep1cman/unifi-protect-backup/discussions/26

Originally posted by **Amphiboly** March 9, 2022 All is working well, thank you. This is an enhancement request. I see that the destination file and path names are based on the UTC date expansion of the event start time. The result for me (in EST5EDT) is that many events are placed in a directory with the next day's date (relative to the local time). ![image](https://user-images.githubusercontent.com/10307457/157556673-b50b50af-2497-497c-968e-1b5213b619e6.png) Is there a way to use the local time to fashion the file and directory names? -- Rik
ep1cman commented 2 years ago

Are you able to test the current "main" branch to see if this fixes the issue for you before I do a release

Amphiboly commented 2 years ago

Everything looks good with the new main branch.

johnwarne commented 2 years ago

Hey there, has this been integrated into the latest Docker image? I'm still seeing UTC datetimes in the files (and their resulting directories) when using the latest Docker image.

Amphiboly commented 2 years ago

I thought that it had been fixed, but I still see UTC datetimes as well. There was an interim fix that I tested and thought it gave correct results, but after updating to from 0.52 to 0.53, the interim fix must have disappeared.

ep1cman commented 2 years ago

https://github.com/ep1cman/unifi-protect-backup/commit/0a4a2401bef3d9016322c8541c9bd23805a5368c Should have fixed this and is included in v0.5.3 (which as per: https://github.com/ep1cman/unifi-protect-backup/pkgs/container/unifi-protect-backup you can see is also the latest container image)

I will look into this now and see if I can reproduce the issue.

ep1cman commented 2 years ago

Ok I have gone and actually changed the timezone on my UDM, and it seems the previous fixed didn't fix it at all. Its strange that it worked for you @Amphiboly.

I am now working on properly fixing it, expect a new v0.5.4 release in the next few hours that resolves this

ep1cman commented 2 years ago

Can you both try the 'dev' branch/'dev' container tag to check if it is indeed fixed for you too

johnwarne commented 2 years ago

Just pulled the dev container and the change seemed to work for me! Datetimes in the file names are now in my timezone. Woot!

Amphiboly commented 2 years ago

Working for me as well on W11. image

ep1cman commented 2 years ago

Ok hopefully this is resolved in v0.6.0, if it appears again please re-open