Page 1 of 1

Plex Naming Schemes

Posted: 12 Sep 2016, 10:03
by rednoah
Plex Naming Standard

Plex has strict standards for naming and organizing your media files.

Code: Select all

Movies/Avatar (2009)/Avatar (2009)
TV Shows/Alias/Season 01/Alias - S01E01 - Truth Be Told
The {plex} binding which will give you the appropriate Plex path for movies, TV episodes, Anime episodes and music files:

Code: Select all

{plex}
Since the {plex} binding will give you a File object, it's easy to reuse some path components and omit others. {plex.name} and {plex.tail} are particularly useful if you want to rename files in place or if you want the {plex} path without the top-level Movies or TV Shows folder.


e.g. Avatar (2009)

Code: Select all

{plex.name}
e.g. Firefly/Season 01/Firefly - S01E01 - Serenity

Code: Select all

{plex.tail}
e.g. Firefly/Firefly - S01E01 - Serenity

Code: Select all

{plex[1]}/{plex[3]}
e.g. Movies/Avatar (2009)/Avatar (2009) by James Cameron [720p, x264, AC3]

Code: Select all

{plex.derive{" by $director"}{" [$vf, $vc, $ac]"}}

Image


Custom Naming Schemes

If you need to make very specific customizations to the standard Plex naming scheme, you'll want you write your own format expression so you have full control over all the bits and pieces. You can get started by copying the following examples and modifying them to your liking.

Movies

Code: Select all

Movies/{n} ({y})/{n} ({y}){' CD'+pi}{'.'+lang}
TV Series

Code: Select all

TV Shows/{n}/{episode.special ? 'Specials' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}
Anime

Code: Select all

Anime/{primaryTitle}/{primaryTitle} - {sxe} - {t.replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, /'/).replacePart(', Part $1')}
Music

Code: Select all

Music/{n}/{album+'/'}{pi.pad(2)+'. '}{artist} - {t}

Re: Plex Naming Schemes

Posted: 21 Jan 2019, 21:57
by Gruff10
Hi,

NOOB here :?

Using

Code: Select all

{plex.derive{" [$vf.$vc.$ac]"}}
I find that the TV series 24 (Twenty Four) fails because the fullstops in its episode titles are being replaced (see output below).

https://ibb.co/87vTcrF

How can I get around this?

Thanks.

Re: Plex Naming Schemes

Posted: 22 Jan 2019, 05:12
by rednoah
Yes, the {plex} format does indeed strip trailing "." characters from the Plex path. In your case, that's unnecessary, but the {plex} binding can't know that.

e.g.

Code: Select all

$ filebot -list --q 24 --format {plex} --filter "s == 1 && e <= 3"
TV Shows/24/Season 01/24 - S01E01 - 12.00 A.M. - 1.00 A.M
TV Shows/24/Season 01/24 - S01E02 - 1.00 A.M. - 2.00 A.M
TV Shows/24/Season 01/24 - S01E03 - 2.00 A.M. - 3.00 A.M

If want to preserve the trailing "." then you can use a full custom format such as this:

Code: Select all

TV Shows/{n}/Season {s.pad 2}/{n} - {s00e00} - {t} [{vf}.{vc}.{ac}]

Re: Plex Naming Schemes

Posted: 22 Jan 2019, 12:06
by Gruff10
Thanks. That worked, though the ":"s in the episode titles are a pain as well. At least the Validate button clears them ;)

Re: Plex Naming Schemes

Posted: 22 Jan 2019, 14:06
by rednoah
Additional customizations like this will do the job:

Code: Select all

{n.colon(' - ')}

The {plex} format does take care of these corner cases already, and if you need all of those but if you want more control, then you can start with a format such as this, and then modify it to your needs:

Code: Select all

TV Shows/{n}/{episode.special ? 'Specials' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}
:idea: The .replaceAll(/[!?.]+$/) bit is responsible for removing trailing !?. so you could just cut that bit.