CLI Folder commands

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
User avatar
arukaen
Power User
Posts: 11
Joined: 23 Jul 2013, 18:29

CLI Folder commands

Post by arukaen »

So I posted the follow message on facebook and got a response back (I am assuming from rednoah) but I feel the forum will be better to ask some questions:

I need some help with the CLI commands. How do I tell the CLI to rename the folder as well? Example: /home/user/Downloads/Show-2013-complete-xVID how do I get it to rename it just Show and then the contents inside to Show.S00E00

This is what i have so far:

filebot -r -rename /path/to/folder --db {whatever} --format "{n}.{s00e00}" --order Airdate --q "Show name"

Filebot on facebook says "--format "/home/user/Videos/{n}/{n}.s00e00}"

My next question was, I understand that --format path/to/new/folder works but I don't want to create a new folder then go back and delete the old one (yes I know I can use the clean up script too). I would just like to rename the one that is currently there.
Image
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: CLI Folder commands

Post by rednoah »

That doesn't work. And it only makes sense in your special case.

Files from random folders may be part of the same input set and me be put into a completely random output structure based on the format and episode data.
:idea: Please read the FAQ and How to Request Help.
User avatar
arukaen
Power User
Posts: 11
Joined: 23 Jul 2013, 18:29

Re: CLI Folder commands

Post by arukaen »

So what your saying is filebot can not rename the original folder? Maybe my explanation is not that great, let me try it again.

Right now I use filebot to rename my TV Shows. The folder is currently labeled [Final8] Scryed - 01-26 (BD 10-bit 944x720 x264 AC3 5.1) and the episodes inside are [Final8]Scryed - 01 (BD 10-bit 944x720 x264 AC3 5.1)[CD038AAF].mkv Normally I would rename the folder just Scryed then drag and drop the folder into Filebot, match it with TVDB or AniDB and then rename and be done. (using the GUI). What I am asking is from the command line, is there an option I could pass to rename the original folder along with everything inside rather than manually renaming the original folder.


filebot -r -rename /home/arukaen/Downloads/[Final8\]\ Scryed\ -\ 01-26\ \(BD\ 10-bit\ 944x720\ x264\ AC3\ 5.1\) --db thetvdb --format "{n}.{s00e00}" --order Airdate --q "Scryed"

Are you saying the only way to do that would be to pass --format "/home/arukaen/Downloads/{n}/{n}.{s00e00}" so that a new folder is created called "Scryed," with all of the episodes in there now renamed as Scryed.S01E01.mkv and then go back to my downloads folder and delete the [Final8\]\ Scryed\ -\ 01-26\ \(BD\ 10-bit\ 944x720\ x264\ AC3\ 5.1\) folder?
Image
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: CLI Folder commands

Post by rednoah »

No.

I dare you to pass in {home}/VideosByAirdate/{airdate}/{episode} as format on a folder that contains a multiple episodes of multiple tv shows, some of them in subfolders, some not, and then worry about your folder problem again from a more general perspective. ;)
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: CLI Folder commands

Post by rednoah »

Just add this to your script and be done with it:

Code: Select all

filebot -script fn:cleaner /path/to/media/ --def root=y
PS: Obviously that'd be part of a single script where the fist line calls -rename on the input folder and the second line calls the cleaner on the input folder from before that is now probably empty.
:idea: Please read the FAQ and How to Request Help.
Post Reply