Lil help needed for Plex renaming

Any questions? Need some help?
Post Reply
User avatar
J. Scott Elblein
Posts: 37
Joined: 11 Jul 2014, 06:57

Lil help needed for Plex renaming

Post by J. Scott Elblein »

Hey all,

I'm brand spanking new to using Filebot (loving it so far :P ) and working on getting a Plex renaming scheme working.

Currently I have this:

Code: Select all

Z:\Media Server\.Processed\{n.replace(':', ' ')}\{n.replace(':', ' ')} ({y}) - {'pt'+pi}
What I want to do is just be able to drop all of the folders that I have, which have the movies in them, and may have other files in them (subs, etc.), and may or may not have multiple parts to the movie, into Filebot for renaming. They also may or may not have "extras" in the same folder.

The general format I'm looking for is:
  • All words in "Camel Case" or "Mixed Case" (first letter of each word capitalized), for all folders and files.
    For the folders, just the movie name; no year or anything else.
    For the files in those folders, just add the year the the name*
    *IF there are multiple parts to a movie, then add a space, dash, space, lower case "pt" and the number. (i.e. Austin Powers (1969) - pt1.avi, Austin Powers (1969) - pt2.avi, etc.).
    If no multiple parts then leave off the space, dash, space stuff at the end, leaving just the movie name and year.
    Once all renamed, move them to "Z:\Media Server\.Processed"
After I get it all tweaked just right I plan to automate it via the command-line for use with uTorrent (after I also figure out the TV series expression to use, :lol:).

The above expression works pretty well so far for movies, however, it always adds the space, dash, space stuff to every file, even if no multiple parts. I'm not familiar enough with the syntax to know how/if I can add some "if/else" handling to it?

Can anyone with more experience help me whip up the proper expression? It'd be much appreciated.

Thanks!
User avatar
rednoah
The Source
Posts: 23940
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Lil help needed for Plex renaming

Post by rednoah »

Looks like you already got there mostly. Here's some help on the rest:

1. Force "Mixed Case"

Code: Select all

{n.upperInitial().lowerTrail()}
2. All-or-Nothing Components

Code: Select all

{' - pt'+pi}
(if pi fails the whole {} fails)
:idea: Please read the FAQ and How to Request Help.
User avatar
J. Scott Elblein
Posts: 37
Joined: 11 Jul 2014, 06:57

Re: Lil help needed for Plex renaming

Post by J. Scott Elblein »

Thanks a million, that was perfect. :)

Here's what I ended up with:

Code: Select all

Z:\Media Server\.Processed\{n.replace(':', ' ').upperInitial().lowerTrail()}\{n.replace(':', ' ').upperInitial().lowerTrail()} ({y}){' - pt'+pi}
One thing that's throwing me a lil bit; whether I use backslashes or forward slashes in the path in the first part of the expression, when I click the Use Format button, the slashes are always shown as forward slashes in the list?

Also, is there any way to handle roman numerals when using the Mixed Case code? i.e. when I have a movie named Airplane II, it ends up as Airplane Ii.
User avatar
rednoah
The Source
Posts: 23940
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Lil help needed for Plex renaming

Post by rednoah »

Pretty sure TheMovieDB primary names use roman numerals, or very very rarely anyway. You can always force it with some regex replace though.

A fairly simple example would be this:

Code: Select all

{"Iii".replaceAll(/\b[Ii]+\b/, { it.upper() })}
FYI
http://www.howtogeek.com/181774/why-win ... d-slashes/

Also Never use backslash unless you know what escaping is ;)
:idea: Please read the FAQ and How to Request Help.
User avatar
J. Scott Elblein
Posts: 37
Joined: 11 Jul 2014, 06:57

Re: Lil help needed for Plex renaming

Post by J. Scott Elblein »

Alrighty, thanks again. It was throwing me because in the expression editor it was showing the backslashes as well, only changing after hitting the button. Wasn't sure if the forward slashes in the list would cause a conflict with Windows.
User avatar
rednoah
The Source
Posts: 23940
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Lil help needed for Plex renaming

Post by rednoah »

Even on Windows it's much more likely that you'll run into a conflict between \ as a directory separator and \ as escape character than a Windows application that doesn't also accept / as directory separator (since every single developer hates using \ as directory separator).

Lots of potential issues related to using \ are documented here:
http://www.filebot.net/forums/viewtopic ... =215#p1561
:idea: Please read the FAQ and How to Request Help.
Post Reply