Page 1 of 1

AMC - Any way to set timestamp on files?

Posted: 29 Dec 2016, 14:10
by Dfects
Hiya,

I'm a big fan of kodi listing via date added, but it seems to rely on the fimestamp on the file which unrar seems to preserve. All the files extracted by unrar are run through filebot after using the AMC script, but I can't see any options to set the timestamp to the current time so I'm guessing it doesn't exist.

Anyone have any suggestions? :)

Re: AMC - Any way to set timestamp on files?

Posted: 29 Dec 2016, 14:49
by rednoah
FileBot does not modify timestamps. Are you sure that unrar preserves timestamps?


EDIT:


You can probably set unrar to not preserve timestamps. If you're using the amc script you can use --def exec to modify the timestamps after processing.

Re: AMC - Any way to set timestamp on files?

Posted: 29 Dec 2016, 15:47
by Dfects
Thanks for the reply :) Pretty sure its unrar, as one extracted with a funky filename that filebot failed on and it has a 2015 modified/creation date. I can't find any switches for unrar that change its timestamp behaviour which I why I was hoping filebot could do this for me after extracting :)

Didn't notice the exec option, was too busy looking for time related ones! A simple touch '{file}' seems to of done the trick.

Thanks for your help

Re: AMC - Any way to set timestamp on files?

Posted: 21 Dec 2021, 11:05
by xadox
Is it now possible to change the timestamp of a file with Filebot?

Re: AMC - Any way to set timestamp on files?

Posted: 21 Dec 2021, 11:12
by rednoah
xadox wrote: 21 Dec 2021, 11:05 Is it now possible to change the timestamp of a file with Filebot?
:?: What do you want to change it to?


You could use -exec:

Code: Select all

-exec touch {f}
:arrow: viewtopic.php?t=11078

Re: AMC - Any way to set timestamp on files?

Posted: 21 Dec 2021, 11:25
by xadox
Ok so no direct change without 3rd party. Thx for the quick reply.

Re: AMC - Any way to set timestamp on files?

Posted: 21 Dec 2021, 11:33
by rednoah
Well, the Set creation date post-processing action will set the time stamp, but to the episode airdate / movie release date, as opposed to the current date time:

Code: Select all

--apply date
:arrow: viewtopic.php?t=11079



Adding a new post-processing action would take like 5 minutes, but I'm not aware of any particular use case that would be generally useful. Hasn't really come up. I'm usually focused on making sure that the last modified date isn't accidentally updated by FileBot doing this or that. That's usually a problem.




EDIT:

FileBot r9006 adds --apply touch to update the time stamps for all the processed files.

Re: AMC - Any way to set timestamp on files?

Posted: 21 Dec 2021, 13:59
by xadox
Hmm... it it possible to "--apply touch" in GUI Mode with presets?

Re: AMC - Any way to set timestamp on files?

Posted: 21 Dec 2021, 14:48
by rednoah
xadox wrote: 21 Dec 2021, 13:59 Hmm... it it possible to "--apply touch" in GUI Mode with presets?
Sure. Most of the post-processing features are supported in the GUI. What's your use case though?

Re: AMC - Any way to set timestamp on files?

Posted: 21 Dec 2021, 15:27
by kim

Code: Select all

<dateadded>1</dateadded> <!-- 0 results in using the current datetime when adding a video;
                                  1 (default) results in prefering to use the files mtime (if it's valid) and only using the file's ctime if the mtime isn't valid;
                                  2 results in using the newer datetime of the file's mtime and ctime -->
https://kodi.wiki/view/Advancedsettings ... deolibrary

note: Changing the way it works will only affect items added to the library AFTER the change has been made

Re: AMC - Any way to set timestamp on files?

Posted: 21 Dec 2021, 17:55
by xadox
rednoah wrote: 21 Dec 2021, 14:48
xadox wrote: 21 Dec 2021, 13:59 Hmm... it it possible to "--apply touch" in GUI Mode with presets?
Sure. Most of the post-processing features are supported in the GUI. What's your use case though?
I would like to set the FileDateStamp of series and movies to the current date and time after renaming.
So that these files are displayed in Kodi in the last added category.

But I will try the feature named by @kim, too?

Re: AMC - Any way to set timestamp on files?

Posted: 21 Dec 2021, 20:15
by kim
btw:
You also just override it if nfo's has the dateadded tag then kodi will use this date
movie.nfo

Code: Select all

<movie>
    <dateadded>2021-03-26 11:35:50</dateadded>
</movie>
https://kodi.wiki/view/NFO_files/Templates

Re: AMC - Any way to set timestamp on files?

Posted: 22 Dec 2021, 01:28
by rednoah
I've added --apply touch because the use case does make sense, especially the one where time stamps restored from archives make newly added files years old. I'd be good to guarantee a recent Last-Modified date so that you can find newly added files via find /path/to/media -mtime -1 for subsequent automation tasks.


However, IMHO the "I want Kodi to show me the recently added files" use case is probably best served by adjusting the corresponding Kodi settings.