Plex / Kodi / Emby / Jellyfin Naming Schemes

All about user-defined episode / movie format expressions
Locked
User avatar
rednoah
The Source
Posts: 21076
Joined: 16 Nov 2011, 08:59

Plex / Kodi / Emby / Jellyfin Naming Schemes

Post by rednoah »

⭑⭑ The {plex} binding manual applies equally to the {kodi} and {emby} and {jellyfin} bindings. Please read the Kodi / Emby / Jellyfin Naming Standard sections for details on the subtle differences between the various naming schemes. ⭑⭑


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 gives you the appropriate Plex path for movies, TV episodes and Anime episodes:

Code: Select all

{ plex }
The {plex.id} binding additionally appends the numeric ID to the file and folder name to guarantee and speedup movie / series detection:

Code: Select all

{ plex.id }
:idea: Make sure to Disable Local Media Assets for all your media libraries to make Plex not give preference to the embedded media title.


Image


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.tail.root } / { plex.name }

e.g. Movies/Avatar (2009)/Avatar (2009) {imdb-tt0499549}

Code: Select all

{ plex.derive{" {imdb-$imdbid}"} }
e.g. Movies/Avatar (2009)/Avatar (2009) {tmdb-19995}

Code: Select all

{ plex.derive{" {tmdb-$id}"} }
e.g. Avatar (2009) by James Cameron [720p, x264, AC3].eng

Code: Select all

{ plex.derive{" by $director"}{" [$vf, $vc, $ac]"}.name }
:idea: plex.derive() can be used to insert additional information after the file name but before the subtitle language suffix and file extension.




Advanced {plex} operators:

~ ... nullify the Movies / TV Shows category folder level
% ... append values to the file name (but before the part index and subtitle language suffix)
* ... append to values to the movie / series folder name
** ... append values to both the file name and the movie /series folder name
<< ... append values to the season folder name
>> ... inject subcategory folder level after the category folder level (but before the movie / series folder level)
^ ... replace subtitle language suffix
id ... add {id-123} tags to the movie name / movie folder name / series folder name
unix ... {plex} path without file name validation (i.e. allow : colon and ? question mark in file paths)

e.g. Avatar (2009)/Avatar (2009)

Code: Select all

{ ~plex }
e.g. Avatar (2009) {tmdb-19995}/Avatar (2009) {tmdb-19995}

Code: Select all

{ ~plex.id }
e.g. Avatar (2009) {tmdb-19995}/Avatar (2009) {tmdb-19995} {edition-Extended Edition}
Multiple Editions

Code: Select all

{ ~plex.id % { " {edition-${tags[0]}}" } }
e.g. Avatar (2009)/Avatar (2009) by James Cameron [720p, x264, AAC]

Code: Select all

{ ~plex % {" by $director"} % {" [$vf, $vc, $ac]"} }
e.g. Avatar (2009) [M19995]/Avatar (2009)

Code: Select all

{ ~plex * " [M$id]" }
e.g. Avatar (2009) [M19995]/Avatar (2009) [M19995]

Code: Select all

{ ~plex ** " [M$id]" }
e.g. Firefly/Season 01 [2002-2003]/Firefly - S01E01 - Serenity

Code: Select all

{ ~plex << sy.bounds().joining('-', ' [', ']') }
e.g. Avatar (2009)/Avatar (2009).en

Code: Select all

{ ~plex ^ {'.'+lang.ISO2} }
e.g. Movies/Avatar (2009)/Avatar (2009) (i.e. {plex} without subtitle language suffix)

Code: Select all

{ plex ^ null }
e.g. Movies/A/Æon Flux (2005)/Æon Flux (2005)

Code: Select all

{ plex >> az }
e.g. A/AEon Flux (2005)/AEon Flux (2005)

Code: Select all

{ (~plex >> az).ascii() }



Kodi Naming Standard

The {kodi} binding and the {plex} binding work exactly the same, with slightly different implementation details, e.g. SxE formatting and multi-episode formatting.

e.g. TV Shows/Alias {tmdb-2046}/Season 1/Alias - 1x01 - Truth Be Told

Code: Select all

{ kodi.id }


Emby Naming Standard

The {emby} binding and the {plex} binding work exactly the same, with slightly different implementation details, e.g. series name and series folder formatting.

e.g. TV Shows/Alias (2001) {tmdb-2046}/Season 01/Alias (2001) - S01E01 - Truth Be Told

Code: Select all

{ emby.id }


Jellyfin Naming Standard (requires FileBot r9282)

The {jellyfin} binding and the {plex} binding work exactly the same, with slightly different implementation details, e.g. series name and series folder formatting and [tmdb-12345] ID tag formatting.

e.g. TV Shows/Alias (2001) [tmdb-2046]/Season 01/Alias (2001) - S01E01 - Truth Be Told

Code: Select all

{ jellyfin.id }



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}
:idea: Please read the FAQ and How to Request Help.
Locked