xbmc/xbmc — pull request #704 by Quentangle (2012-02-18 12:45:57+00:00)
Title: Add defaultseason attribute to TV Show regex

This is a pull request to replace the one found here.

Allow the default season to be set for TV shows. This will be used when
no season is found in the filename. If no default is set, use 1 as the
default season for the sake of both backwards compatibility and to
conform with the assumption that season 1 is the standard season, as
opposed to season 0 (usually used for special episodes).

Use of this feature is through the advancedsettings.xml configuration
file, under the tvshowmatching tag. An example is as follows.

<tvshowmatching action="append">
<regexp defaultseason="0">[\._ \-]()S([0-9]{1,3})([^\\/]*)-</regexp>
<regexp defaultseason="1">[\._ \-]()E([0-9]{1,3})([^\\/]*)-</regexp>
<regexp>[\._ \-]()X([0-9]{1,3})([^\\/]*)-</regexp>
</tvshowmatching>

Here are some sample filenames run through these settings.

Filename

XBMC Result

Comment

Foo - S001 - Title.avi	Foo - 0x1 - Title	Season forced to 0

Foo - E001 - Title.avi	Foo - 1x1 - Title	Season forced to 1 (not needed)

Foo - X001 - Title.avi	Foo - 1x1 - Title	Season defaulted to 1