Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mtime dates #101

Merged
merged 2 commits into from
Mar 3, 2023
Merged

Fix mtime dates #101

merged 2 commits into from
Mar 3, 2023

Conversation

slifty
Copy link
Contributor

@slifty slifty commented Mar 3, 2023

This PR fixes a few bugs related to the reported mtimes for files and folders. In particular it now properly uses seconds (instead of ms) when reporting the dates. It also uses the archive data for archive folders.

It does not address the /archives folder, which does not actually exist in permanent and should likely be linked to the user's account creation date, but I'd like to address that as part of #100

Note this can be tested locally using the rclone lsjson command which will show the mtimes associated with various items in a path.

Resolves #98

There was a mistake in how we were calculating mtime -- the `getTime`
method returns milliseconds but it's expected to be passed in terms of
seconds.

Nothing a simple division by 1000 can't fix!
The archive folders and archive root folders were populating with
"default" dates rather than dates driven by the archive / folder values.
This was resulting in unix epoch values.

Issue #98
@slifty slifty requested a review from Fenn-CS March 3, 2023 17:45
Copy link
Contributor

@Fenn-CS Fenn-CS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Divisions by 1000 seem more powerful that we thought, lol.

@slifty slifty merged commit b198cda into main Mar 3, 2023
@slifty slifty deleted the 98-fix-dates branch March 3, 2023 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make sure directory times mirror the displayDate of a folder
2 participants