/// <summary> /// Creates a node based on a given path to a file. /// </summary> /// <param name="path">Path to the file the node is for.</param> public Node(string path) { _file = new FileData(path); AVM.Parsers.FolderParser parser = new AVM.Parsers.FolderParser(); // -1 signifies that the parser should only run once Node tempNode = parser.parseFile(-1, new FileInfo(_file.Uri.OriginalString)); if (tempNode != null) { _name = tempNode._name; if (tempNode.IsEpisode) { _episodeInfo.EpisodeName = tempNode.Episode.EpisodeName; _episodeInfo.EpisodeNumber = tempNode.Episode.EpisodeNumber; } } }
/// <summary> /// Runs the FolderParser based on the selected folder and refreshes /// the group list. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void folderAddButton_Click(object sender, EventArgs e) { if (folderFileTextBox.Text != "") { AVM.Parsers.FolderParser parser = new AVM.Parsers.FolderParser(folderFileTextBox.Text, db); parser.Pattern = folderPatternTextBox.Text; if (groupComboBox.SelectedIndex > -1) { parser.parse(((AVM.Types.Group)groupComboBox.SelectedItem).Id); } else { parser.parse(0); } main.refreshGroups(); this.Close(); } }