Rename Episode
Renames and moves a TV episode into a standard show and season folder structure, using a naming pattern.
Input: TV/The ShowName/The ShowName - 1x01.mkv
Output: TV/ShowName, The (1999)/Season 01/ShowName, The (1999) - s01e01 - Pilot.mkv
Run a TV Episode Lookup before this flow element for the best results. Without it, the episode is read from the file name and its folders, which often has no episode title and no year for the show.
Where the episode's details come from
- TV Episode Lookup variables. If a TV Episode Lookup earlier in the flow found the episode, its show, year, season, episode, title and IDs are used.
- The file name and folders. Otherwise, as much as possible is read from the file's path.
| Path | Show | Year | Season | Episode | Title |
|---|---|---|---|---|---|
The ShowName/The ShowName - 1x01.mkv | The ShowName | 1 | 1 | ||
The ShowName/The ShowName - S1E1.mkv | The ShowName | 1 | 1 | ||
The ShowName/The ShowName - 101.mkv | The ShowName | 1 | 1 | ||
The ShowName/The ShowName - S01E01-E02.mkv | The ShowName | 1 | 1-2 | ||
The Show (2005)/Season 2/the.show.s02e03.mkv | The Show | 2005 | 2 | 3 | |
Some Show/Season 2/Episode 5.mkv | Some Show | 2 | 5 | ||
Some Show/Specials/Some Show - E03.mkv | Some Show | 0 | 3 | ||
Alien.Earth.S01E06.The.Fly.1080p.WEB-DL.mkv | Alien Earth | 1 | 6 | The Fly | |
The Walking Dead (2010) [tvdbid-153021]/Season 07/S07E03 - The Cell.mkv | The Walking Dead | 2010 | 7 | 3 | The Cell |
Release details such as 720p, 1080p or x264 are never mistaken for an episode number. A show's folder written as Simpsons, The is read as The Simpsons, so renaming an already renamed file gives the same name.
If the season and episode cannot be found, the file is not changed and output 2 is called.
New Name
The episode's new name: its folders and file name, relative to the Destination Folder. Pick one of the common naming formats, or Custom to write your own. What the picked one gives is shown under it:
| Name | New Name | Example |
|---|---|---|
| Show, The (Year) / Season 01 / Show, The (Year) - s01e01 - Title | {Show|the} ({Year})/Season {Season|00}/{Show|the} ({Year}) - s{Season|00}e{Episode|00} - {Title}{ext} | Simpsons, The (1989)/Season 01/Simpsons, The (1989) - s01e01 - Simpsons Roasting on an Open Fire.mkv |
| Show (Year) / Season 01 / Show (Year) - S01E01 - Title | {Show} ({Year})/Season {Season|00}/{Show} ({Year}) - S{Season|00}E{Episode|00} - {Title}{ext} | The Simpsons (1989)/Season 01/The Simpsons (1989) - S01E01 - Simpsons Roasting on an Open Fire.mkv |
| Show / Season 01 / Show - S01E01 - Title | {Show}/Season {Season|00}/{Show} - S{Season|00}E{Episode|00} - {Title}{ext} | The Simpsons/Season 01/The Simpsons - S01E01 - Simpsons Roasting on an Open Fire.mkv |
| Show (Year) / Season 01 / S01E01 - Title | {Show} ({Year})/Season {Season|00}/S{Season|00}E{Episode|00} - {Title}{ext} | The Simpsons (1989)/Season 01/S01E01 - Simpsons Roasting on an Open Fire.mkv |
| Show.Year.S01E01.Title | {Show|dots}.{Year}.S{Season|00}E{Episode|00}.{Title|dots}{ext} | The.Simpsons.1989.S01E01.Simpsons.Roasting.on.an.Open.Fire.mkv |
| Show (Year) [tvdbid-ID] / Season 01 / Show (Year) - S01E01 - Title | {Show} ({Year}) [tvdbid-{TvdbId}]/Season {Season|00}/{Show} ({Year}) - S{Season|00}E{Episode|00} - {Title}{ext} | The Simpsons (1989) [tvdbid-71663]/Season 01/The Simpsons (1989) - S01E01 - Simpsons Roasting on an Open Fire.mkv |
The default is the first, Show, The (Year) / Season 01 / Show, The (Year) - s01e01 - Title. If the new name is ever empty, the default is used. Folders can be separated by / or \, on any operating system.
Writing a custom new name
A custom new name can use these, with + Variable to insert one and its formatter:
| Variable | Description | Example |
|---|---|---|
{Show} | The show | The Simpsons |
{Show|the} | The show, with a leading "The" moved to the end for sorting | Simpsons, The |
{Show|dots} | The show, with dots in place of spaces | The.Simpsons |
{Year} | The year the show first aired | 1989 |
{Season|00} | The season, zero padded | 01 |
{Episode|00} | The episode, zero padded | 01 |
{LastEpisode|00} | The last episode of a multi-episode file | 02 |
{Title} | The episode's title | Simpsons Roasting on an Open Fire |
{TvdbId} | The show's TheTVDB ID | 71663 |
{TmdbId} | The show's TheMovieDB ID | 456 |
{ext} | The file's extension | .mkv |
Any other variable of the flow can be used too.
Number formats use a |, for example {Season|00}. {Season:00} is not a format and is left in the name as it is.
What is not known is left out
Anything the new name uses that is not known is removed along with what surrounds it, so there are no empty brackets or dangling separators.
| Missing | Without it |
|---|---|
| The episode's title | The Simpsons (1989) - S01E01.mkv, not The Simpsons (1989) - S01E01 - .mkv |
| The show's year | The Simpsons/Season 01/..., not The Simpsons ()/Season 01/... |
| The TVDB ID | The Simpsons (1989)/Season 01/..., not The Simpsons (1989) [tvdbid-]/... |
| The year and title, dotted | The.Simpsons.S01E01.mkv |
Multi-episode files
A file holding more than one episode names all of them: S01E01-E02. This happens wherever {Episode} is used, unless the new name uses {LastEpisode} itself.
Invalid characters
Characters that are invalid in file names on any operating system are replaced or removed, whichever system FileFlows runs on, so libraries shared with Windows stay valid.
| Value | In the name |
|---|---|
Star Trek: Discovery | Star Trek - Discovery |
AC/DC | AC-DC |
"Quoted" | 'Quoted' |
What If?, <, >, *, | | removed |
A name never ends in a dot or a space.
The file extension
The working file's extension is always kept, even if the new name does not end with {ext}.
Destination Folder
The folder the new name is relative to, for example the TV library's folder.
If empty, the folder holding the show's folder is used. A file is put into a proper season folder even when it was directly in the show's folder:
| File | Destination Folder | With the default new name |
|---|---|---|
/tv/The Show/The Show - 1x01.mkv | /tv | /tv/Show, The/Season 01/Show, The - s01e01.mkv |
/tv/The Show/Season 1/The Show - 1x01.mkv | /tv | /tv/Show, The/Season 01/Show, The - s01e01.mkv |
/tv/The Show - 1x01.mkv (in the library's folder) | /tv | /tv/Show, The/Season 01/Show, The - s01e01.mkv |
When the working file is a temporary file, for example after a conversion, the original file's location is used.
Season Folder Name
The name of a season folder for libraries in another language. For example, Staffel gives Staffel 01.
If empty, Season is used, as the placeholder shows. A folder named with it is also understood as a season folder when files are read or renamed again.
Specials Folder
If season 0 episodes go in a specials folder instead of Season 00. On by default.
Specials Folder Name
Shown when Specials Folder is on. The name of the specials folder for libraries in another language.
If empty, Specials is used, as the placeholder shows; it's the name media servers expect.
Variables
The episode's details are set as variables for the flow elements after this one, if the flow does not have them already:
| Variable | Description | Type | Example |
|---|---|---|---|
| tvepisode.Title | The show | string | The Simpsons |
| tvepisode.Subtitle | The episode's title | string | Simpsons Roasting on an Open Fire |
| tvepisode.ShowYear | The year the show first aired | number | 1989 |
| tvepisode.Season | The season | number | 1 |
| tvepisode.Episode | The episode | number | 1 |
| tvepisode.LastEpisode | Optional. The last episode of a multi-episode file | number | 2 |
| tvepisode.TmdbId | The show's TheMovieDB ID | number | 456 |
| tvepisode.TvdbId | The show's TheTVDB ID | number | 71663 |
Outputs
- Episode renamed
- Could not determine the show, season or episode