Exemplo n.º 1
0
        private static string RemoveSeriesAndNumbers(this string S)
        {
            foreach (var RX in Episode.Tests)
            {
                if (RX.IsMatch(S))
                {
                    return(S.Substring(S.IndexOf(RX.Match(S).Groups[0].Value) + RX.Match(S).Groups[0].Value.Length).StartWithLetter());
                }
            }

            return(S);
        }
Exemplo n.º 2
0
        public Episode(string path)
        {
            FilePath = path;
            var filename = Path.GetFileNameWithoutExtension(path);

            foreach (var RX in Tests)
            {
                if (RX.IsMatch(filename))
                {
                    SeasonNumber  = RX.Match(filename).Groups[1].Value.SmartParse();
                    EpisodeNumber = RX.Match(filename).Groups[2].Value.SmartParse();
                    EpisodeName   = ExtractName();
                    return;
                }
            }
            throw new Exception("Given File is not Valid");
        }
Exemplo n.º 3
0
        public Subtitle(string path)
        {
            FilePath = path;
            Name     = NameExtractor.GetSubtitleName(Path.GetFileNameWithoutExtension(FilePath));
            if (MovieMode)
            {
                return;
            }
            var filename = Path.GetFileNameWithoutExtension(path);

            foreach (var RX in TV_Renamer_2.Episode.Tests)
            {
                if (RX.IsMatch(filename))
                {
                    SeasonNumber  = int.Parse(RX.Match(filename).Groups[1].Value);
                    EpisodeNumber = int.Parse(RX.Match(filename).Groups[2].Value);
                    return;
                }
            }
            throw new Exception("Given File is not Valid");
        }