2011-08-26 22:20:40 -04:00
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv = "content-type" content = "text/html; charset=utf-8" / >
< title > Episode Format Expression< / title >
< link rel = "stylesheet" href = "base.css" type = "text/css" / >
2011-08-31 07:06:24 -04:00
< link rel = "stylesheet" href = "code.css" type = "text/css" / >
2011-08-26 22:20:40 -04:00
< link rel = "icon" href = "favicon.png" / >
2011-08-27 02:20:15 -04:00
< script type = "text/javascript" >
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-25379256-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
< / script >
2011-08-26 22:20:40 -04:00
< / head >
< body >
< div class = "page" >
< div class = "header" >
< img class = "logo" alt = "logo" src = "images/icon.png" / >
< h1 >
Episode Format Expressions
< span class = "description" > User defined episode naming scheme< / span >
< / h1 >
< / div >
< div class = "content" >
< div class = "screenshot" >
< a href = "gallery.html#screenshots/original/dialog.format.png" title = "Episode Format Dialog" target = "_blank" >
< img alt = "screenshot" src = "screenshots/medium/dialog.format.png" / >
< / a >
< / div >
< div class = "section about" >
< h2 > About< / h2 >
< p >
2011-08-31 07:06:24 -04:00
You can easily define your own episode naming scheme. It uses < a href = "http://groovy.codehaus.org" > Groovy< / a > expressions,
2011-08-26 22:20:40 -04:00
which means that you can do pretty much anything, especially if you know a little bit about programming.
You even get media info bindings.
< / p >
< h2 > Examples< / h2 >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "block start" > {< / span > < span class = "variable" > n< / span > < span class = "block end" > }< / span > - < span class = "block start" > {< / span > < span class = "variable" > s< / span > < span class = "block end" > }< / span > .< span class = "block start" > {< / span > < span class = "variable" > e< / span > < span class = "block end" > }< / span > - < span class = "block start" > {< / span > < span class = "variable" > t< / span > < span class = "block end" > }< / span > < / code >
2011-08-26 22:20:40 -04:00
Dark Angel - 3.1 - Labyrinth
< / p >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "block start" > {< / span > < span class = "variable" > n< / span > < span class = "block end" > }< / span > - < span class = "block start" > {< / span > < span class = "string" > 'S'< / span > +< span class = "variable" > s< / span > .< span class = "method" > < span class = "method" > pad< / span > < / span > (< span class = "numeral" > 2< / span > )< span class = "block end" > }< / span > E< span class = "block start" > {< / span > < span class = "variable" > e< / span > .< span class = "method" > pad< / span > (< span class = "numeral" > 2< / span > )< span class = "block end" > }< / span > - < span class = "block start" > {< / span > < span class = "variable" > t< / span > < span class = "block end" > }< / span > < / code > Dark Angel - S03E01 - Labyrinth
2011-08-26 22:20:40 -04:00
< / p >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "block start" > {< / span > < span class = "variable" > n< / span > < span class = "block end" > }< / span > - < span class = "block start" > {< / span > < span class = "variable" > s< / span > +< span class = "string" > 'x'< / span > < span class = "block end" > }< / span > < span class = "block start" > {< / span > < span class = "variable" > e< / span > .< span class = "method" > pad< / span > (< span class = "numeral" > 2< / span > )< span class = "block end" > }< / span > < / code > Dark Angel - 3x01 - Labyrinth
2011-08-26 22:20:40 -04:00
< / p >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "block start" > {< / span > < span class = "variable" > n< / span > .< span class = "method" > space< / span > (< span class = "string" > '.'< / span > ).< span class = "method" > lower< / span > ()< span class = "block end" > }< / span > .< span class = "block start" > {< / span > < span class = "variable" > s< / span > < span class = "block end" > }< / span > < span class = "block start" > {< / span > < span class = "variable" > e< / span > .< span class = "method" > pad< / span > (< span class = "numeral" > 2< / span > )< span class = "block end" > }< / span > < / code > dark.angel.301
2011-08-26 22:20:40 -04:00
< / p >
< h2 > Advanced Examples< / h2 >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "block start" > {< / span > < span class = "variable" > n< / span > .< span class = "method" > space< / span > (< span class = "string" > '_'< / span > )< span class = "block end" > }< / span > _-_< span class = "block start" > {< / span > < span class = "variable" > e< / span > .< span class = "method" > pad< / span > (< span class = "numeral" > 2< / span > )< span class = "block end" > }< / span > _[< span class = "block start" > {< / span > < span class = "variable" > resolution< / span > < span class = "block end" > }< / span > _< span class = "block start" > {< / span > < span class = "variable" > vc< / span > < span class = "block end" > }< / span > _< span class = "block start" > {< / span > < span class = "variable" > ac< / span > < span class = "block end" > }< / span > ][< span class = "block start" > {< / span > < span class = "variable" > crc32< / span > < span class = "block end" > }< / span > ]< / code > Juuni_Kokuki_-_01_[1280x720_XviD_MP3][3E16AF40]
2011-08-26 22:20:40 -04:00
< / p >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "block start" > {< / span > < span class = "variable" > n< / span > .< span class = "method" > space< / span > (< span class = "string" > '.'< / span > )< span class = "block end" > }< / span > .< span class = "block start" > {< / span > < span class = "string" > 's'< / span > +< span class = "variable" > s< / span > .< span class = "method" > pad< / span > (< span class = "numeral" > 2< / span > )< span class = "block end" > }< / span > e< span class = "block start" > {< / span > < span class = "variable" > e< / span > .< span class = "method" > pad< / span > (< span class = "numeral" > 2< / span > )< span class = "block end" > }< / span > .< span class = "block start" > {< / span > < span class = "variable" > t< / span > .< span class = "method" > space< / span > (< span class = "string" > '.'< / span > )< span class = "block end" > }< / span > .< span class = "block start" > {< / span > < span class = "variable" > vf< / span > < span class = "block end" > }< / span > .< span class = "block start" > {< / span > < span class = "variable" > vc< / span > .< span class = "method" > lower< / span > ()< span class = "block end" > }< / span > .< span class = "block start" > {< / span > < span class = "variable" > ac< / span > .< span class = "method" > lower< / span > ()< span class = "block end" > }< / span > < / code > Firefly.s01e01.Serenity.720p.x264.ac3
2011-08-26 22:20:40 -04:00
< / p >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "block start" > {< / span > < span class = "variable" > n< / span > < span class = "block end" > }< / span > [< span class = "block start" > {< / span > < span class = "variable" > airdate< / span > .< span class = "method" > format< / span > (< span class = "string" > 'yyyy.MM.dd'< / span > )< span class = "block end" > }< / span > ] < span class = "block start" > {< / span > < span class = "variable" > t< / span > < span class = "block end" > }< / span > < / code > The Daily Show [2010.01.05] George Lucas
2011-08-26 22:20:40 -04:00
< / p >
< p >
2011-08-31 07:06:24 -04:00
< code > E:/Complete/< span class = "block start" > {< / span > < span class = "variable" > n< / span > < span class = "block end" > }< / span > < span class = "block start" > {< / span > < span class = "string" > '/Season '< / span > +< span class = "variable" > s< / span > < span class = "block end" > }< / span > /< span class = "block start" > {< / span > < span class = "variable" > s< / span > +< span class = "string" > 'x'< / span > < span class = "block end" > }< / span > < span class = "block start" > {< / span > < span class = "variable" > e< / span > .< span class = "method" > pad< / span > (< span class = "numeral" > 2< / span > )< span class = "block end" > }< / span > - < span class = "block start" > {< / span > < span class = "variable" > t< / span > < span class = "block end" > }< / span > < / code > Rename and move. The directory structure is completely up to you.
2011-08-26 22:20:40 -04:00
< / p >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "block start" > {< / span > < span class = "variable" > n< / span > .< span class = "method" > replaceTrailingBraces< / span > ()< span class = "block end" > }< / span > - < span class = "block start" > {< / span > < span class = "variable" > s< / span > +< span class = "string" > 'x'< / span > < span class = "block end" > }< / span > < span class = "block start" > {< / span > < span class = "variable" > e< / span > .< span class = "method" > pad< / span > (< span class = "numeral" > 2< / span > )< span class = "block end" > }< / span > - < span class = "block start" > {< / span > < span class = "variable" > t< / span > .< span class = "method" > replaceAll< / span > (< span class = "regex" > /[!?.]+$/< / span > ).< span class = "method" > replaceAll< / span > (< span class = "regex" > /[`´ ]/< / span > , < span class = "string" > "'"< / span > ).< span class = "method" > lowerTrail< / span > ().< span class = "method" > replacePart< / span > (< span class = "string" > ', Part $1'< / span > )< span class = "block end" > }< / span > < / code > My personal favorite. Pretty much 1x01, but with lots of cleanup operations.
2011-08-26 22:20:40 -04:00
< / p >
2011-09-12 21:46:27 -04:00
< h2 >
Binding Reference
< a href = "http://filebot.svn.sourceforge.net/viewvc/filebot/trunk/source/net/sourceforge/filebot/format/EpisodeBindingBean.java?view=markup" class = "source" onclick = "_gaq.push(['_trackPageview', '/source/EpisodeBindingBean.java'])" target = "_blank" > source< / a >
< / h2 >
2011-09-15 05:51:22 -04:00
< table class = "reference binding" >
2011-08-26 22:20:40 -04:00
< tr >
< th > Name< / th >
< th > Description< / th >
< th > Example< / th >
< / tr >
< tr >
< td > n< / td >
< td > series name< / td >
< td > Dark Angel< / td >
< / tr >
< tr >
< td > s< / td >
< td > season number< / td >
< td > 3< / td >
< / tr >
< tr >
< td > e< / td >
< td > episode number< / td >
< td > 1< / td >
< / tr >
< tr >
< td > t< / td >
< td > episode title< / td >
< td > Labyrinth< / td >
< / tr >
< tr >
< td > airdate< / td >
< td > episode airdate< / td >
< td > 2009-06-01< / td >
< / tr >
< tr >
< td > absolute< / td >
< td > absolute episode number< / td >
< td > 42< / td >
< / tr >
< tr >
< td > special< / td >
< td > special epsiode number< / td >
< td > 1< / td >
< / tr >
< tr >
< td > vc< / td >
< td > video codec< / td >
< td > x264< / td >
< / tr >
< tr >
< td > ac< / td >
< td > audio codec< / td >
< td > ac3< / td >
< / tr >
< tr >
< td > cf< / td >
< td > container format< / td >
< td > mkv< / td >
< / tr >
< tr >
< td > vf< / td >
< td > video format< / td >
< td > 720p< / td >
< / tr >
< tr >
< td > resolution< / td >
< td > video size< / td >
< td > 1280x720< / td >
< / tr >
< tr >
< td > crc32< / td >
< td > crc32 checksum< / td >
< td > 3E16AF40< / td >
< / tr >
< tr >
< td > fn< / td >
< td > file name< / td >
< td > Serenity< / td >
< / tr >
< tr >
< td > ext< / td >
< td > file extension< / td >
< td > mkv< / td >
< / tr >
< tr >
< td > episode< / td >
< td > episode object< / td >
< td > < default name> < / td >
< / tr >
< tr >
< td > file< / td >
< td > file object< / td >
< td > < file path> < / td >
< / tr >
< tr >
< td > media< / td >
< td > general media info object< / td >
< td > < any general media parameter> < / td >
< / tr >
< tr >
< td > video< / td >
< td > video object [stream 0]< / td >
< td > < any video parameter> < / td >
< / tr >
< tr >
< td > audio< / td >
< td > audio object [stream 0]< / td >
< td > < any audio parameter> < / td >
< / tr >
< tr >
< td > text< / td >
< td > subtitle object [stream 0]< / td >
< td > < any subtitle parameter> < / td >
< / tr >
< / table >
2011-09-12 21:46:27 -04:00
< h2 >
Function Reference
< a href = "http://filebot.svn.sourceforge.net/viewvc/filebot/trunk/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy?view=markup" class = "source" onclick = "_gaq.push(['_trackPageview', '/source/ExpressionFormat.lib.groovy'])" target = "_blank" > source< / a >
< / h2 >
2011-08-26 22:20:40 -04:00
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "method" > pad< / span > (< span class = "numeral" > length< / span > , < span class = "string" > padding< / span > = < span class = "string" > "0"< / span > )< / code > Pad strings or numbers with given characters ('0' by default).
2011-08-26 22:20:40 -04:00
< / p >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "method" > replaceAll< / span > (< span class = "regex" > pattern< / span > , < span class = "string" > replacement< / span > = < span class = "string" > ""< / span > )< / code > Replace or remove all occurrences of the pattern.
2011-08-26 22:20:40 -04:00
< / p >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "method" > space< / span > (< span class = "string" > replacement< / span > )< / code > Replace all spaces (e.g. "Doctor Who" -> "Doctor_Who").
2011-08-26 22:20:40 -04:00
< / p >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "method" > upperInitial< / span > ()< / code > Upper-case all initials (e.g. "The Day a new Demon was born" -> "The Day A New Demon Was Born").
2011-08-26 22:20:40 -04:00
< / p >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "method" > lowerTrail< / span > ()< / code > Lower-case all letters that are not initials (e.g. "Gundam SEED" -> "Gundam Seed").
2011-08-26 22:20:40 -04:00
< / p >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "method" > match< / span > (< span class = "regex" > pattern< / span > )< / code > Get a substring matching the given pattern or nothing at all.
2011-08-26 22:20:40 -04:00
< / p >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "method" > before< / span > (< span class = "regex" > pattern< / span > )< / code > Get the substring before the given pattern or the original value.
2011-08-26 22:20:40 -04:00
< / p >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "method" > after< / span > (< span class = "regex" > pattern< / span > )< / code > Get the substring after the given pattern or the original value.
2011-08-26 22:20:40 -04:00
< / p >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "method" > replaceTrailingBraces< / span > (< span class = "string" > replacement< / span > = < span class = "string" > ""< / span > )< / code > Replace trailing parenthesis including any leading whitespace (e.g. "The IT Crowd (UK)" -> "The IT Crowd").
2011-08-26 22:20:40 -04:00
< / p >
< p >
2011-08-31 07:06:24 -04:00
< code > < span class = "method" > replacePart< / span > (< span class = "string" > replacement< / span > = < span class = "string" > ""< / span > )< / code > Replace part identifier (e.g. "Today Is the Day (1)" -> "Today Is the Day, Part 1").
2011-08-26 22:20:40 -04:00
< / p >
< / div >
< div class = "footer" style = "margin-top: 100px" >
< div id = "sflogo" >
< a href = "http://sourceforge.net/projects/filebot" >
< img src = "http://sflogo.sourceforge.net/sflogo.php?group_id=202747&type=1" width = "88" height = "31" border = "0" alt = "SourceForge.net Logo" / >
< / a >
< / div >
Hosted on < a href = "http://sourceforge.net" > sourceforge.net< / a >
2011-08-31 07:06:24 -04:00
| Creative Commons License: Attribution-NonCommercial-ShareAlike. © 2011
2011-08-26 22:20:40 -04:00
< / div >
< / div >
< / div >
< / body >
< / html >