Fix date offset application for videos#409
Conversation
Make sure the offset is actually applied to seconds_since_epoch so that timezone is taken into account.
|
That’s wild. Thanks for catching this....I assume there weren’t any unit tests covering proper times on videos? Can we add that to this PR? If you aren’t familiar then I can help. |
|
I looked at the tests, and apparently there is one ( After some digging, I think what is happening is that if a video was taken in the same timezone Elodie is run in, the changes in this PR will correctly sort the video. However, if the video was taken in a different timezone, the video will be sorted wrong, with the amount of error being the difference in time between the video's timezone and the computer running Elodie's timezone. This seems to be a result of the method being used to calculate date offset. The program uses I have some ideas on how to fix this, but before I go further, I have one clarifying question. What is the intended behavior here? What timezone should Elodie be using to sort videos? For example, the test |
bbdb460 to
ec11497
Compare
While using Elodie to sort some videos, I found that it would consistently move videos' time taken by the same amount as my timezone's offset from UTC. This caused some videos to be placed in the wrong folder.
I noticed that
video.pyhas some code dedicated to calculating an date offset, but that this offset is never applied because of some missing=signs. I assume that this is an oversight since the affected code doesn't really do anything at the moment.Adding the
=signs fixes the issue for me, and Elodie now correctly sorts my files.