private void ParseAnnotated(DirectoryInfo dir) { if (ScoreRegex.IsMatch(dir.Name)) { Match mYear; if (!YearRegex.TryGetMatch(dir.Name, out mYear)) { Error($"No year match found for {dir.Name}"); return; } Year = mYear.Groups[1].Value; // Year = MatchInt(YearRegex, true); Match mTime; if (!TimeRegex.TryGetMatch(dir.Name, out mTime)) { Error($"No year match found for {dir.Name}"); return; } RunTime = mTime.Value; // RunTime = TimeRegex.Match(Name).Value; ParseRatings(); Regex spaceReg = new Regex(@"\s+"); string tmpTitle = Name.ReplaceWithString(Year).ReplaceWithString(RunTime); tmpTitle = tmpTitle.ReplaceWithString(OtherRegex.Match(tmpTitle).Value); Title = spaceReg.ReplaceWithString(tmpTitle, " "); return; } ParseStd(dir); GetMetaWithoutScore(dir); }
public Movie(DirectoryInfo dir) { Dir = dir; Log($"Getting movie for {dir.Name}"); Name = ScoreRegex.ReplaceWithString(dir.Name); Annotated = AnnotationRegex.IsMatch(dir.Name); if (ParseUnannotated(dir)) { return; } ParseAnnotated(dir); }