Page 1 of 1
Change Date Modified of Series Folder
Posted: 25 Oct 2022, 18:54
by brijazz
I use the CLI to rename my files and place them into Season folders under the Series folder, which I assume is pretty standard usage. However, the 'date modified' only changes on the Season folder when new files are added (as per the screenshot).
Is there anything I can add to my script (using -exec perhaps?) that will allow me to 'touch' the Series folder when it runs, thereby updating its 'date modifed' as well?

Re: Change Date Modified of Series Folder
Posted: 26 Oct 2022, 03:37
by rednoah
I don't know how macOS updates folder Last-Modified times in response to file changes within that folder.
If
touch works on folders, then you can certainly use
-exec to touch the folder:
EDIT:
FileBot r9325 enhanced
--apply touch to also update the Last-Modified date for parent folders of destination files.
Re: Change Date Modified of Series Folder
Posted: 26 Oct 2022, 12:15
by brijazz
Thanks, I didn't know about --apply. Unfortunately, it's not working for me and the Series folder's date modified remains unchanged. Not a huge issue, just would be handy for sorting the folders in Finder. It would have been great to have this all done via Filebot, but I've found a solution using AppleScript that gets the job done. Good enough for me!
Re: Change Date Modified of Series Folder
Posted: 27 Oct 2022, 03:04
by rednoah
rednoah wrote: ↑26 Oct 2022, 03:37
FileBot r9325 enhanced
--apply touch to also update the Last-Modified date for parent folders of destination files.
FileBot r9325 is the latest development revision from yesterday. Future releases
(i.e. FileBot 4.9.8 and higher) will update the Last-Modified of parent folders as well. The current release
(i.e. FileBot 4.9.6) does not implement the newly introduced behaviour.
brijazz wrote: ↑26 Oct 2022, 12:15
just would be handy for sorting the folders in Finder. It would have been great to have this all done via Filebot
Yes, the
-exec option can be used to do that with FileBot.
↓↓↓ USE THIS ↓↓↓
↑↑↑ USE THIS ↑↑↑
Re: Change Date Modified of Series Folder
Posted: 27 Oct 2022, 12:57
by brijazz
Thanks for following up, I'll await 4.9.8 to try out
--apply touch. Even with
-exec, I'm still not seeing 'date modified' being updated on the series folder. My command looks like this:
Code: Select all
filebot -rename myfile.mkv -non-strict --log info --log-file ~/Documents/filebot.log --format "{~plex} [{vf}]" -exec touch {folder}
Am I structuring the command incorrectly, or otherwise missing something? Any further help is much appreciated!
Re: Change Date Modified of Series Folder
Posted: 28 Oct 2022, 12:53
by rednoah
What does the console output say?
(TIP: remove --log INFO so that you can see the -exec logging so you can see what touch commands are being executed)
EDIT:
-exec touch {folder} will only issue one
touch command for each parent folder of each file processed. If you use
series folder / season folder / episode file naming then it will
touch the parent folder / season folder, but it won't
touch the parent parent folder / series folder.

If you want to run
touch on the parent folder and the parent parent folder, then you can add that to the
-exec command template:
Re: Change Date Modified of Series Folder
Posted: 28 Oct 2022, 13:23
by brijazz
Success, thanks!