/// <summary> /// Scans the specified subdirectory for settings. /// </summary> /// <param name="subdirectory"> /// The subdirectory. /// </param> public void ScanEpisodes(string subdirectory) { var task = new BackgroundTask( () => { this.fileSearch.Search(subdirectory); this.OnPropertyChanged("Results"); }); task.Start(); this.sortView.StartTaskProgress(task, "Scanning episodes"); }
/// <summary> /// Copies the episodes at the specified indices. /// </summary> public void CopyEpisodes() { var task = new BackgroundTask(() => this.fileSearch.Copy()); task.Start(); this.sortView.StartTaskProgress(task, "Copying Episodes"); }
/// <summary> /// Moves the episodes at the specified indices. /// </summary> public void MoveEpisodes() { var task = new BackgroundTask(() => this.fileSearch.Move()); task.Start(); this.sortView.StartTaskProgress(task, "Moving Episodes"); this.ScanEpisodes(this.lastSubdirectoryScanned); }
/// <summary> /// Updates the selected show. /// </summary> public void UpdateSelectedShow() { var task = new BackgroundTask( () => { if (this.SelectedShow == null) { return; } this.SelectedShow.Update(); this.OnPropertyChanged("SelectedShow"); }); task.Start(); this.tvView.StartTaskProgress(task, "Updating " + this.SelectedShow.Name); }
/// <summary> /// Updates all shows. /// </summary> public void UpdateAllShows() { var task = new BackgroundTask( () => { // Only update the unlocked shows. List<TvShow> unlockedShows = this.Shows.Where(x => !x.Locked).ToList(); TvShow.UpdateShows(unlockedShows); this.OnPropertyChanged("SelectedShow"); }); task.Start(); this.tvView.StartTaskProgress(task, "Updating All Shows"); }
/// <summary> /// Searches for new shows. /// </summary> public void SearchShows() { var task = new BackgroundTask( () => { this.SearchResults = TvShow.SearchNewShows(); this.OnSearchShowsComplete(); }); task.Start(); this.tvView.StartTaskProgress(task, "Searching shows"); }
/// <summary> /// The create nfo files. /// </summary> public void CreateNfoFiles() { var task = new BackgroundTask(TvShow.CreateNfoFiles); task.Start(); this.tvView.StartTaskProgress(task, "Creating .nfo files."); }
/// <summary> /// Refreshes the file counts of the episodes. /// </summary> public void RefreshFileCounts() { var task = new BackgroundTask(FileSearch.RefreshFileCounts); task.Start(); this.View.StartTaskProgress(task, "Refreshing file counts"); }