Page 1 of 1

Trouble with root directory when renaming files.

Posted: 07 Nov 2017, 20:48
by Darkstar82
Hopefully a simple one, but beyond my scope.

I have a simple naming scheme for movies and TV Shows.
{n} ({y})/{n} ({y}) [{vf}] [{af}]
Nothing special. But problem occur when I apply this to a file already in the correct directory.

For example.

File located A:\
filename Zoolander2.mp4
Apply rules

New name:

A:\Zoolander Collection\Zoolander 2\Zoolander 2_2017.mp4

Example 2:

File located A:\Zoolander Collection\Zoolander 2\
filename Zoolander2.mp4
Apply rules

New name:

A:\Zoolander Collection\Zoolander 2\Zoolander 2_2017.mp4

I then have to manually move the directory into my movies folder.
This would be an easy fix for one folder, but I have like 6 folders, Kids Movies, My Movies, Her Movies, Documentaries etc.

All I want is for filebot to know if I am in A:\Movies\Zoolander Collection\Zoolander 2\ and I am renaming a file there, place it there. Rather that at the root of the drive.

Re: Trouble with root directory when renaming files.

Posted: 08 Nov 2017, 09:36
by rednoah
I'm not quite sure I understand the problem. I guess you'll want to generate absolute paths in your format so you get exactly that absolute destination path you want, whatever it may be.

e.g.

Code: Select all

X:/Movies/{n} ({y})/{n} ({y}) [{vf}] [{af}]
or

Code: Select all

X:/{plex.derive{" [$vf] [$af]"}}

:idea: If your format yields a relative path, then FileBot will try to figure out where it fits best, which may not be what you want in this case. I recommend always using absolute formats.

Re: Trouble with root directory when renaming files.

Posted: 08 Nov 2017, 14:55
by Darkstar82
Absolute paths are good, but they would need manually changing depending on each movie folder.

My drive is like this:

Code: Select all

A:\Fitness\
A:\Comedy Shows\
A:\Movies\
A:\TV Shows\
Then there is drive B for my partner

Code: Select all

B:\Disney\
B:\Gibli\
B:\Kids Movies\
B:\Kids TV\
B:\Movies\
B:\TV Shows\
So I move a movie to the directory B:\Kids Movies\ and add it to filebot it wants to put it at the root, in this case B:
If I add an absolute path, it's just going to force it to go to my last entered one.

All I want it to do it rename the file, put it in a directory and place/leave it in the same directory it came from.

Re: Trouble with root directory when renaming files.

Posted: 09 Nov 2017, 05:32
by rednoah
1.
That's not a problem. You can have the format give you different absolute paths for different files:

Code: Select all

{f.root}/Plex/{plex.derive{" [$vf] [$af]"}}
e.g. {f.root} will give you X:/ for files that are on X:/ and so on.

:idea: You can also keep the first two path components with {f[0..1]} if you want to keep your custom genre folders instead of just the drive letter.


2.
Darkstar82 wrote:All I want it to do it rename the file, put it in a directory and place/leave it in the same directory it came from.
Likewise, you can also use the current path to generate your absolute destination path, so what you're asking for here is simple:

Code: Select all

{folder}/{ny}/{plex.name}

Re: Trouble with root directory when renaming files.

Posted: 09 Nov 2017, 06:18
by Darkstar82
Brilliant, thank you.

Apologies for the complexity of my questions, but you figured out what I needed.
Just tested

Code: Select all

{folder}/{n} ({y})/{n} ({y}) [{vf}] [{af}]
and it works great.

Re: Trouble with root directory when renaming files.

Posted: 09 Nov 2017, 18:07
by rednoah
No worries. Turns out it was a very easy-to-solve problem.