-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Set modtime for metadata files #2307
Comments
I would like to set the same mtime as for the main file for the generated with |
I can't seem to get the Last Modified Times of post files to work. The metadata post-processor with event:post has mtime set to true. mtime:true for the metadata post-processor does work on non-post metadata files, though. Thinking 5974955 might be intended for that purpose, I tried adding an event:post mtime post-processor. It didn't work, not that I was expecting it to. I am curious what the use-case of this commit is supposed to be for, honestly. |
To get "postprocessors": [
{
"name": "mtime",
"event": "post"
},
{
"name": "metadata",
"event": "post",
"mtime": true
}
] Otherwise there is no mtime date/time information available at that point in time, since The post processor list from the first post should also be reordered accordingly. Otherwise metadata files and downloaded files will have different mtimes, still. "postprocessors": [
{
"name": "mtime"
},
{
"name": "metadata",
"mode": "json",
"filename": "{id}{num:? //>02} {title[:100]}.data.json",
"mtime": true
},
{
"name": "metadata",
"mode": "custom",
"content-format": "{title}\n",
"filename": "{id}{num:? //>02} {title[:100]}.txt",
"whitelist": ["reddit"],
"mtime": true
}
], |
It don't applies on ugoira ffmpeg output files. |
Ugoira files have the wrong mtime (it's UTC, instead of the local one). Using of UTC time in filename format string is definitely the proper thing, since users from any time zone will have the same filename for the same downloaded URL. Files from Also it looks that the time is differ additionally by 1-3 minutes. It's strange. |
This difference might be due to different sources of the mtime values. Metadata files with
I should add that I more or less just copy-pasted the |
Wait. I only add With any The bug was because I used {
"name": "mtime"
}, |
Without any mtime postprocessor(s): For example, for +3:00 time zone: The For -10:00 zone: |
However, I think even with {
"name": "mtime",
"event": "file,post"
}, It should set the correct file's mtime. For the 1st example above it should be "2022.03.18 00:26", but currently I get "2022.03.17 21:26" — wrong mtime. And "2022.03.17" in filename — OK. |
'datetime.timestamp()', which got used to convert datetime objects to POSIX timestamps, assumes naive datetimes represent LOCAL time, while datetimes in 'date' metadata fields represent UTC time. Ref: https://docs.python.org/3/library/datetime.html#datetime.datetime.timestamp > Naive datetime instances are assumed to represent local time > you can obtain the POSIX timestamp by … calculating the timestamp directly
I looked into this a bit more and found a (major) bug. The way the This is now fixed with e7b3086, but all previous mtime timestamps produced from |
Maybe it makes sense to add With |
I'm downloading images from Reddit and have a few postprocessors setup. The downloaded images get their modtime updated, the metadatafiles (.data.json, .txt) don't. Is there any way to have them updated as well?
Thanks
My config
Result
The text was updated successfully, but these errors were encountered: