AMC - Any way to set timestamp on files?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Dfects
Posts: 12
Joined: 30 Mar 2015, 22:29

AMC - Any way to set timestamp on files?

Post 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? :)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post 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.
:idea: Please read the FAQ and How to Request Help.
Dfects
Posts: 12
Joined: 30 Mar 2015, 22:29

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

Post 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
User avatar
xadox
Posts: 32
Joined: 23 Mar 2012, 05:49

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

Post by xadox »

Is it now possible to change the timestamp of a file with Filebot?
Greets XadoX
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post 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
:idea: Please read the FAQ and How to Request Help.
User avatar
xadox
Posts: 32
Joined: 23 Mar 2012, 05:49

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

Post by xadox »

Ok so no direct change without 3rd party. Thx for the quick reply.
Greets XadoX
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post 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.
:idea: Please read the FAQ and How to Request Help.
User avatar
xadox
Posts: 32
Joined: 23 Mar 2012, 05:49

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

Post by xadox »

Hmm... it it possible to "--apply touch" in GUI Mode with presets?
Greets XadoX
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post 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?
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

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

Post 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
User avatar
xadox
Posts: 32
Joined: 23 Mar 2012, 05:49

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

Post 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?
Greets XadoX
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

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

Post 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
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post 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.
:idea: Please read the FAQ and How to Request Help.
Post Reply