--file-filter using date last modified

Support for Ubuntu and other Desktop Linux distributions
Post Reply
Fiorelli
Posts: 9
Joined: 30 Oct 2020, 23:12

--file-filter using date last modified

Post by Fiorelli »

Hi - how can I filter Filebot to run only on files last modified since a certain date? I'm currently testing the following:

Code: Select all

filebot -script fn:amc volume1/Downloads/FileBot --output /volume1 --action test -non-strict --def seriesFormat="/TV Shows/{n}/Season {s00}/{s00e00} - {t}" movieFormat="/Movies/{n} [{y}]/{n}" --file-filter "file.lastModified > 2022-06-01"
This doesn't work, but I don't know whether I'm incorrectly specifying the argument (file.lastModified), the date format, or both.

Thanks in advance.
User avatar
rednoah
The Source
Posts: 22898
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: --file-filter using date last modified

Post by rednoah »

e.g. select files less than 7 days old:

Code: Select all

--file-filter "age < 7"

e.g. select files since the specified date string:

Code: Select all

{ f.lastModified().toDate().format('yyyy-MM-dd') > '2022-06-01' }


EDIT:

FileBot r9237 improves support for Date <=> String compare:

Code: Select all

{ f.lastModified().toDate() > '2022-06-01' }

EDIT 2:

In FileBot 4.9.6 the {age} is based on the media creation date {dt} which may be quite different from the Last-Modified date. FileBot r9238 adds the {ct} file creation date binding and changes how {age} works depending on the context to better support simple find -mtime type use cases:

Code: Select all

{ ct > '2022-06-01' }
:idea: Please read the FAQ and How to Request Help.
Fiorelli
Posts: 9
Joined: 30 Oct 2020, 23:12

Re: --file-filter using date last modified

Post by Fiorelli »

Perfect, many thanks.
Post Reply