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

Age filtering when scanning files should use creation date #860

Closed
MoshiMoshi0 opened this issue Dec 31, 2017 · 5 comments · Fixed by #1162
Closed

Age filtering when scanning files should use creation date #860

MoshiMoshi0 opened this issue Dec 31, 2017 · 5 comments · Fixed by #1162

Comments

@MoshiMoshi0
Copy link

MoshiMoshi0 commented Dec 31, 2017

Currently they are filtered by modified date here, but doesn't creation date make more sense?

If you put/copy new files into the scanned folder they should be treated as new. The modified date will never change unless you re-encode, and that would probably also change the hash and break subtitle detection.

The creation date is platform dependent but I found this stackoverflow answer with cross-platform code.

edit: Probably better to use creation and modified dates and pick the latest?
So just max(os.path.getmtime(path), os.path.getctime(path))

@ratoaq2
Copy link
Collaborator

ratoaq2 commented Feb 27, 2019

The modified date will only change if change the file contents. And as soon you get the file, it will have the current time as modified date (unless you fake it)

So, I still see no reason to not use modification time. It's simpler, cross platform and fits the use case in subliminal

@huuub
Copy link

huuub commented Feb 27, 2019

And as soon you get the file, it will have the current time as modified date (unless you fake it) -> this is not the default behaviour I see.

@MoshiMoshi0
Copy link
Author

MoshiMoshi0 commented Feb 27, 2019

The modified date will only change if change the file contents.

Exactly, so if you copy a file that you encoded a long time ago subliminal will not pick it up because only the creation time will change.

And as soon you get the file, it will have the current time as modified date (unless you fake it)

That does not seem to be the case when for example extracting using 7z or winrar. The files have their original modified date and a current creation date.

@huuub
Copy link

huuub commented Mar 6, 2019

Does anybody have a nice workaround for this?

@ratoaq2
Copy link
Collaborator

ratoaq2 commented Mar 6, 2019

A workaround would be to extract and touch the files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants