Where [[Set Content (Video Library)|Content is Set]] on the top level "''TV Shows''" folder. You can have different seasons in different season subfolders under the individual TV Show folders if it suits you. XBMC does not use them, but they do not cause issues either.
{{-}}
;The defaults will match the following structures/file name formats
;Defaults for two-part TV Show Episode will match:
:foo.s01e01-02.*
:foo_[s01]_[e01-02]_*
:foo.1x01.1x02.*
;Same with three- or four-part TV Show Episode:
= Naming =
:foo.s01e01-02-03-04.*
The naming of your TV Show folder is '''critical''' to ensure the scrapers can correctly identify the TV Show and its episodes.
:foo_[s01]_[e01-02-03-04]_*
:foo.1x01.1x02.1x03.1x04.*
Where foo can be anything (including nothing).
'''''TV Show name (Year)''''' - This is the correct naming format for both the movie files and movie folders.
{{-}}
== Multi-part episodes ==
'''Note:''' If you are unsure of the name or year check it at the scraper site - either '''[https://www.themoviedb.org/ TheMovieDB website]''' or '''[https://thetvdb.com/ TheTVDB website]''' depending on which scraper you have set.
Handling of multi-part episodes (two part episodes in one file, multiple episodes in DVD images, etc.) is supported. The first matched tvshowmatching regexp and "[-EeXx]+([0-9]+)" will be repeatedly applied against a file name until no more seasons or episodes are found.
;This allows for file names such as:
:foo_s01e01e02e03_s02e01e02
:foo104-05-06-201-02
:foo1x07x08x09
To break the file up in episodes that XBMC can work with you will have to create an nfo file with <epbookmark> tags.
More information can be found on the [[Import - Export Library#TV Episodes|Import - Export Library]] page.
Note that when using a custom RegExp to match a custom file naming convention, add (.*) to the end of the RegExp so that the 3rd RegExp capture is found for the second episode.
== Filename identifiers ==
{{#lst:Naming_video_files/Movies|FilenameID}}
== Multi-file episodes ==
'''This feature has been temporarily disabled, the plan is to implement it in a better fashion at a future date.'''<br />
You can stack multiple files into one episode.
For that to be available the [[Videos Settings#Library|Stack Duplicate TV Shows]] Video Library setting needs to be enabled.
All the files must have the same season and episode number and they all have to be in the same folder. (This is to prevent unwanted stacking of true duplicates in different folders). The items will be automatically stacked in sequential order based off the filenames being sorted in a "natural" order (like this: -part1.avi, -part2.avi, ..., -part10.avi.)
== TV Show specials ==
Special episodes are currently supported with [[TheTVDB.com (Video Library)|TheTVDB.com]] scraper. In order for the XBMC scraper regular expressions to recognize them, they should be part of season 0. (Specials naming order can be observed in the Specials Season of the relevant TV show at [http://TheTVDB.com TheTVDB.com]).
;Example
:[http://thetvdb.com/?tab=season&seriesid=76736&seasonid=24194&lid=7 Black Adder's Christmas Carol] should have a file name that matches season 0 episode 2 (e.g. contain s00e02).
== TV Shows with a single season/constant series/anime/etc (Absolute numbering) ==
= TV Show Folders =
Some scrapers, such as the [[TheTVDB.com (Video Library)|TVDB.com]] scraper support absolute numbering via [[Set Contents (Video Library)#Scraper settings|scraper settings]]. That allows you to add shows to the library that have no season enumeration in the filename. This is especially useful for anime. In order for this to work you will have to add special Regexp settings via advancedsettings to catch these files
{{#lsth:advancedsettings.xml|Filenames without Season}}
== Examples ==
* The TV Show folders are saved inside the '''''[[Source_folder|Source folder]]'''''
* Doctor Who (1963) - Season 1 Episode 12: The Edge of Destruction
* Adding the (Year) makes scraping more accurate and differentiates between original and remake versions.
** Folder Name - \TV Shows\Doctor Who\ ( Folder name defined by querying theTVDB.com, http://www.thetvdb.com/?tab=series&id=76107&lid=7 )
* When using TVDB scraper for '''Country of Origin''' TV Shows, the (Year) is replaced with the country code. eg ''Hells Kitchen (UK), Hells Kitchen (US), Hells Kitchen (AU)'' etc. Check TheTVDB site to confrim.
This might be needed for some TV Shows such as "Battlestar Galactica", "Doctor Who", "Jericho", and "Knight Rider" which will have multiple entries on a given TV metadata database because of remakes of the original show.
Note! "AVI" is just an example, as this applies to all video formats that XBMC supports.
=== Custom directory structure and file names ===
You can make your own naming conventions / rules by adding or editing regular expressions in the [[advancedsettings.xml]] file, with the [[advancedsettings.xml#.3Ctvshowmatching.3E|tvshowmatching]] tag. When enumerating episodes for a series, XBMC '''only''' cares about the season and episode, so when designing regexps you should '''only''' be concerned with these things.
Here are several common naming schemes and corresponding regexps and examples.
'''\Season #\##''' (Season# is at very end of directory name, and filename starts with episode name, neither have to be a specific number of digits) :
== Split folders ==
<source lang="xml">
Split folders are TV Shows that have episodes split between two or more folders located in different Sources.
This may occur when a long running show is progressively saved on one drive but, over time, the drive has been filled with other content, forcing you to save new episodes on another drive.
'''###''' ([season#][episode#] with nothing in between all in filename, assumes episode number is always 2 digits) :
To ensure these split TV Shows are correctly scraped as the same show, you '''must''' ensure that the TV Show folder names are identical. A slight variance could see a different show scraped for the second folder. If using NFO Files, then copy the NFO file from one location into the other split folders.
'''Example''' : TV Shows\Scrubs\Season 1\Scrubs - Season 1 - Episode 01 - Pilot.avi
'''TV Shows in DVD Folders'''
{{top}}
Using the same directory structures as above, you can name DVD folders by adding the following xml to advancedsettings.xml. This information was gleaned from forum thread http://www.xbmc.org/forum/showthread.php?t=55497.
There are two components to TV Shows that need to be accurate for a successful scrape:
Correct naming of the TV Show
Correct numbering of the Episodes
Note: This page details the TV Show folder. Season folders and episodes are discussed in the following pages.
Naming
The naming of your TV Show folder is critical to ensure the scrapers can correctly identify the TV Show and its episodes.
TV Show name (Year) - This is the correct naming format for both the movie files and movie folders.
Note: If you are unsure of the name or year check it at the scraper site - either TheMovieDB website or TheTVDB website depending on which scraper you have set.
Filename identifiers
Scrapers can optionally lookup via filename identifiers since Omega (v21) if the scraper supports it. As of v21, TheMovieDB Python, TMDB TV Shows, and TV Maze scrapers support ID's in the folder or filename.
Filename identifiers are short tags added to the name of a file that directly provide metadata IDs to Kodi. This method streamlines the scraping process by giving Kodi explicit references to look for in its database. If an identifier could not be looked up using a filename identifier, Kodi falls back to the normal scraping process using title and year.
Note:
Not all scraper sites accept all ID's. It is recommended that the sites own ID is used rather than a 3rd party site (eg imdb). 3rd party ID's at scraper sites rely on users to enter that data. It is not uncommon to have these ID's missing.
TheMovieDB for Movies and TV Shows - Use TMDB's own tmdb ID but the scapers will also accepted imdb and tvdb if that data is available at the site.
TV Maze - only acceptes tvmaze ID's
TVDB - As at the release of v21 Omega, the scraper requires updating by TheTVDB
TV Show Folders
Image 1- TV Show folders
Each TV Show requires its own folder in the Source folder
The TV Show folders are saved inside the Source folder
Adding the (Year) makes scraping more accurate and differentiates between original and remake versions.
When using TVDB scraper for Country of Origin TV Shows, the (Year) is replaced with the country code. eg Hells Kitchen (UK), Hells Kitchen (US), Hells Kitchen (AU) etc. Check TheTVDB site to confrim.
The title and (year) displayed at the scraper site is how you should name your show.
Note: If you are unsure of the name or year, then check which scraper you are using and visit the appropriate site for correct naming:
Split folders are TV Shows that have episodes split between two or more folders located in different Sources.
This may occur when a long running show is progressively saved on one drive but, over time, the drive has been filled with other content, forcing you to save new episodes on another drive.
To ensure these split TV Shows are correctly scraped as the same show, you must ensure that the TV Show folder names are identical. A slight variance could see a different show scraped for the second folder. If using NFO Files, then copy the NFO file from one location into the other split folders.