Auto-create TV Show folders?

Any questions? Need some help?
Post Reply
stewasd
Posts: 10
Joined: 06 Apr 2014, 15:20

Auto-create TV Show folders?

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

Re: Auto-create TV Show folders?

Post by rednoah »

:idea: Please read the FAQ and How to Request Help.
stewasd
Posts: 10
Joined: 06 Apr 2014, 15:20

Re: Auto-create TV Show folders?

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

Re: Auto-create TV Show folders?

Post 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
:idea: Please read the FAQ and How to Request Help.
stewasd
Posts: 10
Joined: 06 Apr 2014, 15:20

Re: Auto-create TV Show folders?

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

Re: Auto-create TV Show folders?

Post 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?
:idea: Please read the FAQ and How to Request Help.
stewasd
Posts: 10
Joined: 06 Apr 2014, 15:20

Re: Auto-create TV Show folders?

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

Re: Auto-create TV Show folders?

Post by rednoah »

Logs?
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 23933
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Auto-create TV Show folders?

Post 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.
:idea: Please read the FAQ and How to Request Help.
stewasd
Posts: 10
Joined: 06 Apr 2014, 15:20

Re: Auto-create TV Show folders?

Post by stewasd »

Thanks for the advice. I'll tackle this problem empirically for a little bit.
stewasd
Posts: 10
Joined: 06 Apr 2014, 15:20

Re: Auto-create TV Show folders?

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

Re: Auto-create TV Show folders?

Post 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
:idea: Please read the FAQ and How to Request Help.
stewasd
Posts: 10
Joined: 06 Apr 2014, 15:20

Re: Auto-create TV Show folders?

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

Re: Auto-create TV Show folders?

Post 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.
:idea: Please read the FAQ and How to Request Help.
stewasd
Posts: 10
Joined: 06 Apr 2014, 15:20

Re: Auto-create TV Show folders?

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

Re: Auto-create TV Show folders?

Post 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.
:idea: Please read the FAQ and How to Request Help.
stewasd
Posts: 10
Joined: 06 Apr 2014, 15:20

Re: Auto-create TV Show folders?

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

Re: Auto-create TV Show folders?

Post by rednoah »

Google is your friend. Especially for the basic things.

@see http://www.cyberciti.biz/faq/appleosx-b ... -variable/
:idea: Please read the FAQ and How to Request Help.
stewasd
Posts: 10
Joined: 06 Apr 2014, 15:20

Re: Auto-create TV Show folders?

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

Re: Auto-create TV Show folders?

Post by rednoah »

Then install.sh doesn't work. Please refer to the link I've posted before.
:idea: Please read the FAQ and How to Request Help.
Post Reply