Page 1 of 1

Auto-create TV Show folders?

Posted: 06 Apr 2014, 15:23
by stewasd
I love this program, and was wondering if it can do this.

I have a script which automatically renames all of the files in a folder where my downloads go, but I'm wondering if there is some way that I can automatically sort all of my TV Shows into folders, named by FileBot. Also, if there is no folder already for the TV Show, then can it create one if one doesn't exist, but only add to it if the folder does exist? (This is for the purpose of XBMC). Any help would be greatly appreciated.

Thanks

Re: Auto-create TV Show folders?

Posted: 06 Apr 2014, 15:40
by rednoah

Re: Auto-create TV Show folders?

Posted: 06 Apr 2014, 16:36
by stewasd
So if the path to where I want them to end up is home/desktop/xbmc-tvshows, I would use a script like this:

--format /home/desktop/xbmc-tvshows/{n}/Season {s}/{n}.S{s}.E{e}

Provided that {n}.S{s}.E{e} was the name I wanted?

Re: Auto-create TV Show folders?

Posted: 06 Apr 2014, 16:44
by rednoah
Well you have to take care of spaces anyway, but yes, you can specify an absolute path. Why not try with --action test?

And I'd get rid of those weird space-dot thing, and add titles. Plus using the predefined sxe bindings is better cause multi-episodes are taken into account by default, which isn't the case in your format.

Code: Select all

--format "/home/desktop/xbmc-tvshows/{n}/Season {s}/{n} - {s00e00} - {t}"
Best to copy the snippets from here:
http://www.filebot.net/forums/viewtopic.php?f=5&t=2

Re: Auto-create TV Show folders?

Posted: 06 Apr 2014, 16:51
by stewasd
Alright. That sounds great, thanks! If $1 represents the file, and ~ is the home drive, would the following work?

filebot -rename "$1" --format "~/desktop/xbmc-source/xbmc-tvshows/{n}/Season {s}/{n} - {s00e00} - {t}" --db thetvdb -non-strict

Thanks again!

Re: Auto-create TV Show folders?

Posted: 06 Apr 2014, 17:09
by rednoah
Probably not, depends on when ~ is expanded, in this case it's probably passed in literally in which case it'll literally try to move it to a folder called "~" so instead use the {home} binding.

Again, why not try with --action test and see what happens?

Re: Auto-create TV Show folders?

Posted: 07 Apr 2014, 21:43
by stewasd
I tested it out and got mediocre results. It did create the path I wanted, however, instead of going back to the home drive, it decided to create that string of folders inside the downloads, but not where I wanted it to go. Is there anything I could add to it so that it goes up 2 levels (folders) and then does the script I created?

Thanks

Re: Auto-create TV Show folders?

Posted: 07 Apr 2014, 23:33
by rednoah
Logs?

Re: Auto-create TV Show folders?

Posted: 08 Apr 2014, 00:10
by rednoah
Here's how you can easily figure things out for yourself just by playing around.

Code: Select all

filebot -rename *.avi --db thetvdb --log info --format "~/{n}/{sxe} - {t}" --action copy

Code: Select all

[COPY] Rename [/home/reinhard/Downloads/Firefly 1x01.avi] to [~/Firefly/1x01 - The Train Job.avi]
We observe tilde does in fact not get expanded.


Maybe because of the "..." ??

Code: Select all

filebot -rename *.avi --db thetvdb --log info --format ~/{n}/{sxe}\ -\ {t} --action copy

Code: Select all

[COPY] Rename [/home/reinhard/Downloads/Firefly 1x01.avi] to [/home/reinhard/Firefly/1x01 - The Train Job.avi]
We observe tilde does get expanded as expected when not enclosed in "..."


What did he say about {home} again?

Code: Select all

filebot -rename *.avi --db thetvdb --log info --format "{home}/{n}/{sxe} - {t}" --action copy

Code: Select all

[COPY] Rename [/home/reinhard/Downloads/Firefly 1x01.avi] to [/home/reinhard/Firefly/1x01 - The Train Job.avi]
Looks good.


How about moving things relatively?

Code: Select all

filebot -rename *.avi --db thetvdb --log info --format "../{n}/{sxe} - {t}" --action copy

Code: Select all

[COPY] Rename [/home/reinhard/Downloads/Firefly 1x01.avi] to [../Firefly/1x01 - The Train Job.avi]
Works as expected.

Re: Auto-create TV Show folders?

Posted: 08 Apr 2014, 02:01
by stewasd
Thanks for the advice. I'll tackle this problem empirically for a little bit.

Re: Auto-create TV Show folders?

Posted: 10 Apr 2014, 20:47
by stewasd
So, at long last, I've created something that has worked before, but now results in the following:

Script:

filebot -rename --format "{n} - {s00e00} - {t}" --db thetvdb -non-strict


Rename episodes using [TheTVDB]
Exception: No media files: []
Failure (?_?)

Note: I'm using it to rename 180 files at once. Don't know if that affects anything.

Re: Auto-create TV Show folders?

Posted: 11 Apr 2014, 05:19
by rednoah
Note: You're using it to rename 0 files at once. And that sure does not affect anything.

Have you tried passing in a path to the files?

Code: Select all

filebot -rename --format "{n} - {s00e00} - {t}" --db thetvdb -non-strict /path/to/files

PS: That'll be $5 then, cause I do charge for support if the solution is most obvious. :P

Re: Auto-create TV Show folders?

Posted: 12 Apr 2014, 21:23
by stewasd
:D My mistake was that I was in the directory where I wanted to rename the files, so I didn't think I needed to input the path.

However, even when I do that, I still get the same result.

Re: Auto-create TV Show folders?

Posted: 13 Apr 2014, 09:19
by rednoah
Basic cmdline skills: . means current folder, .. means parent folder

Code: Select all

filebot -rename --format "{n} - {s00e00} - {t}" --db thetvdb -non-strict .
If it says No Media files that means that there either or no media files or that you haven't passed them in.

Re: Auto-create TV Show folders?

Posted: 17 Apr 2014, 21:03
by stewasd
Hey rednoah,

Sorry for my incompetence. It seems as though most of my commands fail to be working with Terminal. It reads as follows:

My script:

filebot -rename --format "{n} ({y})" --db imdb -non-strict

Terminal response:

-bash: filebot: command not found

Is this an issue with my computer? Thanks for all your help.

Re: Auto-create TV Show folders?

Posted: 18 Apr 2014, 08:42
by rednoah
filebot is not in the PATH.

You can:
1. Use the absolute path to the filebot executable
2. Link the filebot executable to /bin
3. Add the the folder where the filebot executable resides to your PATH in your bash profile

You may use google. This is not a filebot issue.

Re: Auto-create TV Show folders?

Posted: 18 Apr 2014, 20:36
by stewasd
As I've said before, I'm not really good with these things at all. Absolute path doesn't work. How do I link filbert.app to /bin on OSX? Or add folder to .bash_profile?

Thanks

Re: Auto-create TV Show folders?

Posted: 19 Apr 2014, 04:16
by rednoah
Google is your friend. Especially for the basic things.

@see http://www.cyberciti.biz/faq/appleosx-b ... -variable/

Re: Auto-create TV Show folders?

Posted: 19 Apr 2014, 17:17
by stewasd
Thanks. When I run the install.sh in the contents, here is the result:

Last login: Sat Apr 19 15:31:18 on ttys000
Stewart:~ imac$ /Users/imac/Downloads/FileBot.app/Contents/MacOS/install.command ; exit;
ln: /usr/bin/filebot: File exists
logout

[Process completed]

However, I still get the:

-bash filebot: command not found error

Re: Auto-create TV Show folders?

Posted: 21 Apr 2014, 04:12
by rednoah
Then install.sh doesn't work. Please refer to the link I've posted before.