Format Expressions User defined episode / movie naming scheme

About

You can easily define your own episode and movie naming schemes. It uses Groovy expressions, which means that you can do pretty much anything, especially if you know a little bit about programming. You even get media info bindings. You can find predefined format expressions for all kinds of scenarios in the forums. Ready for you to just copy & paste.

Examples

{n} - {s00e00} - {t}Dark Angel - S03E01 - Labyrinth

V:/TV Shows/{n}/Season {s}/{sxe} - {t}V:\TV Shows\Dark Angel\Season 3\3x01 - Labyrinth

{n.space('.').lower()}.{s}{e.pad(2)}dark.angel.301

{n} ({y}){" CD$pi"}The Man from Earth (2007) CD1

{n} [{y}] {vf} {af}The Man from Earth [2007] 720p 6ch

Advanced Examples

{n.upperInitial().space('.')}.{y}.{source}.{vc}{'-'+group}The.Man.From.Earth.2007.DVDRip.XviD-ALLiANCE

{n} ({y}) by {director} [{genres[0]}, {certification}, {rating}]The Terminator (1984) by James Cameron [Action, PG-13, 8.5]

{n.space('_')}_-_{e.pad(2)}_[{resolution}_{vc}_{ac}][{crc32}]Juuni_Kokuki_-_01_[1280x720_XviD_MP3][3E16AF40]

{n.space('.')}.{'s'+s.pad(2)}e{e.pad(2)}.{t.space('.')}.{vf}.{vc}.{ac}Firefly.s01e01.Serenity.720p.x264.ac3

{n} [{airdate.format('yyyy.MM.dd')}] {t}The Daily Show [2010.01.05] George Lucas

E:/Complete/{n} ({y}){'/Season '+s}/{s+'x'}{e.pad(2)} - {t}Rename and move files. The directory structure is completely up to you.

{n.replaceTrailingBrackets()} - {s+'x'}{e.pad(2)} - {t.replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, "'")
.lowerTrail().replacePart(', Part $1')}
My personal favorite. Pretty much 1x01, normalizing accents, and lots of other cleanup operations.

Binding Reference source

Name Description Example Type
n movie / series name Dark Angel String
y movie / series year 2009 Integer
s season number 3 Integer
e episode number 1 Integer
sxe season / episode number 1x01 String
s00e00 season / episode number S01E01 String
t episode title Labyrinth String
d airdate 2009-06-01 Date
startdate series start date 2002-09-20 Date
absolute absolute episode number 42 Integer
ny name (year) Avatar (2009) String
es episode numbers [1, 2, 3] Integer*
sy season years [2002, 2003] Integer*
sc season count 5 Integer
di duplicate index 1 Integer
dc duplicate count 2 Integer
age age in days 7 Integer
special special number 1 Integer
episode episode object Firefly - 1x01 - Serenity Episode
series series object <series properties> Series
primaryTitle primary name Juuni Kokuki String
alias alias names [Juuni Kokuki, ...] String
movie movie object Avatar (2009) Movie
id movie / series ID 78874 Integer
tmdbid TheMovieDB ID 19995 String
imdbid IMDb ID tt0756683 String
pi movie part index 1 Integer
pn movie part count 2 Integer
lang subtitle language eng Language
subt subtitle tags .eng.forced String
plex Plex Naming Standard <relative path> File
kodi Kodi Naming Standard <relative path> File
az sort name initial A String
type object type Episode String
anime is anime episode false true | false
regular is regular episode true true | false
music music object Leona Lewis - I See You AudioTrack
album audio track album Avatar String
artist audio track artist Leona Lewis String
albumArtist album artist James Horner String
actors list of actors [Zoe Saldana, ...] String*
director movie director James Cameron String
collection movie collection Avatar Collection String
ci movie collection index 1 Integer
cy movie collection years [1977, 2019] Integer*
genre primary genre Science Fiction String
genres all genres [Science Fiction, ...] String*
languages spoken languages [eng] Language*
runtime movie / episode runtime 162 Integer
certification content rating PG-13 String
rating movie rating 7.4 Decimal
votes movie votes 17720 Integer
vc video codec x264 String
ac audio codec ac3 String
cf container format mkv String
vf standard video format 1080p String
hpi exact video format 384p String
aco audio codec profile TrueHD+Atmos String
af audio channels 6ch String
channels audio channels 5.1 String
resolution video resolution 1280x720 String
dim video dimensions [1280, 720] Integer*
bitdepth video bitdepth 10 Integer
hdr high dynamic range HDR String
bitrate bitrate in bit/s 128000 Integer
kbps bitrate in kbit/s 320 kbps String
mbps bitrate in mbit/s 2.0 Mbps String
fps frame rate 23.976 Decimal
khz sampling rate 44.1 kHz String
ws widescreen tag WS String
hd UHD / HD / SD tag HD String
source source medium BluRay String
tags movie tags [Extended Edition] String*
s3d stereoscopic 3D tag 3D SBS String
group release group ALLiANCE String
original original filename Serenity String
history original path <file path> File
info extended metadata <all properties> [String:Any]
omdb OMDb info <all properties> [String:Any]
localize dynamic localization <languages> [String:Any]
order dynamic episode order <episode orders> [String:Any]
db dynamic cross-reference <mapper> [String:Any]
fn current filename Serenity String
ext file extension mkv String
f file object <file path> File
folder folder object <folder path> File
mediaPath media path <relative path> File
mime media type [video, mkv] String*
mediaTitle embedded media title Serenity String
audioLanguages audio streams <audio languages> Language*
textLanguages subtitle streams <subtitle languages> Language*
duration media duration PT23M9.974S Duration
seconds duration in seconds 1389 Integer
minutes duration in minutes 23 Integer
hours duration in HH:mm 0:23 String
bytes file size in bytes 355660657 Integer
megabytes file size in MB 356 String
gigabytes file size in GB 0.4 String
crc32 crc32 checksum 3E16AF40 String
media media properties <media properties> [String:String]
video video streams <video streams> [String:String]*
audio audio streams <audio streams> [String:String]*
text subtitle streams <subtitle streams> [String:String]*
camera photo camera <camera properties> [String:String]
location photo location <location properties> [String:String]
self match bindings <bindings> [String:Any]
model match context <list of bindings> [String:Any]*
AnimeList Anime Lists mapper <mapping> Episode
XEM XEM mapper <mapping> Episode

Function Reference source

String.pad(length, padding = "0") Pad to length using the given character. (e.g. "1" ➔ "01")

Number.round(precision, padding = "0") Round decimal number to precision. (e.g. "3.14" ➔ "3.1")

String.match(pattern) Match pattern and return or unwind if pattern cannot be found.

String.matchAll(pattern) Match all occurrences of the given pattern or unwind if pattern cannot be found.

String.removeAll(pattern) Remove all occurrences of the given pattern. (e.g. "Wham!" ➔ "Wham")

String.removeIllegalCharacters() Strip characters which aren't allowed on Windows platforms from the given filename.

String.space(replacement) Replace all spaces. (e.g. "Doctor Who" ➔ "Doctor_Who")

String.colon(replacement) Replace all colons. (e.g. "Sissi: The Young Empress" ➔ "Sissi - The Young Empress")

String.slash(replacement)Replace all slashes. (e.g. "V_MPEG4/ISO/AVC" ➔ "V_MPEG4.ISO.AVC")

String.lower() Convert all characters to lower case. (e.g. "Firelfy" ➔ "firefly")

String.upper() Convert all characters to upper case. (e.g. "Firelfy" ➔ "FIREFLY")

String.upperInitial() Convert all initial characters to upper case. (e.g. "The Day a new Demon was born" ➔ "The Day A New Demon Was Born")

String.lowerTrail() Convert all trailing characters to lower case. (e.g. "Gundam SEED" ➔ "Gundam Seed")

String.sortName() Convert to sort name. (e.g. "The Walking Dead" ➔ "Walking Dead")

String.sortInitial() Reduce first name to initials. (e.g. "James Cameron" ➔ "J. Cameron")

String.before(pattern) Match substring before the given pattern or return the original value.

String.after(pattern) Match substring before the given pattern or return the original value.

String.replaceAll(pattern, replacement) Replace all occurances of the given pattern.

String.replaceTrailingBrackets(replacement = "") Replace trailing parenthesis. (e.g. "The IT Crowd (UK)" ➔ "The IT Crowd")

String.replacePart(replacement = "") Replace trailing part number. (e.g. "Today Is the Day (1)" ➔ "Today Is the Day, Part 1")

String.acronym() Convert to acronym. (e.g. "Deep Space 9" ➔ "DS9")

String.roman() Replace numbers 1..12 with Roman numerals. (e.g. "Star Wars: Episode 4" ➔ "Star Wars: Episode IV")

String.ascii() Convert Unicode characters to ASCII. (e.g. "カタカナ" ➔ "katakana")

String.asciiQuotes() Convert Unicode quotation marks to ASCII.

String.transliterate(identifier)Apply any ICU script transliteration. (e.g. "中国" ➔ "zhōng guó")

String.isLatin() Check if the String contains any non-Latin characters.

File.derive{closure} Add values to the filename. (e.g. "Avatar (2009).mp4" ➔ "Avatar (2009) [720p].mp4")

Need some help getting started? Check the forums.