private void LoadMedia(string[] ps) { if (1 == ps.Length) { txtTitle.Text = MediaHelper.GetMediaName(ps[0]); GuessSource(txtTitle.Text); } if (!App.Settings.ProfileActive.WritePublish && ps.Length > 1) { if (MessageBox.Show(Resources.MainWindow_LoadMedia_, Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { App.Settings.ProfileActive.WritePublish = true; } } List<TorrentCreateInfo> tps = new List<TorrentCreateInfo>(); foreach (string p in ps) { if (File.Exists(p) || Directory.Exists(p)) { DebugHelper.WriteLine(string.Format("Queued {0} to create a torrent", p)); lbFiles.Items.Add(p); TorrentCreateInfo tp = new TorrentCreateInfo(App.Settings.ProfileActive, p); tps.Add(tp); UpdateGuiControls(); } } if (App.Settings.AnalyzeAuto) { WorkerTask wt = new WorkerTask(bwApp, TaskType.ANALYZE_MEDIA); wt.FileOrDirPaths = new List<string>(ps); AnalyzeMedia(wt); } }
private void LoadMedia(string[] ps) { if (1 == ps.Length) { txtTitle.Text = MediaHelper.GetMediaName(ps[0]); } if (!Program.Settings.WritePublish && ps.Length > 1) { if (MessageBox.Show("Writing Publish info to File is recommended when analysing multiple files or folders. \n\nWould you like to turn this feature on?", Application.ProductName, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Program.Settings.WritePublish = true; } } List<TorrentCreateInfo> tps = new List<TorrentCreateInfo>(); foreach (string p in ps) { if (File.Exists(p) || Directory.Exists(p)) { // txtMediaLocation.Text = p; FileSystem.AppendDebug(string.Format("Queued {0} to create a torrent", p)); lbFiles.Items.Add(p); TorrentCreateInfo tp = new TorrentCreateInfo(GetTracker(), p); tps.Add(tp); UpdateGuiControls(); } } if (Program.Settings.AnalyzeAuto) { WorkerTask wt = new WorkerTask(bwApp, TaskType.ANALYZE_MEDIA); wt.FileOrDirPaths = new List<string>(ps); AnalyzeMedia(wt); } }