2021-11-09 07:14:31 -05:00
|
|
|
#pragma warning disable CA1819
|
|
|
|
|
2019-01-13 14:54:44 -05:00
|
|
|
using System;
|
2021-12-20 06:15:20 -05:00
|
|
|
using System.Collections.Generic;
|
2018-09-12 13:26:21 -04:00
|
|
|
using System.Linq;
|
|
|
|
using System.Text.RegularExpressions;
|
2019-01-13 14:17:29 -05:00
|
|
|
using Emby.Naming.Video;
|
2019-12-06 14:40:06 -05:00
|
|
|
using MediaBrowser.Model.Entities;
|
2018-09-12 13:26:21 -04:00
|
|
|
|
2020-11-01 05:19:22 -05:00
|
|
|
// ReSharper disable StringLiteralTypo
|
|
|
|
|
2018-09-12 13:26:21 -04:00
|
|
|
namespace Emby.Naming.Common
|
|
|
|
{
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Big ugly class containing lot of different naming options that should be split and injected instead of passes everywhere.
|
|
|
|
/// </summary>
|
2018-09-12 13:26:21 -04:00
|
|
|
public class NamingOptions
|
|
|
|
{
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="NamingOptions"/> class.
|
|
|
|
/// </summary>
|
2018-09-12 13:26:21 -04:00
|
|
|
public NamingOptions()
|
|
|
|
{
|
2019-05-10 14:37:42 -04:00
|
|
|
VideoFileExtensions = new[]
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
2022-02-07 12:36:07 -05:00
|
|
|
".001",
|
|
|
|
".3g2",
|
2018-09-12 13:26:21 -04:00
|
|
|
".3gp",
|
2022-02-07 12:36:07 -05:00
|
|
|
".amv",
|
2018-09-12 13:26:21 -04:00
|
|
|
".asf",
|
|
|
|
".asx",
|
|
|
|
".avi",
|
|
|
|
".bin",
|
2022-02-07 12:36:07 -05:00
|
|
|
".bivx",
|
|
|
|
".divx",
|
|
|
|
".dv",
|
2018-09-12 13:26:21 -04:00
|
|
|
".dvr-ms",
|
2022-02-07 12:36:07 -05:00
|
|
|
".f4v",
|
|
|
|
".fli",
|
|
|
|
".flv",
|
|
|
|
".ifo",
|
|
|
|
".img",
|
|
|
|
".iso",
|
|
|
|
".m2t",
|
|
|
|
".m2ts",
|
|
|
|
".m2v",
|
|
|
|
".m4v",
|
2018-09-12 13:26:21 -04:00
|
|
|
".mkv",
|
2022-02-07 12:36:07 -05:00
|
|
|
".mk3d",
|
|
|
|
".mov",
|
|
|
|
".mp4",
|
|
|
|
".mpe",
|
|
|
|
".mpeg",
|
|
|
|
".mpg",
|
|
|
|
".mts",
|
|
|
|
".mxf",
|
|
|
|
".nrg",
|
|
|
|
".nsv",
|
2018-09-12 13:26:21 -04:00
|
|
|
".nuv",
|
2022-02-07 12:36:07 -05:00
|
|
|
".ogg",
|
|
|
|
".ogm",
|
|
|
|
".ogv",
|
|
|
|
".pva",
|
|
|
|
".qt",
|
|
|
|
".rec",
|
|
|
|
".rm",
|
|
|
|
".rmvb",
|
2022-03-05 09:06:59 -05:00
|
|
|
".strm",
|
2022-02-07 12:36:07 -05:00
|
|
|
".svq3",
|
|
|
|
".tp",
|
|
|
|
".ts",
|
|
|
|
".ty",
|
2018-09-12 13:26:21 -04:00
|
|
|
".viv",
|
2022-02-07 12:36:07 -05:00
|
|
|
".vob",
|
|
|
|
".vp3",
|
|
|
|
".webm",
|
|
|
|
".wmv",
|
|
|
|
".wtv",
|
|
|
|
".xvid"
|
2018-09-12 13:26:21 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
VideoFlagDelimiters = new[]
|
|
|
|
{
|
|
|
|
'(',
|
|
|
|
')',
|
|
|
|
'-',
|
|
|
|
'.',
|
|
|
|
'_',
|
|
|
|
'[',
|
|
|
|
']'
|
|
|
|
};
|
|
|
|
|
|
|
|
StubFileExtensions = new[]
|
|
|
|
{
|
|
|
|
".disc"
|
|
|
|
};
|
|
|
|
|
|
|
|
StubTypes = new[]
|
|
|
|
{
|
2020-11-01 04:47:31 -05:00
|
|
|
new StubTypeRule(
|
|
|
|
stubType: "dvd",
|
|
|
|
token: "dvd"),
|
|
|
|
|
|
|
|
new StubTypeRule(
|
|
|
|
stubType: "hddvd",
|
|
|
|
token: "hddvd"),
|
|
|
|
|
|
|
|
new StubTypeRule(
|
|
|
|
stubType: "bluray",
|
|
|
|
token: "bluray"),
|
|
|
|
|
|
|
|
new StubTypeRule(
|
|
|
|
stubType: "bluray",
|
|
|
|
token: "brrip"),
|
|
|
|
|
|
|
|
new StubTypeRule(
|
|
|
|
stubType: "bluray",
|
|
|
|
token: "bd25"),
|
|
|
|
|
|
|
|
new StubTypeRule(
|
|
|
|
stubType: "bluray",
|
|
|
|
token: "bd50"),
|
|
|
|
|
|
|
|
new StubTypeRule(
|
|
|
|
stubType: "vhs",
|
|
|
|
token: "vhs"),
|
|
|
|
|
|
|
|
new StubTypeRule(
|
|
|
|
stubType: "tv",
|
|
|
|
token: "HDTV"),
|
|
|
|
|
|
|
|
new StubTypeRule(
|
|
|
|
stubType: "tv",
|
|
|
|
token: "PDTV"),
|
|
|
|
|
|
|
|
new StubTypeRule(
|
|
|
|
stubType: "tv",
|
|
|
|
token: "DSR")
|
2018-09-12 13:26:21 -04:00
|
|
|
};
|
|
|
|
|
2021-12-10 08:23:31 -05:00
|
|
|
VideoFileStackingRules = new[]
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
2021-12-10 08:23:31 -05:00
|
|
|
new FileStackRule(@"^(?<filename>.*?)(?:(?<=[\]\)\}])|[ _.-]+)[\(\[]?(?<parttype>cd|dvd|part|pt|dis[ck])[ _.-]*(?<number>[0-9]+)[\)\]]?(?:\.[^.]+)?$", true),
|
|
|
|
new FileStackRule(@"^(?<filename>.*?)(?:(?<=[\]\)\}])|[ _.-]+)[\(\[]?(?<parttype>cd|dvd|part|pt|dis[ck])[ _.-]*(?<number>[a-d])[\)\]]?(?:\.[^.]+)?$", false),
|
|
|
|
new FileStackRule(@"^(?<filename>.*?)(?:(?<=[\]\)\}])|[ _.-]?)(?<number>[a-d])(?:\.[^.]+)?$", false)
|
2018-09-12 13:26:21 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
CleanDateTimes = new[]
|
|
|
|
{
|
2020-08-12 11:02:19 -04:00
|
|
|
@"(.+[^_\,\.\(\)\[\]\-])[_\.\(\)\[\]\-](19[0-9]{2}|20[0-9]{2})(?![0-9]+|\W[0-9]{2}\W[0-9]{2})([ _\,\.\(\)\[\]\-][^0-9]|).*(19[0-9]{2}|20[0-9]{2})*",
|
|
|
|
@"(.+[^_\,\.\(\)\[\]\-])[ _\.\(\)\[\]\-]+(19[0-9]{2}|20[0-9]{2})(?![0-9]+|\W[0-9]{2}\W[0-9]{2})([ _\,\.\(\)\[\]\-][^0-9]|).*(19[0-9]{2}|20[0-9]{2})*"
|
2018-09-12 13:26:21 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
CleanStrings = new[]
|
|
|
|
{
|
2022-10-08 07:45:33 -04:00
|
|
|
@"^\s*(?<cleaned>.+?)[ _\,\.\(\)\[\]\-](3d|sbs|tab|hsbs|htab|mvc|HDR|HDC|UHD|UltraHD|4k|ac3|dts|custom|dc|divx|divx5|dsr|dsrip|dutch|dvd|dvdrip|dvdscr|dvdscreener|screener|dvdivx|cam|fragment|fs|hdtv|hdrip|hdtvrip|internal|limited|multisubs|ntsc|ogg|ogm|pal|pdtv|proper|repack|rerip|retail|cd[1-9]|r5|bd5|bd|se|svcd|swedish|german|read.nfo|nfofix|unrated|ws|telesync|ts|telecine|tc|brrip|bdrip|480p|480i|576p|576i|720p|720i|1080p|1080i|2160p|hrhd|hrhdtv|hddvd|bluray|blu-ray|x264|x265|h264|h265|xvid|xvidvd|xxx|www.www|AAC|DTS|\[.*\])([ _\,\.\(\)\[\]\-]|$)",
|
2021-08-03 16:46:56 -04:00
|
|
|
@"^(?<cleaned>.+?)(\[.*\])",
|
2021-08-05 02:25:54 -04:00
|
|
|
@"^\s*(?<cleaned>.+?)\WE[0-9]+(-|~)E?[0-9]+(\W|$)",
|
2021-08-03 16:46:56 -04:00
|
|
|
@"^\s*\[[^\]]+\](?!\.\w+$)\s*(?<cleaned>.+)",
|
2021-08-05 02:25:54 -04:00
|
|
|
@"^\s*(?<cleaned>.+?)\s+-\s+[0-9]+\s*$"
|
2018-09-12 13:26:21 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
SubtitleFileExtensions = new[]
|
|
|
|
{
|
2022-01-27 08:21:53 -05:00
|
|
|
".ass",
|
2022-02-07 12:36:07 -05:00
|
|
|
".mks",
|
2022-01-27 08:21:53 -05:00
|
|
|
".sami",
|
2022-02-07 12:36:07 -05:00
|
|
|
".smi",
|
2018-09-12 13:26:21 -04:00
|
|
|
".srt",
|
|
|
|
".ssa",
|
2022-01-27 08:21:53 -05:00
|
|
|
".sub",
|
|
|
|
".vtt",
|
2018-09-12 13:26:21 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
AlbumStackingPrefixes = new[]
|
|
|
|
{
|
|
|
|
"cd",
|
2022-02-07 12:36:07 -05:00
|
|
|
"disc",
|
2018-09-12 13:26:21 -04:00
|
|
|
"disk",
|
|
|
|
"vol",
|
|
|
|
"volume"
|
|
|
|
};
|
|
|
|
|
2022-03-28 17:11:21 -04:00
|
|
|
ArtistSubfolders = new[]
|
|
|
|
{
|
|
|
|
"albums",
|
|
|
|
"broadcasts",
|
|
|
|
"bootlegs",
|
|
|
|
"compilations",
|
|
|
|
"dj-mixes",
|
|
|
|
"eps",
|
|
|
|
"live",
|
|
|
|
"mixtapes",
|
|
|
|
"others",
|
|
|
|
"remixes",
|
|
|
|
"singles",
|
|
|
|
"soundtracks",
|
|
|
|
"spokenwords",
|
|
|
|
"streets"
|
|
|
|
};
|
|
|
|
|
2018-09-12 13:26:21 -04:00
|
|
|
AudioFileExtensions = new[]
|
|
|
|
{
|
2022-02-07 12:36:07 -05:00
|
|
|
".669",
|
|
|
|
".3gp",
|
|
|
|
".aa",
|
2018-09-12 13:26:21 -04:00
|
|
|
".aac",
|
2022-02-07 12:36:07 -05:00
|
|
|
".aax",
|
|
|
|
".ac3",
|
|
|
|
".act",
|
|
|
|
".adp",
|
|
|
|
".adplug",
|
|
|
|
".adx",
|
|
|
|
".afc",
|
2018-09-12 13:26:21 -04:00
|
|
|
".amf",
|
2022-02-07 12:36:07 -05:00
|
|
|
".aif",
|
|
|
|
".aiff",
|
|
|
|
".alac",
|
|
|
|
".amr",
|
|
|
|
".ape",
|
|
|
|
".ast",
|
|
|
|
".au",
|
|
|
|
".awb",
|
|
|
|
".cda",
|
|
|
|
".cue",
|
2018-09-12 13:26:21 -04:00
|
|
|
".dmf",
|
2022-02-07 12:36:07 -05:00
|
|
|
".dsf",
|
2018-09-12 13:26:21 -04:00
|
|
|
".dsm",
|
2022-02-07 12:36:07 -05:00
|
|
|
".dsp",
|
|
|
|
".dts",
|
|
|
|
".dvf",
|
2018-09-12 13:26:21 -04:00
|
|
|
".far",
|
2022-02-07 12:36:07 -05:00
|
|
|
".flac",
|
2018-09-12 13:26:21 -04:00
|
|
|
".gdm",
|
2022-02-07 12:36:07 -05:00
|
|
|
".gsm",
|
|
|
|
".gym",
|
|
|
|
".hps",
|
2018-09-12 13:26:21 -04:00
|
|
|
".imf",
|
|
|
|
".it",
|
|
|
|
".m15",
|
2022-02-07 12:36:07 -05:00
|
|
|
".m4a",
|
|
|
|
".m4b",
|
|
|
|
".mac",
|
2018-09-12 13:26:21 -04:00
|
|
|
".med",
|
2022-02-07 12:36:07 -05:00
|
|
|
".mka",
|
|
|
|
".mmf",
|
|
|
|
".mod",
|
|
|
|
".mogg",
|
|
|
|
".mp2",
|
|
|
|
".mp3",
|
|
|
|
".mpa",
|
|
|
|
".mpc",
|
|
|
|
".mpp",
|
|
|
|
".mp+",
|
|
|
|
".msv",
|
|
|
|
".nmf",
|
|
|
|
".nsf",
|
|
|
|
".nsv",
|
|
|
|
".oga",
|
|
|
|
".ogg",
|
2018-09-12 13:26:21 -04:00
|
|
|
".okt",
|
2022-02-07 12:36:07 -05:00
|
|
|
".opus",
|
|
|
|
".pls",
|
|
|
|
".ra",
|
|
|
|
".rf64",
|
|
|
|
".rm",
|
2018-09-12 13:26:21 -04:00
|
|
|
".s3m",
|
|
|
|
".sfx",
|
2022-02-07 12:36:07 -05:00
|
|
|
".shn",
|
|
|
|
".sid",
|
|
|
|
".spc",
|
|
|
|
".stm",
|
|
|
|
".strm",
|
2018-09-12 13:26:21 -04:00
|
|
|
".ult",
|
|
|
|
".uni",
|
2022-02-07 12:36:07 -05:00
|
|
|
".vox",
|
|
|
|
".wav",
|
|
|
|
".wma",
|
2018-09-12 13:26:21 -04:00
|
|
|
".wv",
|
2022-02-07 12:36:07 -05:00
|
|
|
".xm",
|
2018-09-12 13:26:21 -04:00
|
|
|
".xsp",
|
2022-02-07 12:36:07 -05:00
|
|
|
".ymf"
|
2018-09-12 13:26:21 -04:00
|
|
|
};
|
|
|
|
|
2022-02-07 12:36:07 -05:00
|
|
|
MediaFlagDelimiters = new[]
|
2022-01-27 08:21:53 -05:00
|
|
|
{
|
2022-03-04 04:52:15 -05:00
|
|
|
'.'
|
2022-01-27 08:21:53 -05:00
|
|
|
};
|
|
|
|
|
2022-02-07 12:36:07 -05:00
|
|
|
MediaForcedFlags = new[]
|
2022-01-27 08:21:53 -05:00
|
|
|
{
|
|
|
|
"foreign",
|
|
|
|
"forced"
|
|
|
|
};
|
|
|
|
|
2022-02-07 12:36:07 -05:00
|
|
|
MediaDefaultFlags = new[]
|
2022-01-27 08:21:53 -05:00
|
|
|
{
|
|
|
|
"default"
|
|
|
|
};
|
|
|
|
|
2022-10-07 06:38:05 -04:00
|
|
|
MediaHearingImpairedFlags = new[]
|
|
|
|
{
|
|
|
|
"cc",
|
|
|
|
"hi",
|
|
|
|
"sdh"
|
|
|
|
};
|
|
|
|
|
2018-09-12 13:26:21 -04:00
|
|
|
EpisodeExpressions = new[]
|
|
|
|
{
|
|
|
|
// *** Begin Kodi Standard Naming
|
|
|
|
// <!-- foo.s01.e01, foo.s01_e01, S01E02 foo, S01 - E02 -->
|
|
|
|
new EpisodeExpression(@".*(\\|\/)(?<seriesname>((?![Ss]([0-9]+)[][ ._-]*[Ee]([0-9]+))[^\\\/])*)?[Ss](?<seasonnumber>[0-9]+)[][ ._-]*[Ee](?<epnumber>[0-9]+)([^\\/]*)$")
|
|
|
|
{
|
|
|
|
IsNamed = true
|
2019-01-07 18:27:46 -05:00
|
|
|
},
|
2018-09-12 13:26:21 -04:00
|
|
|
// <!-- foo.ep01, foo.EP_01 -->
|
|
|
|
new EpisodeExpression(@"[\._ -]()[Ee][Pp]_?([0-9]+)([^\\/]*)$"),
|
2021-08-03 01:20:36 -04:00
|
|
|
// <!-- foo.E01., foo.e01. -->
|
|
|
|
new EpisodeExpression(@"[^\\/]*?()\.?[Ee]([0-9]+)\.([^\\/]*)$"),
|
2020-11-06 09:52:01 -05:00
|
|
|
new EpisodeExpression("(?<year>[0-9]{4})[\\.-](?<month>[0-9]{2})[\\.-](?<day>[0-9]{2})", true)
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
2019-05-10 14:37:42 -04:00
|
|
|
DateTimeFormats = new[]
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
|
|
|
"yyyy.MM.dd",
|
|
|
|
"yyyy-MM-dd",
|
|
|
|
"yyyy_MM_dd"
|
|
|
|
}
|
|
|
|
},
|
2020-11-06 09:52:01 -05:00
|
|
|
new EpisodeExpression(@"(?<day>[0-9]{2})[.-](?<month>[0-9]{2})[.-](?<year>[0-9]{4})", true)
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
2019-05-10 14:37:42 -04:00
|
|
|
DateTimeFormats = new[]
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
|
|
|
"dd.MM.yyyy",
|
|
|
|
"dd-MM-yyyy",
|
|
|
|
"dd_MM_yyyy"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2019-11-09 14:26:56 -05:00
|
|
|
// This isn't a Kodi naming rule, but the expression below causes false positives,
|
|
|
|
// so we make sure this one gets tested first.
|
2019-11-08 13:59:48 -05:00
|
|
|
// "Foo Bar 889"
|
2022-05-15 20:23:59 -04:00
|
|
|
new EpisodeExpression(@".*[\\\/](?![Ee]pisode)(?<seriesname>[\w\s]+?)\s(?<epnumber>[0-9]{1,4})(-(?<endingepnumber>[0-9]{2,4}))*[^\\\/x]*$")
|
2019-11-08 13:59:48 -05:00
|
|
|
{
|
|
|
|
IsNamed = true
|
|
|
|
},
|
|
|
|
|
2021-07-12 17:51:36 -04:00
|
|
|
new EpisodeExpression(@"[\\\/\._ \[\(-]([0-9]+)x([0-9]+(?:(?:[a-i]|\.[1-9])(?![0-9]))?)([^\\\/]*)$")
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
|
|
|
SupportsAbsoluteEpisodeNumbers = true
|
|
|
|
},
|
2020-11-06 09:52:01 -05:00
|
|
|
|
adjust episode path expression to allow digits in series names
The previous expression was too greedy to consume digits, because the hyphen was optional. This lead to incorrect episode numbers for certain series with digits in their names, in those cases each episode was recognized as the same episode number (the digit from the series name).
The rule, which matches most standard anime filenames, also had a lower priority than one of the Kodi rules, leading to incorrect recognition for absolute numbered episodes with triple digits and higher (first digit was used as season number, rest of digits as episode number). This also resolves one of the TODO test cases.
Additional test cases were added to ensure that both hyphens in different parts of the filename, as well as names without hyphens, still work correctly. All previous test cases still pass.
Unfortunately another TODO (EpisodeNumberTests.cs@L76, Uchuu Senkan Yamato 2199) with the same issue (digits in the series name) could not be trivially fixed in the same change, due to the significantly different formatting. Attempts to resolve this case did not work out for now.
2021-01-17 14:24:23 -05:00
|
|
|
// Not a Kodi rule as well, but below rule also causes false positives for triple-digit episode names
|
|
|
|
// [bar] Foo - 1 [baz] special case of below expression to prevent false positives with digits in the series name
|
2021-07-19 18:25:30 -04:00
|
|
|
new EpisodeExpression(@".*[\\\/]?.*?(\[.*?\])+.*?(?<seriesname>[-\w\s]+?)[\s_]*-[\s_]*(?<epnumber>[0-9]+).*$")
|
adjust episode path expression to allow digits in series names
The previous expression was too greedy to consume digits, because the hyphen was optional. This lead to incorrect episode numbers for certain series with digits in their names, in those cases each episode was recognized as the same episode number (the digit from the series name).
The rule, which matches most standard anime filenames, also had a lower priority than one of the Kodi rules, leading to incorrect recognition for absolute numbered episodes with triple digits and higher (first digit was used as season number, rest of digits as episode number). This also resolves one of the TODO test cases.
Additional test cases were added to ensure that both hyphens in different parts of the filename, as well as names without hyphens, still work correctly. All previous test cases still pass.
Unfortunately another TODO (EpisodeNumberTests.cs@L76, Uchuu Senkan Yamato 2199) with the same issue (digits in the series name) could not be trivially fixed in the same change, due to the significantly different formatting. Attempts to resolve this case did not work out for now.
2021-01-17 14:24:23 -05:00
|
|
|
{
|
|
|
|
IsNamed = true
|
|
|
|
},
|
|
|
|
|
2020-11-06 09:52:01 -05:00
|
|
|
// /server/anything_102.mp4
|
|
|
|
// /server/james.corden.2017.04.20.anne.hathaway.720p.hdtv.x264-crooks.mkv
|
|
|
|
// /server/anything_1996.11.14.mp4
|
2020-11-07 05:02:12 -05:00
|
|
|
new EpisodeExpression(@"[\\/._ -](?<seriesname>(?![0-9]+[0-9][0-9])([^\\\/_])*)[\\\/._ -](?<seasonnumber>[0-9]+)(?<epnumber>[0-9][0-9](?:(?:[a-i]|\.[1-9])(?![0-9]))?)([._ -][^\\\/]*)$")
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
|
|
|
IsOptimistic = true,
|
|
|
|
IsNamed = true,
|
|
|
|
SupportsAbsoluteEpisodeNumbers = false
|
|
|
|
},
|
|
|
|
new EpisodeExpression("[\\/._ -]p(?:ar)?t[_. -]()([ivx]+|[0-9]+)([._ -][^\\/]*)$")
|
|
|
|
{
|
|
|
|
SupportsAbsoluteEpisodeNumbers = true
|
|
|
|
},
|
|
|
|
|
|
|
|
// *** End Kodi Standard Naming
|
|
|
|
|
2021-07-12 17:51:36 -04:00
|
|
|
// "Episode 16", "Episode 16 - Title"
|
|
|
|
new EpisodeExpression(@"[Ee]pisode (?<epnumber>[0-9]+)(-(?<endingepnumber>[0-9]+))?[^\\\/]*$")
|
|
|
|
{
|
|
|
|
IsNamed = true
|
|
|
|
},
|
|
|
|
|
2020-07-20 08:14:15 -04:00
|
|
|
new EpisodeExpression(@".*(\\|\/)[sS]?(?<seasonnumber>[0-9]+)[xX](?<epnumber>[0-9]+)[^\\\/]*$")
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
|
|
|
IsNamed = true
|
|
|
|
},
|
|
|
|
|
2020-07-20 08:14:15 -04:00
|
|
|
new EpisodeExpression(@".*(\\|\/)[sS](?<seasonnumber>[0-9]+)[x,X]?[eE](?<epnumber>[0-9]+)[^\\\/]*$")
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
|
|
|
IsNamed = true
|
|
|
|
},
|
|
|
|
|
2020-07-20 08:14:15 -04:00
|
|
|
new EpisodeExpression(@".*(\\|\/)(?<seriesname>((?![sS]?[0-9]{1,4}[xX][0-9]{1,3})[^\\\/])*)?([sS]?(?<seasonnumber>[0-9]{1,4})[xX](?<epnumber>[0-9]+))[^\\\/]*$")
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
|
|
|
IsNamed = true
|
|
|
|
},
|
|
|
|
|
2020-07-20 08:14:15 -04:00
|
|
|
new EpisodeExpression(@".*(\\|\/)(?<seriesname>[^\\\/]*)[sS](?<seasonnumber>[0-9]{1,4})[xX\.]?[eE](?<epnumber>[0-9]+)[^\\\/]*$")
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
|
|
|
IsNamed = true
|
|
|
|
},
|
|
|
|
|
|
|
|
// "01.avi"
|
2020-07-20 08:14:15 -04:00
|
|
|
new EpisodeExpression(@".*[\\\/](?<epnumber>[0-9]+)(-(?<endingepnumber>[0-9]+))*\.\w+$")
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
|
|
|
IsOptimistic = true,
|
|
|
|
IsNamed = true
|
|
|
|
},
|
|
|
|
|
|
|
|
// "1-12 episode title"
|
2019-05-10 14:37:42 -04:00
|
|
|
new EpisodeExpression(@"([0-9]+)-([0-9]+)"),
|
2018-09-12 13:26:21 -04:00
|
|
|
|
|
|
|
// "01 - blah.avi", "01-blah.avi"
|
2020-07-20 08:14:15 -04:00
|
|
|
new EpisodeExpression(@".*(\\|\/)(?<epnumber>[0-9]{1,3})(-(?<endingepnumber>[0-9]{2,3}))*\s?-\s?[^\\\/]*$")
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
|
|
|
IsOptimistic = true,
|
|
|
|
IsNamed = true
|
|
|
|
},
|
|
|
|
|
|
|
|
// "01.blah.avi"
|
2020-07-20 08:14:15 -04:00
|
|
|
new EpisodeExpression(@".*(\\|\/)(?<epnumber>[0-9]{1,3})(-(?<endingepnumber>[0-9]{2,3}))*\.[^\\\/]+$")
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
|
|
|
IsOptimistic = true,
|
|
|
|
IsNamed = true
|
|
|
|
},
|
|
|
|
|
|
|
|
// "blah - 01.avi", "blah 2 - 01.avi", "blah - 01 blah.avi", "blah 2 - 01 blah", "blah - 01 - blah.avi", "blah 2 - 01 - blah"
|
2020-07-20 08:14:15 -04:00
|
|
|
new EpisodeExpression(@".*[\\\/][^\\\/]* - (?<epnumber>[0-9]{1,3})(-(?<endingepnumber>[0-9]{2,3}))*[^\\\/]*$")
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
|
|
|
IsOptimistic = true,
|
|
|
|
IsNamed = true
|
|
|
|
},
|
|
|
|
|
|
|
|
// "01 episode title.avi"
|
2020-07-20 08:14:15 -04:00
|
|
|
new EpisodeExpression(@"[Ss]eason[\._ ](?<seasonnumber>[0-9]+)[\\\/](?<epnumber>[0-9]{1,3})([^\\\/]*)$")
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
|
|
|
IsOptimistic = true,
|
|
|
|
IsNamed = true
|
|
|
|
},
|
2021-08-26 14:01:56 -04:00
|
|
|
|
|
|
|
// Series and season only expression
|
|
|
|
// "the show/season 1", "the show/s01"
|
|
|
|
new EpisodeExpression(@"(.*(\\|\/))*(?<seriesname>.+)\/[Ss](eason)?[\. _\-]*(?<seasonnumber>[0-9]+)")
|
|
|
|
{
|
|
|
|
IsNamed = true
|
|
|
|
},
|
|
|
|
|
|
|
|
// Series and season only expression
|
|
|
|
// "the show S01", "the show season 1"
|
|
|
|
new EpisodeExpression(@"(.*(\\|\/))*(?<seriesname>.+)[\. _\-]+[sS](eason)?[\. _\-]*(?<seasonnumber>[0-9]+)")
|
|
|
|
{
|
|
|
|
IsNamed = true
|
|
|
|
},
|
2018-09-12 13:26:21 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
EpisodeWithoutSeasonExpressions = new[]
|
|
|
|
{
|
|
|
|
@"[/\._ \-]()([0-9]+)(-[0-9]+)?"
|
|
|
|
};
|
|
|
|
|
|
|
|
EpisodeMultiPartExpressions = new[]
|
|
|
|
{
|
|
|
|
@"^[-_ex]+([0-9]+(?:(?:[a-i]|\\.[1-9])(?![0-9]))?)"
|
|
|
|
};
|
|
|
|
|
|
|
|
VideoExtraRules = new[]
|
|
|
|
{
|
2021-12-07 09:18:17 -05:00
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Trailer,
|
|
|
|
ExtraRuleType.DirectoryName,
|
|
|
|
"trailers",
|
|
|
|
MediaType.Video),
|
|
|
|
|
2022-01-15 09:16:11 -05:00
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.ThemeVideo,
|
|
|
|
ExtraRuleType.DirectoryName,
|
|
|
|
"backdrops",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.ThemeSong,
|
|
|
|
ExtraRuleType.DirectoryName,
|
|
|
|
"theme-music",
|
|
|
|
MediaType.Audio),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.BehindTheScenes,
|
|
|
|
ExtraRuleType.DirectoryName,
|
|
|
|
"behind the scenes",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.DeletedScene,
|
|
|
|
ExtraRuleType.DirectoryName,
|
|
|
|
"deleted scenes",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Interview,
|
|
|
|
ExtraRuleType.DirectoryName,
|
|
|
|
"interviews",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Scene,
|
|
|
|
ExtraRuleType.DirectoryName,
|
|
|
|
"scenes",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Sample,
|
|
|
|
ExtraRuleType.DirectoryName,
|
|
|
|
"samples",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
2022-10-27 21:01:04 -04:00
|
|
|
ExtraType.Short,
|
2022-01-15 09:16:11 -05:00
|
|
|
ExtraRuleType.DirectoryName,
|
|
|
|
"shorts",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
2022-10-27 21:01:04 -04:00
|
|
|
ExtraType.Featurette,
|
2022-01-15 09:16:11 -05:00
|
|
|
ExtraRuleType.DirectoryName,
|
|
|
|
"featurettes",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Unknown,
|
|
|
|
ExtraRuleType.DirectoryName,
|
|
|
|
"extras",
|
|
|
|
MediaType.Video),
|
|
|
|
|
2022-10-08 22:40:00 -04:00
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Unknown,
|
|
|
|
ExtraRuleType.DirectoryName,
|
|
|
|
"other",
|
|
|
|
MediaType.Video),
|
|
|
|
|
2022-10-27 21:01:04 -04:00
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Clip,
|
|
|
|
ExtraRuleType.DirectoryName,
|
|
|
|
"clips",
|
|
|
|
MediaType.Video),
|
|
|
|
|
2020-11-01 04:47:31 -05:00
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Trailer,
|
|
|
|
ExtraRuleType.Filename,
|
|
|
|
"trailer",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Trailer,
|
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
"-trailer",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Trailer,
|
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
".trailer",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Trailer,
|
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
"_trailer",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Trailer,
|
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
" trailer",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Sample,
|
|
|
|
ExtraRuleType.Filename,
|
|
|
|
"sample",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Sample,
|
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
"-sample",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Sample,
|
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
".sample",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Sample,
|
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
"_sample",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Sample,
|
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
" sample",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.ThemeSong,
|
|
|
|
ExtraRuleType.Filename,
|
|
|
|
"theme",
|
|
|
|
MediaType.Audio),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Scene,
|
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
"-scene",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Clip,
|
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
"-clip",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Interview,
|
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
"-interview",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.BehindTheScenes,
|
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
"-behindthescenes",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.DeletedScene,
|
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
"-deleted",
|
|
|
|
MediaType.Video),
|
|
|
|
|
2021-10-05 15:47:59 -04:00
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.DeletedScene,
|
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
"-deletedscene",
|
|
|
|
MediaType.Video),
|
|
|
|
|
2020-11-01 04:47:31 -05:00
|
|
|
new ExtraRule(
|
2022-10-27 21:01:04 -04:00
|
|
|
ExtraType.Featurette,
|
2020-11-01 04:47:31 -05:00
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
"-featurette",
|
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
2022-10-27 21:01:04 -04:00
|
|
|
ExtraType.Short,
|
2020-11-01 04:47:31 -05:00
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
"-short",
|
2022-01-15 09:34:34 -05:00
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Unknown,
|
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
"-extra",
|
2022-10-08 22:40:00 -04:00
|
|
|
MediaType.Video),
|
|
|
|
|
|
|
|
new ExtraRule(
|
|
|
|
ExtraType.Unknown,
|
|
|
|
ExtraRuleType.Suffix,
|
|
|
|
"-other",
|
2021-12-20 06:15:20 -05:00
|
|
|
MediaType.Video)
|
2018-09-12 13:26:21 -04:00
|
|
|
};
|
2019-05-10 14:37:42 -04:00
|
|
|
|
2022-01-16 17:00:30 -05:00
|
|
|
AllExtrasTypesFolderNames = VideoExtraRules
|
|
|
|
.Where(i => i.RuleType == ExtraRuleType.DirectoryName)
|
|
|
|
.ToDictionary(i => i.Token, i => i.ExtraType, StringComparer.OrdinalIgnoreCase);
|
|
|
|
|
2018-09-12 13:26:21 -04:00
|
|
|
Format3DRules = new[]
|
|
|
|
{
|
|
|
|
// Kodi rules:
|
2020-11-01 04:47:31 -05:00
|
|
|
new Format3DRule(
|
2020-11-01 05:19:22 -05:00
|
|
|
precedingToken: "3d",
|
2020-11-01 04:47:31 -05:00
|
|
|
token: "hsbs"),
|
|
|
|
|
|
|
|
new Format3DRule(
|
2020-11-01 05:19:22 -05:00
|
|
|
precedingToken: "3d",
|
2020-11-01 04:47:31 -05:00
|
|
|
token: "sbs"),
|
|
|
|
|
|
|
|
new Format3DRule(
|
2020-11-01 05:19:22 -05:00
|
|
|
precedingToken: "3d",
|
2020-11-01 04:47:31 -05:00
|
|
|
token: "htab"),
|
|
|
|
|
|
|
|
new Format3DRule(
|
2020-11-01 05:19:22 -05:00
|
|
|
precedingToken: "3d",
|
2020-11-01 04:47:31 -05:00
|
|
|
token: "tab"),
|
|
|
|
|
|
|
|
// Media Browser rules:
|
|
|
|
new Format3DRule("fsbs"),
|
|
|
|
new Format3DRule("hsbs"),
|
|
|
|
new Format3DRule("sbs"),
|
|
|
|
new Format3DRule("ftab"),
|
|
|
|
new Format3DRule("htab"),
|
|
|
|
new Format3DRule("tab"),
|
|
|
|
new Format3DRule("sbs3d"),
|
|
|
|
new Format3DRule("mvc")
|
2018-09-12 13:26:21 -04:00
|
|
|
};
|
2020-11-01 04:47:31 -05:00
|
|
|
|
2018-09-12 13:26:21 -04:00
|
|
|
AudioBookPartsExpressions = new[]
|
|
|
|
{
|
|
|
|
// Detect specified chapters, like CH 01
|
2020-07-20 08:14:15 -04:00
|
|
|
@"ch(?:apter)?[\s_-]?(?<chapter>[0-9]+)",
|
2018-09-12 13:26:21 -04:00
|
|
|
// Detect specified parts, like Part 02
|
2020-07-20 08:14:15 -04:00
|
|
|
@"p(?:ar)?t[\s_-]?(?<part>[0-9]+)",
|
2018-09-12 13:26:21 -04:00
|
|
|
// Chapter is often beginning of filename
|
2020-07-20 08:14:15 -04:00
|
|
|
"^(?<chapter>[0-9]+)",
|
2018-09-12 13:26:21 -04:00
|
|
|
// Part if often ending of filename
|
2020-11-03 10:24:04 -05:00
|
|
|
@"(?<!ch(?:apter) )(?<part>[0-9]+)$",
|
2018-09-12 13:26:21 -04:00
|
|
|
// Sometimes named as 0001_005 (chapter_part)
|
2020-07-20 08:14:15 -04:00
|
|
|
"(?<chapter>[0-9]+)_(?<part>[0-9]+)",
|
2018-09-12 13:26:21 -04:00
|
|
|
// Some audiobooks are ripped from cd's, and will be named by disk number.
|
2020-07-20 08:14:15 -04:00
|
|
|
@"dis(?:c|k)[\s_-]?(?<chapter>[0-9]+)"
|
2018-09-12 13:26:21 -04:00
|
|
|
};
|
|
|
|
|
2020-11-02 14:03:12 -05:00
|
|
|
AudioBookNamesExpressions = new[]
|
|
|
|
{
|
|
|
|
// Detect year usually in brackets after name Batman (2020)
|
2021-01-31 21:46:30 -05:00
|
|
|
@"^(?<name>.+?)\s*\(\s*(?<year>[0-9]{4})\s*\)\s*$",
|
2020-11-03 10:24:04 -05:00
|
|
|
@"^\s*(?<name>[^ ].*?)\s*$"
|
2020-11-02 14:03:12 -05:00
|
|
|
};
|
|
|
|
|
2020-11-01 05:19:22 -05:00
|
|
|
MultipleEpisodeExpressions = new[]
|
2018-09-12 13:26:21 -04:00
|
|
|
{
|
2020-07-20 08:14:15 -04:00
|
|
|
@".*(\\|\/)[sS]?(?<seasonnumber>[0-9]{1,4})[xX](?<epnumber>[0-9]{1,3})((-| - )[0-9]{1,4}[eExX](?<endingepnumber>[0-9]{1,3}))+[^\\\/]*$",
|
|
|
|
@".*(\\|\/)[sS]?(?<seasonnumber>[0-9]{1,4})[xX](?<epnumber>[0-9]{1,3})((-| - )[0-9]{1,4}[xX][eE](?<endingepnumber>[0-9]{1,3}))+[^\\\/]*$",
|
|
|
|
@".*(\\|\/)[sS]?(?<seasonnumber>[0-9]{1,4})[xX](?<epnumber>[0-9]{1,3})((-| - )?[xXeE](?<endingepnumber>[0-9]{1,3}))+[^\\\/]*$",
|
|
|
|
@".*(\\|\/)[sS]?(?<seasonnumber>[0-9]{1,4})[xX](?<epnumber>[0-9]{1,3})(-[xE]?[eE]?(?<endingepnumber>[0-9]{1,3}))+[^\\\/]*$",
|
|
|
|
@".*(\\|\/)(?<seriesname>((?![sS]?[0-9]{1,4}[xX][0-9]{1,3})[^\\\/])*)?([sS]?(?<seasonnumber>[0-9]{1,4})[xX](?<epnumber>[0-9]{1,3}))((-| - )[0-9]{1,4}[xXeE](?<endingepnumber>[0-9]{1,3}))+[^\\\/]*$",
|
|
|
|
@".*(\\|\/)(?<seriesname>((?![sS]?[0-9]{1,4}[xX][0-9]{1,3})[^\\\/])*)?([sS]?(?<seasonnumber>[0-9]{1,4})[xX](?<epnumber>[0-9]{1,3}))((-| - )[0-9]{1,4}[xX][eE](?<endingepnumber>[0-9]{1,3}))+[^\\\/]*$",
|
|
|
|
@".*(\\|\/)(?<seriesname>((?![sS]?[0-9]{1,4}[xX][0-9]{1,3})[^\\\/])*)?([sS]?(?<seasonnumber>[0-9]{1,4})[xX](?<epnumber>[0-9]{1,3}))((-| - )?[xXeE](?<endingepnumber>[0-9]{1,3}))+[^\\\/]*$",
|
|
|
|
@".*(\\|\/)(?<seriesname>((?![sS]?[0-9]{1,4}[xX][0-9]{1,3})[^\\\/])*)?([sS]?(?<seasonnumber>[0-9]{1,4})[xX](?<epnumber>[0-9]{1,3}))(-[xX]?[eE]?(?<endingepnumber>[0-9]{1,3}))+[^\\\/]*$",
|
|
|
|
@".*(\\|\/)(?<seriesname>[^\\\/]*)[sS](?<seasonnumber>[0-9]{1,4})[xX\.]?[eE](?<epnumber>[0-9]{1,3})((-| - )?[xXeE](?<endingepnumber>[0-9]{1,3}))+[^\\\/]*$",
|
|
|
|
@".*(\\|\/)(?<seriesname>[^\\\/]*)[sS](?<seasonnumber>[0-9]{1,4})[xX\.]?[eE](?<epnumber>[0-9]{1,3})(-[xX]?[eE]?(?<endingepnumber>[0-9]{1,3}))+[^\\\/]*$"
|
2018-09-12 13:26:21 -04:00
|
|
|
}.Select(i => new EpisodeExpression(i)
|
2019-10-11 06:24:55 -04:00
|
|
|
{
|
|
|
|
IsNamed = true
|
|
|
|
}).ToArray();
|
2018-09-12 13:26:21 -04:00
|
|
|
|
|
|
|
Compile();
|
|
|
|
}
|
|
|
|
|
2021-12-20 06:15:20 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the folder name to extra types mapping.
|
|
|
|
/// </summary>
|
|
|
|
public Dictionary<string, ExtraType> AllExtrasTypesFolderNames { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of audio file extensions.
|
|
|
|
/// </summary>
|
2020-01-22 16:18:56 -05:00
|
|
|
public string[] AudioFileExtensions { get; set; }
|
|
|
|
|
2022-01-27 08:21:53 -05:00
|
|
|
/// <summary>
|
2022-02-07 12:36:07 -05:00
|
|
|
/// Gets or sets list of external media flag delimiters.
|
2022-01-27 08:21:53 -05:00
|
|
|
/// </summary>
|
2022-03-04 04:52:15 -05:00
|
|
|
public char[] MediaFlagDelimiters { get; set; }
|
2022-01-27 08:21:53 -05:00
|
|
|
|
|
|
|
/// <summary>
|
2022-02-07 12:36:07 -05:00
|
|
|
/// Gets or sets list of external media forced flags.
|
2022-01-27 08:21:53 -05:00
|
|
|
/// </summary>
|
2022-02-07 12:36:07 -05:00
|
|
|
public string[] MediaForcedFlags { get; set; }
|
2022-01-27 08:21:53 -05:00
|
|
|
|
|
|
|
/// <summary>
|
2022-02-07 12:36:07 -05:00
|
|
|
/// Gets or sets list of external media default flags.
|
2022-01-27 08:21:53 -05:00
|
|
|
/// </summary>
|
2022-02-07 12:36:07 -05:00
|
|
|
public string[] MediaDefaultFlags { get; set; }
|
2022-01-27 08:21:53 -05:00
|
|
|
|
2022-10-07 06:38:05 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of external media hearing impaired flags.
|
|
|
|
/// </summary>
|
|
|
|
public string[] MediaHearingImpairedFlags { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of album stacking prefixes.
|
|
|
|
/// </summary>
|
2020-01-22 16:18:56 -05:00
|
|
|
public string[] AlbumStackingPrefixes { get; set; }
|
|
|
|
|
2022-03-28 17:11:21 -04:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of artist subfolders.
|
|
|
|
/// </summary>
|
|
|
|
public string[] ArtistSubfolders { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of subtitle file extensions.
|
|
|
|
/// </summary>
|
2020-01-22 16:18:56 -05:00
|
|
|
public string[] SubtitleFileExtensions { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of episode regular expressions.
|
|
|
|
/// </summary>
|
2020-01-22 16:18:56 -05:00
|
|
|
public EpisodeExpression[] EpisodeExpressions { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of raw episode without season regular expressions strings.
|
|
|
|
/// </summary>
|
2020-01-22 16:18:56 -05:00
|
|
|
public string[] EpisodeWithoutSeasonExpressions { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of raw multi-part episodes regular expressions strings.
|
|
|
|
/// </summary>
|
2020-01-22 16:18:56 -05:00
|
|
|
public string[] EpisodeMultiPartExpressions { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of video file extensions.
|
|
|
|
/// </summary>
|
2020-01-22 16:18:56 -05:00
|
|
|
public string[] VideoFileExtensions { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of video stub file extensions.
|
|
|
|
/// </summary>
|
2020-01-22 16:18:56 -05:00
|
|
|
public string[] StubFileExtensions { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of raw audiobook parts regular expressions strings.
|
|
|
|
/// </summary>
|
2020-01-22 16:18:56 -05:00
|
|
|
public string[] AudioBookPartsExpressions { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of raw audiobook names regular expressions strings.
|
|
|
|
/// </summary>
|
2020-11-02 14:03:12 -05:00
|
|
|
public string[] AudioBookNamesExpressions { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of stub type rules.
|
|
|
|
/// </summary>
|
2020-01-22 16:18:56 -05:00
|
|
|
public StubTypeRule[] StubTypes { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of video flag delimiters.
|
|
|
|
/// </summary>
|
2020-01-22 16:18:56 -05:00
|
|
|
public char[] VideoFlagDelimiters { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of 3D Format rules.
|
|
|
|
/// </summary>
|
2020-01-22 16:18:56 -05:00
|
|
|
public Format3DRule[] Format3DRules { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
2021-12-10 08:23:31 -05:00
|
|
|
/// Gets the file stacking rules.
|
2020-11-10 13:23:10 -05:00
|
|
|
/// </summary>
|
2021-12-10 08:23:31 -05:00
|
|
|
public FileStackRule[] VideoFileStackingRules { get; }
|
2020-01-22 16:18:56 -05:00
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of raw clean DateTimes regular expressions strings.
|
|
|
|
/// </summary>
|
2020-01-22 16:18:56 -05:00
|
|
|
public string[] CleanDateTimes { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of raw clean strings regular expressions strings.
|
|
|
|
/// </summary>
|
2020-01-22 16:18:56 -05:00
|
|
|
public string[] CleanStrings { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of multi-episode regular expressions.
|
|
|
|
/// </summary>
|
2020-01-22 16:18:56 -05:00
|
|
|
public EpisodeExpression[] MultipleEpisodeExpressions { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets list of extra rules for videos.
|
|
|
|
/// </summary>
|
2020-01-22 16:18:56 -05:00
|
|
|
public ExtraRule[] VideoExtraRules { get; set; }
|
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets list of clean datetime regular expressions.
|
|
|
|
/// </summary>
|
2020-11-01 04:47:31 -05:00
|
|
|
public Regex[] CleanDateTimeRegexes { get; private set; } = Array.Empty<Regex>();
|
2020-01-22 16:18:56 -05:00
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets list of clean string regular expressions.
|
|
|
|
/// </summary>
|
2020-11-01 04:47:31 -05:00
|
|
|
public Regex[] CleanStringRegexes { get; private set; } = Array.Empty<Regex>();
|
2018-09-12 13:26:21 -04:00
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets list of episode without season regular expressions.
|
|
|
|
/// </summary>
|
2020-11-01 04:47:31 -05:00
|
|
|
public Regex[] EpisodeWithoutSeasonRegexes { get; private set; } = Array.Empty<Regex>();
|
2020-01-22 16:18:56 -05:00
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Gets list of multi-part episode regular expressions.
|
|
|
|
/// </summary>
|
2020-11-01 04:47:31 -05:00
|
|
|
public Regex[] EpisodeMultiPartRegexes { get; private set; } = Array.Empty<Regex>();
|
2018-09-12 13:26:21 -04:00
|
|
|
|
2020-11-10 13:23:10 -05:00
|
|
|
/// <summary>
|
|
|
|
/// Compiles raw regex strings into regexes.
|
|
|
|
/// </summary>
|
2018-09-12 13:26:21 -04:00
|
|
|
public void Compile()
|
|
|
|
{
|
|
|
|
CleanDateTimeRegexes = CleanDateTimes.Select(Compile).ToArray();
|
|
|
|
CleanStringRegexes = CleanStrings.Select(Compile).ToArray();
|
|
|
|
EpisodeWithoutSeasonRegexes = EpisodeWithoutSeasonExpressions.Select(Compile).ToArray();
|
|
|
|
EpisodeMultiPartRegexes = EpisodeMultiPartExpressions.Select(Compile).ToArray();
|
|
|
|
}
|
|
|
|
|
|
|
|
private Regex Compile(string exp)
|
|
|
|
{
|
|
|
|
return new Regex(exp, RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|