Skip to content

FileMatching

Nicolas Pierre edited this page Jan 3, 2024 · 1 revision

File Matching

This document describes how the program detects the show and episode from the file name in order to determine its new name and path.

TVSorter uses regular expressions to match elements of the file name and try to ascertain the season and episode number. The formats that it accepts are listed below. All show examples of Season 2, Episode 3

  • S02E03
  • 2x03
  • 203
  • 0203
  • S02.E03

Double episodes are also supported in the format:

  • S02E03-04

TVSorter can also find episodes that are named by date. This is useful for shows such as The Colbert Report that air regularly and so use date rather than season and episode. Two date formats are accepted, both show Jan 2nd 2010.

  • 2010.01.02
  • Jan.02.2010

If TVSorter matches the episode by date then it will look this up as the airdate in an attempt to find the episode name, in the case of The Colbert Report, this is usually the guest on the show. This is also the reason that the date can be used as a variable in the output.

If a season and episode number or date cannot be found in the filename. The file is ignored and will not appear in the scan results. New regular expressions can be added in Settings, see RegularExpressions.

Once the season and episode number or date have been determined, then TVSorter assumes that everything before that point in the file name is the show's name. It replaces the separator characters '.', '-', ' ', '_' with spaces. It then takes this string and several other variations, such as removing all special characters, and then searches for this in the database checking against the show names, folder names, and alternate names. It assumes the show is the first match found.

If not match can be found and Add Unmatched Shows (see Settings) is enabled, then The TVDB will be searched for the show. If a match can be found the there, the show will be added. If the show already exists, then the name is added as an alternate name.

If a show match cannot be found or is inaccurate then it can be set manually by checking the files and click Set Show, see ScanForEpisodes.

Clone this wiki locally