From 4ee3f85bc4d77b8483a5d1adcfbdefa21dc92c27 Mon Sep 17 00:00:00 2001 From: Chlorel Date: Fri, 7 Sep 2018 01:46:23 +0200 Subject: [PATCH 01/12] ShowCollections Allow to have multiple shows collections ( one for each disk ? ) --- TVRename/App/ApplicationBase.cs | 39 +- .../Collection/AddEditCollection.Designer.cs | 266 +++++++++ .../Forms/Collection/AddEditCollection.cs | 228 ++++++++ .../Forms/Collection/AddEditCollection.resx | 213 ++++++++ .../Forms/Preferences/Preferences.Designer.cs | 72 ++- TVRename/Forms/Preferences/Preferences.cs | 4 + TVRename/Forms/UI.Designer.cs | 487 +++++++++-------- TVRename/Forms/UI.cs | 132 ++++- TVRename/Forms/UI.resx | 20 +- TVRename/Forms/Utilities/RecoverXML.resx | 6 +- TVRename/Properties/AssemblyInfo.cs | 2 +- TVRename/Resources/openFile.png | Bin 0 -> 495 bytes TVRename/Settings/Settings.cs | 24 +- TVRename/TVRename.csproj | 10 + TVRename/TVRename.csproj.user | 7 + TVRename/TVRename/PathManager.cs | 61 ++- TVRename/TVRename/ShowCollection.cs | 72 +++ TVRename/TVRename/TVDoc.cs | 512 +++++++++++++++--- TVRename/TheTVDB/Episode.cs | 4 +- TVRename/TheTVDB/SeriesInfo.cs | 2 +- TVRename/TheTVDB/TheTVDB.cs | 38 +- 21 files changed, 1821 insertions(+), 378 deletions(-) create mode 100644 TVRename/Forms/Collection/AddEditCollection.Designer.cs create mode 100644 TVRename/Forms/Collection/AddEditCollection.cs create mode 100644 TVRename/Forms/Collection/AddEditCollection.resx create mode 100644 TVRename/Resources/openFile.png create mode 100644 TVRename/TVRename.csproj.user create mode 100644 TVRename/TVRename/ShowCollection.cs diff --git a/TVRename/App/ApplicationBase.cs b/TVRename/App/ApplicationBase.cs index 304b1c625..85e9a1e98 100644 --- a/TVRename/App/ApplicationBase.cs +++ b/TVRename/App/ApplicationBase.cs @@ -54,6 +54,8 @@ protected override void OnCreateMainForm() recoverText = "Recover manually requested."; } + PathManager.ShowCollection = ""; + // Check arguments for custom settings path if (!string.IsNullOrEmpty(clargs.UserFilePath)) { @@ -71,12 +73,26 @@ protected override void OnCreateMainForm() } } - FileInfo tvdbFile = PathManager.TVDBFile; - FileInfo settingsFile = PathManager.TVDocSettingsFile; TVDoc doc; do // Loop until files correctly load { + // Try loading settings file + doc = new TVDoc(clargs); + + FileInfo tvdbFile = PathManager.TVDBFile; + FileInfo showsFile = PathManager.TVDocShowsFile; + + if (recover) doc.SetDirty(); + recover = !doc.LoadOk; + + // Continue if correctly loaded + if (!recover) continue; + + // Set recover message + recoverText = string.Empty; + if (!doc.LoadOk && !string.IsNullOrEmpty(doc.LoadErr)) recoverText = doc.LoadErr; + if (!TheTVDB.Instance.LoadOk && !string.IsNullOrEmpty(TheTVDB.Instance.LoadErr)) recoverText += $"{Environment.NewLine}{TheTVDB.Instance.LoadErr}"; if (recover) // Recovery required, prompt user { RecoverXML recoveryForm = new RecoverXML(recoverText); @@ -84,7 +100,7 @@ protected override void OnCreateMainForm() if (recoveryForm.ShowDialog() == DialogResult.OK) { tvdbFile = recoveryForm.DbFile; - settingsFile = recoveryForm.SettingsFile; + showsFile = recoveryForm.SettingsFile; } else { @@ -92,23 +108,6 @@ protected override void OnCreateMainForm() return; } } - - // Try loading TheTVDB cache file - TheTVDB.Instance.Setup(tvdbFile, PathManager.TVDBFile, clargs); - - // Try loading settings file - doc = new TVDoc(settingsFile, clargs); - - if (recover) doc.SetDirty(); - recover = !doc.LoadOk; - - // Continue if correctly loaded - if (!recover) continue; - - // Set recover message - recoverText = string.Empty; - if (!doc.LoadOk && !string.IsNullOrEmpty(doc.LoadErr)) recoverText = doc.LoadErr; - if (!TheTVDB.Instance.LoadOk && !string.IsNullOrEmpty(TheTVDB.Instance.LoadErr)) recoverText += $"{Environment.NewLine}{TheTVDB.Instance.LoadErr}"; } while (recover); ConvertSeriesTimeZones(doc, TheTVDB.Instance); diff --git a/TVRename/Forms/Collection/AddEditCollection.Designer.cs b/TVRename/Forms/Collection/AddEditCollection.Designer.cs new file mode 100644 index 000000000..4c2f1c0a2 --- /dev/null +++ b/TVRename/Forms/Collection/AddEditCollection.Designer.cs @@ -0,0 +1,266 @@ +namespace TVRename +{ + partial class AddEditCollection + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddEditCollection)); + this.TvColl = new System.Windows.Forms.TreeView(); + this.TxtCollPath = new System.Windows.Forms.TextBox(); + this.TxtCollName = new System.Windows.Forms.TextBox(); + this.TxtCollDesc = new System.Windows.Forms.TextBox(); + this.LblFolder = new System.Windows.Forms.Label(); + this.LblCollName = new System.Windows.Forms.Label(); + this.LblCollDesc = new System.Windows.Forms.Label(); + this.PnlCollAddUpdate = new System.Windows.Forms.Panel(); + this.BtCancel = new System.Windows.Forms.Button(); + this.BtSave = new System.Windows.Forms.Button(); + this.BtOk = new System.Windows.Forms.Button(); + this.BtUp = new System.Windows.Forms.Button(); + this.ImgList = new System.Windows.Forms.ImageList(this.components); + this.BtEdit = new System.Windows.Forms.Button(); + this.BtDel = new System.Windows.Forms.Button(); + this.BtDown = new System.Windows.Forms.Button(); + this.BtAdd = new System.Windows.Forms.Button(); + this.PnlCollAddUpdate.SuspendLayout(); + this.SuspendLayout(); + // + // TvColl + // + this.TvColl.Location = new System.Drawing.Point(12, 12); + this.TvColl.Name = "TvColl"; + this.TvColl.ShowNodeToolTips = true; + this.TvColl.Size = new System.Drawing.Size(152, 142); + this.TvColl.TabIndex = 0; + this.TvColl.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.TvColl_AfterSelect); + // + // TxtCollPath + // + this.TxtCollPath.Location = new System.Drawing.Point(76, 6); + this.TxtCollPath.Name = "TxtCollPath"; + this.TxtCollPath.Size = new System.Drawing.Size(100, 20); + this.TxtCollPath.TabIndex = 7; + // + // TxtCollName + // + this.TxtCollName.Location = new System.Drawing.Point(76, 32); + this.TxtCollName.Name = "TxtCollName"; + this.TxtCollName.Size = new System.Drawing.Size(100, 20); + this.TxtCollName.TabIndex = 9; + // + // TxtCollDesc + // + this.TxtCollDesc.Location = new System.Drawing.Point(76, 58); + this.TxtCollDesc.Multiline = true; + this.TxtCollDesc.Name = "TxtCollDesc"; + this.TxtCollDesc.Size = new System.Drawing.Size(158, 55); + this.TxtCollDesc.TabIndex = 11; + // + // LblFolder + // + this.LblFolder.Location = new System.Drawing.Point(5, 6); + this.LblFolder.Name = "LblFolder"; + this.LblFolder.Size = new System.Drawing.Size(65, 20); + this.LblFolder.TabIndex = 6; + this.LblFolder.Text = "Folder"; + this.LblFolder.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // LblCollName + // + this.LblCollName.Location = new System.Drawing.Point(5, 32); + this.LblCollName.Name = "LblCollName"; + this.LblCollName.Size = new System.Drawing.Size(65, 20); + this.LblCollName.TabIndex = 8; + this.LblCollName.Text = "Name"; + this.LblCollName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // LblCollDesc + // + this.LblCollDesc.Location = new System.Drawing.Point(5, 58); + this.LblCollDesc.Name = "LblCollDesc"; + this.LblCollDesc.Size = new System.Drawing.Size(65, 20); + this.LblCollDesc.TabIndex = 10; + this.LblCollDesc.Text = "Description"; + this.LblCollDesc.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // PnlCollAddUpdate + // + this.PnlCollAddUpdate.Controls.Add(this.BtCancel); + this.PnlCollAddUpdate.Controls.Add(this.BtSave); + this.PnlCollAddUpdate.Controls.Add(this.TxtCollDesc); + this.PnlCollAddUpdate.Controls.Add(this.LblCollDesc); + this.PnlCollAddUpdate.Controls.Add(this.TxtCollPath); + this.PnlCollAddUpdate.Controls.Add(this.LblCollName); + this.PnlCollAddUpdate.Controls.Add(this.TxtCollName); + this.PnlCollAddUpdate.Controls.Add(this.LblFolder); + this.PnlCollAddUpdate.Location = new System.Drawing.Point(200, 12); + this.PnlCollAddUpdate.Name = "PnlCollAddUpdate"; + this.PnlCollAddUpdate.Size = new System.Drawing.Size(241, 145); + this.PnlCollAddUpdate.TabIndex = 5; + // + // BtCancel + // + this.BtCancel.Location = new System.Drawing.Point(76, 119); + this.BtCancel.Name = "BtCancel"; + this.BtCancel.Size = new System.Drawing.Size(75, 23); + this.BtCancel.TabIndex = 12; + this.BtCancel.Text = "Cancel"; + this.BtCancel.UseVisualStyleBackColor = true; + this.BtCancel.Click += new System.EventHandler(this.BtCancel_Click); + // + // BtSave + // + this.BtSave.Location = new System.Drawing.Point(159, 119); + this.BtSave.Name = "BtSave"; + this.BtSave.Size = new System.Drawing.Size(75, 23); + this.BtSave.TabIndex = 13; + this.BtSave.Text = "Save"; + this.BtSave.UseVisualStyleBackColor = true; + this.BtSave.Click += new System.EventHandler(this.BtSave_Click); + // + // BtOk + // + this.BtOk.Location = new System.Drawing.Point(366, 163); + this.BtOk.Name = "BtOk"; + this.BtOk.Size = new System.Drawing.Size(75, 23); + this.BtOk.TabIndex = 14; + this.BtOk.Text = "Ok"; + this.BtOk.UseVisualStyleBackColor = true; + this.BtOk.Click += new System.EventHandler(this.BtOk_Click); + // + // BtUp + // + this.BtUp.ImageIndex = 0; + this.BtUp.ImageList = this.ImgList; + this.BtUp.Location = new System.Drawing.Point(170, 11); + this.BtUp.Name = "BtUp"; + this.BtUp.Size = new System.Drawing.Size(24, 24); + this.BtUp.TabIndex = 1; + this.BtUp.UseVisualStyleBackColor = true; + this.BtUp.Click += new System.EventHandler(this.BtUp_Click); + // + // ImgList + // + this.ImgList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ImgList.ImageStream"))); + this.ImgList.TransparentColor = System.Drawing.Color.Transparent; + this.ImgList.Images.SetKeyName(0, "UpArrow.png"); + this.ImgList.Images.SetKeyName(1, "DownArrow.png"); + this.ImgList.Images.SetKeyName(2, "AddIcon.png"); + this.ImgList.Images.SetKeyName(3, "RemoveIcon.png"); + this.ImgList.Images.SetKeyName(4, "EditIcon.png"); + // + // BtEdit + // + this.BtEdit.ImageIndex = 4; + this.BtEdit.ImageList = this.ImgList; + this.BtEdit.Location = new System.Drawing.Point(170, 101); + this.BtEdit.Name = "BtEdit"; + this.BtEdit.Size = new System.Drawing.Size(24, 24); + this.BtEdit.TabIndex = 4; + this.BtEdit.UseVisualStyleBackColor = true; + this.BtEdit.Click += new System.EventHandler(this.BtEdit_Click); + // + // BtDel + // + this.BtDel.ImageIndex = 3; + this.BtDel.ImageList = this.ImgList; + this.BtDel.Location = new System.Drawing.Point(170, 131); + this.BtDel.Name = "BtDel"; + this.BtDel.Size = new System.Drawing.Size(24, 24); + this.BtDel.TabIndex = 5; + this.BtDel.UseVisualStyleBackColor = true; + this.BtDel.Click += new System.EventHandler(this.BtDel_Click); + // + // BtDown + // + this.BtDown.ImageIndex = 1; + this.BtDown.ImageList = this.ImgList; + this.BtDown.Location = new System.Drawing.Point(170, 41); + this.BtDown.Name = "BtDown"; + this.BtDown.Size = new System.Drawing.Size(24, 24); + this.BtDown.TabIndex = 2; + this.BtDown.UseVisualStyleBackColor = true; + this.BtDown.Click += new System.EventHandler(this.BtDown_Click); + // + // BtAdd + // + this.BtAdd.ImageIndex = 2; + this.BtAdd.ImageList = this.ImgList; + this.BtAdd.Location = new System.Drawing.Point(170, 71); + this.BtAdd.Name = "BtAdd"; + this.BtAdd.Size = new System.Drawing.Size(24, 24); + this.BtAdd.TabIndex = 3; + this.BtAdd.UseVisualStyleBackColor = true; + this.BtAdd.Click += new System.EventHandler(this.BtAdd_Click); + // + // AddEditCollection + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(452, 198); + this.Controls.Add(this.BtAdd); + this.Controls.Add(this.BtDown); + this.Controls.Add(this.BtDel); + this.Controls.Add(this.BtEdit); + this.Controls.Add(this.BtUp); + this.Controls.Add(this.BtOk); + this.Controls.Add(this.PnlCollAddUpdate); + this.Controls.Add(this.TvColl); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "AddEditCollection"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Add / Edit collections"; + this.PnlCollAddUpdate.ResumeLayout(false); + this.PnlCollAddUpdate.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TreeView TvColl; + private System.Windows.Forms.TextBox TxtCollPath; + private System.Windows.Forms.TextBox TxtCollName; + private System.Windows.Forms.TextBox TxtCollDesc; + private System.Windows.Forms.Label LblFolder; + private System.Windows.Forms.Label LblCollName; + private System.Windows.Forms.Label LblCollDesc; + private System.Windows.Forms.Panel PnlCollAddUpdate; + private System.Windows.Forms.Button BtSave; + private System.Windows.Forms.Button BtOk; + private System.Windows.Forms.Button BtCancel; + private System.Windows.Forms.Button BtUp; + private System.Windows.Forms.ImageList ImgList; + private System.Windows.Forms.Button BtEdit; + private System.Windows.Forms.Button BtDel; + private System.Windows.Forms.Button BtDown; + private System.Windows.Forms.Button BtAdd; + } +} diff --git a/TVRename/Forms/Collection/AddEditCollection.cs b/TVRename/Forms/Collection/AddEditCollection.cs new file mode 100644 index 000000000..fe2c2d4cf --- /dev/null +++ b/TVRename/Forms/Collection/AddEditCollection.cs @@ -0,0 +1,228 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace TVRename +{ + public partial class AddEditCollection : Form + { + private static AddEditCollection aecf; + private readonly TVDoc mDoc; + private int iColl = -1; + private bool bActualMode; + private bool bActualButtons; + private bool bAddMode; + + public AddEditCollection(TVDoc doc) + { + InitializeComponent(); + mDoc = doc; + aecf = this; + bActualMode = SetTextBoxes(false, true); + bActualButtons = SetButtons(false, true); + + FillCollTreeView(); + } + + private static bool SetTextBoxes(bool bMode, bool bFull = false) + { + if (bFull) + { + aecf.TxtCollPath.Enabled = bMode; + } + aecf.TxtCollName.Enabled = bMode; + aecf.TxtCollDesc.Enabled = bMode; + + return bMode; + } + + private static bool SetButtons(bool bMode, bool bFull = false) + { + aecf.BtEdit.Enabled = bMode; + aecf.BtDel.Enabled = bMode; + aecf.BtUp.Enabled = bMode; + aecf.BtDown.Enabled = bMode; + if (bFull) + { + aecf.BtSave.Enabled = bMode; + aecf.BtCancel.Enabled = bMode; + } + return bMode; + } + + private static void ClearTextBoxes () + { + aecf.TxtCollName.Text = ""; + aecf.TxtCollPath.Text = ""; + aecf.TxtCollDesc.Text = ""; + } + + private static void FillTextBoxes (ShowCollection Collection) + { + aecf.TxtCollName.Text = Collection.Name; + aecf.TxtCollPath.Text = Collection.Path; + aecf.TxtCollDesc.Text = Collection.Description; + } + + private static ShowCollection FillCollectionFromTextBoxes () + { + ShowCollection Collection = new ShowCollection(aecf.TxtCollPath.Text); + Collection.Name = aecf.TxtCollName.Text; + Collection.Description = aecf.TxtCollDesc.Text; + + return Collection; + } + + private static void FillCollTreeView() + { + aecf.TvColl.Nodes.Clear(); + if (aecf.mDoc.ShowCollections.Count > 0) + { + TreeNode RootNode; + RootNode = aecf.TvColl.Nodes.Add("Root"); + int iCurr = 0; + foreach (ShowCollection ShowColl in aecf.mDoc.ShowCollections) + { + TreeNode CurNode; + CurNode = RootNode.Nodes.Add(ShowColl.Name); + CurNode.ToolTipText = ShowColl.Description; + CurNode.Tag = iCurr; + iCurr++; + } + aecf.TvColl.ExpandAll(); + } + } + + #region Control functions + private void TvColl_AfterSelect(object sender, TreeViewEventArgs e) + { + TreeView Tv = (TreeView)sender; + TreeNode Node = TvColl.SelectedNode; + string Sep = Tv.PathSeparator; + string[] Nodelevels = Node.FullPath.Split(Sep[0]); + + if (Nodelevels.Length == 2) + { + iColl = (int)Node.Tag; + FillTextBoxes(mDoc.ShowCollections[iColl]); + bActualButtons = SetButtons(true); + } + } + + private void BtDel_Click(object sender, EventArgs e) + { + if (iColl != -1) + { + mDoc.ShowCollections.RemoveAt(iColl); + } + + mDoc.WriteXMLFile(FileToHandle.Collections); + ClearTextBoxes(); + bActualButtons = SetButtons(false, true); + iColl = -1; + FillCollTreeView(); + } + + private void BtEdit_Click(object sender, EventArgs e) + { + if (iColl > 0) + { + bActualButtons = SetButtons(true, true); + bActualButtons = SetButtons(false); + bActualMode = SetTextBoxes(true); + BtAdd.Enabled = false; + bAddMode = false; + TvColl.Enabled = false; + } + } + + private void BtSave_Click(object sender, EventArgs e) + { + ShowCollection Sc = FillCollectionFromTextBoxes(); + if (bAddMode) + { + mDoc.ShowCollections.Add(Sc); + } + else + { + mDoc.ShowCollections[iColl] = Sc; + } + + mDoc.WriteXMLFile(FileToHandle.Collections); + + ClearTextBoxes(); + FillCollTreeView(); + + TvColl.Enabled = true; + bActualMode = SetTextBoxes(false, true); + bActualButtons = SetButtons(false, true); + iColl = -1; + BtAdd.Enabled = true; + } + + private void BtAdd_Click(object sender, EventArgs e) + { + ClearTextBoxes(); + bActualButtons = SetButtons(true, true); + bActualButtons = SetButtons(false); + bActualMode = SetTextBoxes(true, true); + BtAdd.Enabled = false; + iColl = -1; + bAddMode = true; + TvColl.Enabled = false; + } + + private void BtOk_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.OK; + Close(); + } + + private void BtCancel_Click(object sender, EventArgs e) + { + ClearTextBoxes(); + bActualMode = SetTextBoxes(false, true); + bActualButtons = SetButtons(false, true); + BtAdd.Enabled = true; + bAddMode = false; + iColl = -1; + FillCollTreeView(); + TvColl.Enabled = true; + } + + private void BtUp_Click(object sender, EventArgs e) + { + ShowCollection Sc; + // No swap over the Default collection + if (iColl > 1) + { + Sc = mDoc.ShowCollections[iColl]; + mDoc.ShowCollections[iColl] = mDoc.ShowCollections[iColl - 1]; + mDoc.ShowCollections[iColl - 1] = Sc; + } + iColl = -1; + FillCollTreeView(); + } + + private void BtDown_Click(object sender, EventArgs e) + { + ShowCollection Sc; + // No Swap after last collection + if (iColl < mDoc.ShowCollections.Count - 1) + { + Sc = mDoc.ShowCollections[iColl]; + mDoc.ShowCollections[iColl] = mDoc.ShowCollections[iColl + 1]; + mDoc.ShowCollections[iColl + 1] = Sc; + } + iColl = -1; + FillCollTreeView(); + } + #endregion + } +} diff --git a/TVRename/Forms/Collection/AddEditCollection.resx b/TVRename/Forms/Collection/AddEditCollection.resx new file mode 100644 index 000000000..0e6b3f77b --- /dev/null +++ b/TVRename/Forms/Collection/AddEditCollection.resx @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA+ + DQAAAk1TRnQBSQFMAgEBBQEAAQgBAAEIAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA + AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 + AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA + AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm + AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM + AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA + ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz + AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ + AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM + AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA + AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA + AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ + AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/ + AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA + AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm + ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ + Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz + AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA + AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM + AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM + ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM + Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA + AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM + AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ + AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz + AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm + AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw + AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/wEAATcBWQFYAXkBGgH/ + OgABmgJZATEBUgEaOgAB9AJ6AVgBMQF5OwABwwFZAXoBMQFzAbQB9DkAAf8BGgF6AZkBvAGzAbsB9DsA + AhkBCQK0AfQ6AAH0AhkBCQG0AXIB9DoAAfQCGQFWAS4BlwH0OgAB9AGYAXgBVgEuAXgB9DoAAfQCeAFW + AS4BlwH0OgAB9AJ4AVYBLgGYAfQ6AAH0AZgBeAFWAU8BCDsAAfQCmQFWAU8B8TsAAfQBGwFXAVYBeD0A + ARsBeAGZdQAB9AOtAawBpgEJCgAB/wEJAa0BCQH/CgAB8wKmAYoBtQHyBgAB/wHwAUUBkwH0BAAB/wGT + AekBGgH/BgAB9AGzAdsCswGtAQkJAAH/AQkBtAGzAa0BCQH/CQAB8wKmAawBugHzBgAB8ANGAZMB9AIA + Af8BkwFFAm8B8gH/BQAB9AGzAdsCswGtAQkJAAEJAdsBCQGzAq0BCQkAAfMCpgGKAbQB8wUAAfIDRgJv + AZMB9AEAAZMB6QFGAW8BlAGTARsFAAH0AbMB2wKzAa0BCQgAAQkBtAEJAdwCswGtAaYBCQgAAfMDigGz + AfMFAAFGAW8BlAFvAUYBbwFGAW8BkwEfA0YCFgFGBQAB9AGzAdsCswGtAQkGAAH/AQkB1APcArMCrQGm + AbsB/wYAAfMBigGsAYoBswHyBQAB8wGTAb0BlAFvA0YBHwRGAUwBRgEHBQAB9AGzAdsCswGtAQkFAAH/ + AQkB1APVAdsCswGtAawBpgGGAQcB/wUJAbUBigGLAYoBrQG1AfAB8QPyAQAB8wEaAb0BlAFvCEYBBwH/ + BQAB9AGzAdsCswGtAQkFAAH/A/QB8QGzAdUCswGtAfAC8wH0Af8BpgWKAq0BiwKtArMBugIJAQAB/wHz + ApQB4wZGASUBGgH/BgAB9AGzAdsCswGtAfMJAAH0AbQB2wKzAa0B9AQAAawCswqtArMBtAMAAfQBRgHj + ARcERgElARoIAAH0AbMB2wKzAa0B8wkAAfQBtAHbArMBrQHxBAABswHcAboBtASzBq0BswGsAgAB/wGT + AUYBFwZGAb0B/wMAAf8B3QEJAfEBCQHVAdwCswGtAbUCCQHwAf8FAAH0AbQB2wKzAa0BCQQAAbsB3AG6 + ArMCtAKzAa0BigKtAawCigEAAf8BkwFGAhcGRgHjARsB9AIAAf8BGQHUAdUB3AIJArMCrQGmAYsBvAH/ + BQAB9AG0AdsCswGtAQkEAAX0AfICugGzAa0BtQXzAQABkwJGAW8BFwNGAW8CRgHjAZQBGwH/AwABGQGt + AdUC3AKzAa0BrAGmAbwHAAH0AbQB2wKzAa0BCQkAAfQB3AG6ArMBCQUAAZQBJQHjARYBbwJGASUBIAEX + ARYCRgIWAb0EAAEZAbMB2wHcArMBrQGLAbwIAAH0AbQB2wKzAa0BCQkAAfQC3AKzAQkFAAGUARYBvQGU + AW8CRgGTARoBRwHjARYBRgFvARcBRwUAAfEBtAHbAbMCrQHwCQAB9AG0AdsCswGtAQkJAAH0AQkB3AKz + AQkFAAH0Ab0ClAJGAZMB/wEAARoC4wFvAkYBGgUAAf8B3QGzAq0B8AH/CQAB9AG0AdwCswGtAQkJAAH0 + AQkB3AG0AbMBCQYAAfQBlAFHASABkwH/AgAB/wEaAUcCRgEaAf8HAAEJAa0B8AsAAfQDrQGsAccBCQkA + AfQB2wGyAqwBCQcAAfQB4wGUBgABGgFGAfMCAAFCAU0BPgcAAT4DAAEoAwABQAMAASADAAEBAQABAQYA + AQEWAAP/AQABAwH/BgABAwH/BgABAwH/BgABgAH/BgABgAF/BgAB8AE/BgAB8AEfBgAB+AEPBgAB/AEH + BgAB/gEDBgAB/wEBBgAB/wGBBgAB/wHABgAB/wHgBgAB/wH4BgAC/wYAAfgBDwH8AR8B+AEfAYMBwQH4 + AQ8B+AEPAfgBHwGBAYAB+AEPAfgBDwH4AR8BAAGAAfgBDwHwAQcB+AEfAgAB+AEPAcABAQH4AR8CAAH4 + AQ8BgAMAAYABAAH4AQ8BgAMAAYABAQH4AQ8B+AEPAgAB4AEHAfgBDwH4AQ8CAAHAAQMBgAEAAfgBDwIA + AYABAQGAAQAB+AEPAgABgAEAAeABAwH4AQ8B+AEfAgAB8AEHAfgBDwH4AR8CAAH4AQ8B+AEPAfgBHwEA + AYAB+AEPAfgBDwH4AR8BgQGAAf4BPwH4AQ8B+AEfAccB4ws= + + + + 60 + + + + + AAABAAIAICAQAAAABADoAgAAJgAAABAQEAAAAAQAKAEAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAAAAAC + AAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAICAgADAwMAAAAD/AAD/ + AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////wAAAAD///////////////8AAAAA + ////mf////+Z////AAAAAP///5n/////mf///wAAAAD///+Z/////5n///8AAAAA////mf////+Z//// + AAAAAP///5n///+Z/5n//wAAAAD///+Z////mf+Z//8AAAAA////mf///5n/mf//AAAAAP///5n///+Z + /5n//wAAAAD/mZmZmZn/mf+Z//8AAAAA/5mZmZmZ/5n/mf//AAAAAP///////////////wAAAAD///// + //////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////// + ///AAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AA + AAPAAAADwAAAA8AAAAP/8z////Mf///Pz///z8///8/z///P8///P/z//z/8//////////////////// + //8oAAAAEAAAACAAAAABAAQAAAAAAIAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAgAAAgAAAAICAAIAA + AACAAIAAgIAAAICAgADAwMAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAA + AAAA////////AAD/+f//n/8AAP/5//+f/wAA//n/+fn/AAD/+f/5+f8AAPmZmfn5/wAA////////AAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAIAB + AACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAP1/AAD7fwAA+78AAPffAAD//wAA//8AAA== + + + \ No newline at end of file diff --git a/TVRename/Forms/Preferences/Preferences.Designer.cs b/TVRename/Forms/Preferences/Preferences.Designer.cs index 9606199fc..90ede532a 100644 --- a/TVRename/Forms/Preferences/Preferences.Designer.cs +++ b/TVRename/Forms/Preferences/Preferences.Designer.cs @@ -76,6 +76,7 @@ private void InitializeComponent() this.label6 = new System.Windows.Forms.Label(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tbGeneral = new System.Windows.Forms.TabPage(); + this.cbShowCollections = new System.Windows.Forms.CheckBox(); this.chkHideWtWSpoilers = new System.Windows.Forms.CheckBox(); this.chkHideMyShowsSpoilers = new System.Windows.Forms.CheckBox(); this.label37 = new System.Windows.Forms.Label(); @@ -266,6 +267,7 @@ private void InitializeComponent() this.pyTivoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mede8erToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.noneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.cbDeleteShowFromDisk = new System.Windows.Forms.CheckBox(); this.groupBox2.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tbGeneral.SuspendLayout(); @@ -295,7 +297,7 @@ private void InitializeComponent() // OKButton // this.OKButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.OKButton.Location = new System.Drawing.Point(369, 551); + this.OKButton.Location = new System.Drawing.Point(369, 554); this.OKButton.Name = "OKButton"; this.OKButton.Size = new System.Drawing.Size(75, 23); this.OKButton.TabIndex = 0; @@ -307,7 +309,7 @@ private void InitializeComponent() // this.bnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.bnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.bnCancel.Location = new System.Drawing.Point(450, 551); + this.bnCancel.Location = new System.Drawing.Point(450, 554); this.bnCancel.Name = "bnCancel"; this.bnCancel.Size = new System.Drawing.Size(75, 23); this.bnCancel.TabIndex = 1; @@ -549,7 +551,7 @@ private void InitializeComponent() // cbShowEpisodePictures // this.cbShowEpisodePictures.AutoSize = true; - this.cbShowEpisodePictures.Location = new System.Drawing.Point(9, 138); + this.cbShowEpisodePictures.Location = new System.Drawing.Point(9, 159); this.cbShowEpisodePictures.Name = "cbShowEpisodePictures"; this.cbShowEpisodePictures.Size = new System.Drawing.Size(218, 17); this.cbShowEpisodePictures.TabIndex = 10; @@ -580,7 +582,7 @@ private void InitializeComponent() // chkShowInTaskbar // this.chkShowInTaskbar.AutoSize = true; - this.chkShowInTaskbar.Location = new System.Drawing.Point(169, 115); + this.chkShowInTaskbar.Location = new System.Drawing.Point(169, 136); this.chkShowInTaskbar.Name = "chkShowInTaskbar"; this.chkShowInTaskbar.Size = new System.Drawing.Size(102, 17); this.chkShowInTaskbar.TabIndex = 9; @@ -591,7 +593,7 @@ private void InitializeComponent() // cbNotificationIcon // this.cbNotificationIcon.AutoSize = true; - this.cbNotificationIcon.Location = new System.Drawing.Point(9, 115); + this.cbNotificationIcon.Location = new System.Drawing.Point(9, 136); this.cbNotificationIcon.Name = "cbNotificationIcon"; this.cbNotificationIcon.Size = new System.Drawing.Size(154, 17); this.cbNotificationIcon.TabIndex = 8; @@ -663,11 +665,12 @@ private void InitializeComponent() this.tabControl1.Multiline = true; this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(517, 533); + this.tabControl1.Size = new System.Drawing.Size(517, 536); this.tabControl1.TabIndex = 0; // // tbGeneral // + this.tbGeneral.Controls.Add(this.cbShowCollections); this.tbGeneral.Controls.Add(this.chkHideWtWSpoilers); this.tbGeneral.Controls.Add(this.chkHideMyShowsSpoilers); this.tbGeneral.Controls.Add(this.label37); @@ -695,15 +698,25 @@ private void InitializeComponent() this.tbGeneral.Location = new System.Drawing.Point(4, 40); this.tbGeneral.Name = "tbGeneral"; this.tbGeneral.Padding = new System.Windows.Forms.Padding(3); - this.tbGeneral.Size = new System.Drawing.Size(509, 489); + this.tbGeneral.Size = new System.Drawing.Size(509, 492); this.tbGeneral.TabIndex = 0; this.tbGeneral.Text = "General"; this.tbGeneral.UseVisualStyleBackColor = true; // + // cbShowCollections + // + this.cbShowCollections.AutoSize = true; + this.cbShowCollections.Location = new System.Drawing.Point(9, 115); + this.cbShowCollections.Name = "cbShowCollections"; + this.cbShowCollections.Size = new System.Drawing.Size(145, 17); + this.cbShowCollections.TabIndex = 2; + this.cbShowCollections.Text = "Multiple Show collections"; + this.cbShowCollections.UseVisualStyleBackColor = true; + // // chkHideWtWSpoilers // this.chkHideWtWSpoilers.AutoSize = true; - this.chkHideWtWSpoilers.Location = new System.Drawing.Point(9, 184); + this.chkHideWtWSpoilers.Location = new System.Drawing.Point(9, 205); this.chkHideWtWSpoilers.Name = "chkHideWtWSpoilers"; this.chkHideWtWSpoilers.Size = new System.Drawing.Size(182, 17); this.chkHideWtWSpoilers.TabIndex = 24; @@ -713,7 +726,7 @@ private void InitializeComponent() // chkHideMyShowsSpoilers // this.chkHideMyShowsSpoilers.AutoSize = true; - this.chkHideMyShowsSpoilers.Location = new System.Drawing.Point(9, 161); + this.chkHideMyShowsSpoilers.Location = new System.Drawing.Point(9, 182); this.chkHideMyShowsSpoilers.Name = "chkHideMyShowsSpoilers"; this.chkHideMyShowsSpoilers.Size = new System.Drawing.Size(151, 17); this.chkHideMyShowsSpoilers.TabIndex = 23; @@ -723,7 +736,7 @@ private void InitializeComponent() // label37 // this.label37.AutoSize = true; - this.label37.Location = new System.Drawing.Point(6, 229); + this.label37.Location = new System.Drawing.Point(6, 250); this.label37.Name = "label37"; this.label37.Size = new System.Drawing.Size(114, 13); this.label37.TabIndex = 20; @@ -732,7 +745,7 @@ private void InitializeComponent() // label38 // this.label38.AutoSize = true; - this.label38.Location = new System.Drawing.Point(158, 229); + this.label38.Location = new System.Drawing.Point(158, 250); this.label38.Name = "label38"; this.label38.Size = new System.Drawing.Size(132, 13); this.label38.TabIndex = 22; @@ -740,7 +753,7 @@ private void InitializeComponent() // // tbPercentDirty // - this.tbPercentDirty.Location = new System.Drawing.Point(123, 226); + this.tbPercentDirty.Location = new System.Drawing.Point(123, 247); this.tbPercentDirty.Name = "tbPercentDirty"; this.tbPercentDirty.Size = new System.Drawing.Size(28, 20); this.tbPercentDirty.TabIndex = 21; @@ -752,7 +765,7 @@ private void InitializeComponent() this.cbMode.Items.AddRange(new object[] { "Beta", "Production"}); - this.cbMode.Location = new System.Drawing.Point(112, 320); + this.cbMode.Location = new System.Drawing.Point(112, 341); this.cbMode.Name = "cbMode"; this.cbMode.Size = new System.Drawing.Size(146, 21); this.cbMode.Sorted = true; @@ -761,7 +774,7 @@ private void InitializeComponent() // label34 // this.label34.AutoSize = true; - this.label34.Location = new System.Drawing.Point(6, 323); + this.label34.Location = new System.Drawing.Point(6, 344); this.label34.Name = "label34"; this.label34.Size = new System.Drawing.Size(37, 13); this.label34.TabIndex = 18; @@ -792,7 +805,7 @@ private void InitializeComponent() // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(6, 299); + this.label10.Location = new System.Drawing.Point(6, 320); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(100, 13); this.label10.TabIndex = 16; @@ -801,7 +814,7 @@ private void InitializeComponent() // cbLookForAirdate // this.cbLookForAirdate.AutoSize = true; - this.cbLookForAirdate.Location = new System.Drawing.Point(9, 275); + this.cbLookForAirdate.Location = new System.Drawing.Point(9, 296); this.cbLookForAirdate.Name = "cbLookForAirdate"; this.cbLookForAirdate.Size = new System.Drawing.Size(158, 17); this.cbLookForAirdate.TabIndex = 15; @@ -816,7 +829,7 @@ private void InitializeComponent() "My Shows", "Scan", "When to Watch"}); - this.cbLanguages.Location = new System.Drawing.Point(112, 296); + this.cbLanguages.Location = new System.Drawing.Point(112, 317); this.cbLanguages.Name = "cbLanguages"; this.cbLanguages.Size = new System.Drawing.Size(146, 21); this.cbLanguages.Sorted = true; @@ -825,7 +838,7 @@ private void InitializeComponent() // label21 // this.label21.AutoSize = true; - this.label21.Location = new System.Drawing.Point(6, 205); + this.label21.Location = new System.Drawing.Point(6, 226); this.label21.Name = "label21"; this.label21.Size = new System.Drawing.Size(82, 13); this.label21.TabIndex = 11; @@ -834,7 +847,7 @@ private void InitializeComponent() // cbAutoSelInMyShows // this.cbAutoSelInMyShows.AutoSize = true; - this.cbAutoSelInMyShows.Location = new System.Drawing.Point(9, 252); + this.cbAutoSelInMyShows.Location = new System.Drawing.Point(9, 273); this.cbAutoSelInMyShows.Name = "cbAutoSelInMyShows"; this.cbAutoSelInMyShows.Size = new System.Drawing.Size(268, 17); this.cbAutoSelInMyShows.TabIndex = 14; @@ -853,7 +866,7 @@ private void InitializeComponent() // label20 // this.label20.AutoSize = true; - this.label20.Location = new System.Drawing.Point(126, 205); + this.label20.Location = new System.Drawing.Point(126, 226); this.label20.Name = "label20"; this.label20.Size = new System.Drawing.Size(170, 13); this.label20.TabIndex = 13; @@ -861,7 +874,7 @@ private void InitializeComponent() // // txtParallelDownloads // - this.txtParallelDownloads.Location = new System.Drawing.Point(92, 202); + this.txtParallelDownloads.Location = new System.Drawing.Point(92, 223); this.txtParallelDownloads.Name = "txtParallelDownloads"; this.txtParallelDownloads.Size = new System.Drawing.Size(28, 20); this.txtParallelDownloads.TabIndex = 12; @@ -1543,6 +1556,7 @@ private void InitializeComponent() // // tbFolderDeleting // + this.tbFolderDeleting.Controls.Add(this.cbDeleteShowFromDisk); this.tbFolderDeleting.Controls.Add(this.cbCleanUpDownloadDir); this.tbFolderDeleting.Controls.Add(this.label32); this.tbFolderDeleting.Controls.Add(this.label30); @@ -1558,7 +1572,7 @@ private void InitializeComponent() this.tbFolderDeleting.Location = new System.Drawing.Point(4, 40); this.tbFolderDeleting.Name = "tbFolderDeleting"; this.tbFolderDeleting.Padding = new System.Windows.Forms.Padding(3); - this.tbFolderDeleting.Size = new System.Drawing.Size(509, 489); + this.tbFolderDeleting.Size = new System.Drawing.Size(509, 492); this.tbFolderDeleting.TabIndex = 9; this.tbFolderDeleting.Text = "Folder Deleting"; this.tbFolderDeleting.UseVisualStyleBackColor = true; @@ -2733,13 +2747,23 @@ private void InitializeComponent() this.noneToolStripMenuItem.Tag = "4"; this.noneToolStripMenuItem.Text = "&None"; // + // cbDeleteShowFromDisk + // + this.cbDeleteShowFromDisk.AutoSize = true; + this.cbDeleteShowFromDisk.Location = new System.Drawing.Point(16, 267); + this.cbDeleteShowFromDisk.Name = "cbDeleteShowFromDisk"; + this.cbDeleteShowFromDisk.Size = new System.Drawing.Size(269, 17); + this.cbDeleteShowFromDisk.TabIndex = 11; + this.cbDeleteShowFromDisk.Text = "Delete from disk when deleting show from database"; + this.cbDeleteShowFromDisk.UseVisualStyleBackColor = true; + // // Preferences // this.AcceptButton = this.OKButton; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.bnCancel; - this.ClientSize = new System.Drawing.Size(541, 576); + this.ClientSize = new System.Drawing.Size(541, 579); this.ControlBox = false; this.Controls.Add(this.tabControl1); this.Controls.Add(this.bnCancel); @@ -3043,5 +3067,7 @@ private void InitializeComponent() private System.Windows.Forms.TextBox txtSeasonFormat; private System.Windows.Forms.Label label47; private System.Windows.Forms.CheckBox cbWDLiveEpisodeFiles; + private System.Windows.Forms.CheckBox cbShowCollections; + private System.Windows.Forms.CheckBox cbDeleteShowFromDisk; } } diff --git a/TVRename/Forms/Preferences/Preferences.cs b/TVRename/Forms/Preferences/Preferences.cs index 5e696d197..55af2b635 100644 --- a/TVRename/Forms/Preferences/Preferences.cs +++ b/TVRename/Forms/Preferences/Preferences.cs @@ -147,6 +147,8 @@ private void OKButton_Click(object sender, EventArgs e) s.ShowInTaskbar = chkShowInTaskbar.Checked; s.RenameTxtToSub = cbTxtToSub.Checked; s.ShowEpisodePictures = cbShowEpisodePictures.Checked; + s.ShowCollections = cbShowCollections.Checked; + s.DeleteShowFromDisk = cbDeleteShowFromDisk.Checked; s.HideMyShowsSpoilers = chkHideMyShowsSpoilers.Checked; s.HideWtWSpoilers = chkHideWtWSpoilers.Checked; s.AutoSelectShowInMyShows = cbAutoSelInMyShows.Checked; @@ -381,6 +383,8 @@ private void Preferences_Load(object sender, EventArgs e) chkHideWtWSpoilers.Checked = s.HideWtWSpoilers; cbAutoCreateFolders.Checked = s.AutoCreateFolders; cbAutoSelInMyShows.Checked = s.AutoSelectShowInMyShows; + cbShowCollections.Checked = s.ShowCollections; + cbDeleteShowFromDisk.Checked = s.DeleteShowFromDisk; txtSpecialsFolderName.Text = s.SpecialsFolderName; txtSeasonFormat.Text= s.SeasonFolderFormat ; cbForceLower.Checked = s.ForceLowercaseFilenames; diff --git a/TVRename/Forms/UI.Designer.cs b/TVRename/Forms/UI.Designer.cs index 9400591f8..a2b8c08d4 100644 --- a/TVRename/Forms/UI.Designer.cs +++ b/TVRename/Forms/UI.Designer.cs @@ -63,6 +63,10 @@ public void InitializeComponent() System.Windows.Forms.ListViewGroup listViewGroup14 = new System.Windows.Forms.ListViewGroup("Later", System.Windows.Forms.HorizontalAlignment.Left); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.collToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.aeCollToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripSeparator0 = new System.Windows.Forms.ToolStripSeparator(); this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); @@ -134,16 +138,6 @@ public void InitializeComponent() this.bnActionOptions = new System.Windows.Forms.Button(); this.bnActionWhichSearch = new System.Windows.Forms.Button(); this.bnActionBTSearch = new System.Windows.Forms.Button(); - this.lvAction = new TVRename.MyListView(); - this.columnHeader48 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader49 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader51 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader52 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader53 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader54 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader55 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader56 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader58 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.ilIcons = new System.Windows.Forms.ImageList(this.components); this.bnActionAction = new System.Windows.Forms.Button(); this.bnActionRecentCheck = new System.Windows.Forms.Button(); @@ -154,15 +148,6 @@ public void InitializeComponent() this.bnWhenToWatchCheck = new System.Windows.Forms.Button(); this.txtWhenToWatchSynopsis = new System.Windows.Forms.TextBox(); this.calCalendar = new System.Windows.Forms.MonthCalendar(); - this.lvWhenToWatch = new TVRename.ListViewFlickerFree(); - this.columnHeader29 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader30 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader31 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader32 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader36 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader33 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader34 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader35 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.pbProgressBarx = new System.Windows.Forms.ProgressBar(); this.txtDLStatusLabel = new System.Windows.Forms.Label(); @@ -191,6 +176,25 @@ public void InitializeComponent() this.tmrPeriodicScan = new System.Windows.Forms.Timer(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.btnUpdateAvailable = new System.Windows.Forms.Button(); + this.lvAction = new TVRename.MyListView(); + this.columnHeader48 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader49 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader51 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader52 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader53 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader54 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader55 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader56 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader58 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.lvWhenToWatch = new TVRename.ListViewFlickerFree(); + this.columnHeader29 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader30 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader31 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader32 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader36 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader33 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader34 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader35 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.menuStrip1.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tbMyShows.SuspendLayout(); @@ -224,6 +228,8 @@ public void InitializeComponent() // fileToolStripMenuItem // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.collToolStripMenuItem, + this.toolStripSeparator0, this.exportToolStripMenuItem, this.saveToolStripMenuItem, this.toolStripSeparator1, @@ -233,11 +239,38 @@ public void InitializeComponent() this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "&File"; // + // collToolStripMenuItem + // + this.collToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.aeCollToolStripMenuItem, + this.toolStripSeparator8}); + this.collToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("collToolStripMenuItem.Image"))); + this.collToolStripMenuItem.Name = "collToolStripMenuItem"; + this.collToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.collToolStripMenuItem.Text = "&Collection"; + // + // aeCollToolStripMenuItem + // + this.aeCollToolStripMenuItem.Name = "aeCollToolStripMenuItem"; + this.aeCollToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.aeCollToolStripMenuItem.Text = "Add / Edit"; + this.aeCollToolStripMenuItem.Click += new System.EventHandler(this.aeCollToolStripMenuItem_Click); + // + // toolStripSeparator8 + // + this.toolStripSeparator8.Name = "toolStripSeparator8"; + this.toolStripSeparator8.Size = new System.Drawing.Size(177, 6); + // + // toolStripSeparator0 + // + this.toolStripSeparator0.Name = "toolStripSeparator0"; + this.toolStripSeparator0.Size = new System.Drawing.Size(177, 6); + // // exportToolStripMenuItem // this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; this.exportToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); - this.exportToolStripMenuItem.Size = new System.Drawing.Size(147, 22); + this.exportToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.exportToolStripMenuItem.Text = "&Export"; this.exportToolStripMenuItem.Click += new System.EventHandler(this.exportToolStripMenuItem_Click); // @@ -246,20 +279,20 @@ public void InitializeComponent() this.saveToolStripMenuItem.Image = global::TVRename.Properties.Resources.saveHS; this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.saveToolStripMenuItem.Size = new System.Drawing.Size(147, 22); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.saveToolStripMenuItem.Text = "&Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(144, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); - this.exitToolStripMenuItem.Size = new System.Drawing.Size(147, 22); + this.exitToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.exitToolStripMenuItem.Text = "E&xit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); // @@ -407,19 +440,19 @@ public void InitializeComponent() // this.statisticsToolStripMenuItem.Image = global::TVRename.Properties.Resources.graphhs; this.statisticsToolStripMenuItem.Name = "statisticsToolStripMenuItem"; - this.statisticsToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.statisticsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.statisticsToolStripMenuItem.Text = "&Statistics..."; this.statisticsToolStripMenuItem.Click += new System.EventHandler(this.statisticsToolStripMenuItem_Click); // // toolStripSeparator5 // this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(163, 6); + this.toolStripSeparator5.Size = new System.Drawing.Size(177, 6); // // showSummaryToolStripMenuItem // this.showSummaryToolStripMenuItem.Name = "showSummaryToolStripMenuItem"; - this.showSummaryToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.showSummaryToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.showSummaryToolStripMenuItem.Text = "Show Summary..."; this.showSummaryToolStripMenuItem.Click += new System.EventHandler(this.showSummaryToolStripMenuItem_Click); // @@ -427,7 +460,7 @@ public void InitializeComponent() // this.actorsToolStripMenuItem.Image = global::TVRename.Properties.Resources.TableHS; this.actorsToolStripMenuItem.Name = "actorsToolStripMenuItem"; - this.actorsToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.actorsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.actorsToolStripMenuItem.Text = "&Actors Grid..."; this.actorsToolStripMenuItem.Click += new System.EventHandler(this.actorsToolStripMenuItem_Click); // @@ -999,121 +1032,6 @@ public void InitializeComponent() this.bnActionBTSearch.UseVisualStyleBackColor = true; this.bnActionBTSearch.Click += new System.EventHandler(this.bnActionBTSearch_Click); // - // lvAction - // - this.lvAction.AllowDrop = true; - this.lvAction.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvAction.CheckBoxes = true; - this.lvAction.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader48, - this.columnHeader49, - this.columnHeader51, - this.columnHeader52, - this.columnHeader53, - this.columnHeader54, - this.columnHeader55, - this.columnHeader56, - this.columnHeader58}); - this.lvAction.FullRowSelect = true; - listViewGroup1.Header = "Missing"; - listViewGroup1.Name = "lvgActionMissing"; - listViewGroup2.Header = "Rename"; - listViewGroup2.Name = "lvgActionRename"; - listViewGroup3.Header = "Copy"; - listViewGroup3.Name = "lvgActionCopy"; - listViewGroup4.Header = "Move"; - listViewGroup4.Name = "lvgActionMove"; - listViewGroup5.Header = "Remove"; - listViewGroup5.Name = "lvgActionDelete"; - listViewGroup6.Header = "Download RSS"; - listViewGroup6.Name = "lvgActionDownloadRSS"; - listViewGroup7.Header = "Download"; - listViewGroup7.Name = "lvgActionDownload"; - listViewGroup8.Header = "Media Center Metadata"; - listViewGroup8.Name = "lvgActionMeta"; - listViewGroup9.Header = "Update File Metadata"; - listViewGroup9.Name = "lvgUpdateFileDates"; - listViewGroup10.Header = "Downloading"; - listViewGroup10.Name = "lvgDownloading"; - this.lvAction.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { - listViewGroup1, - listViewGroup2, - listViewGroup3, - listViewGroup4, - listViewGroup5, - listViewGroup6, - listViewGroup7, - listViewGroup8, - listViewGroup9, - listViewGroup10}); - this.lvAction.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.lvAction.HideSelection = false; - this.lvAction.Location = new System.Drawing.Point(0, 35); - this.lvAction.Name = "lvAction"; - this.lvAction.ShowItemToolTips = true; - this.lvAction.Size = new System.Drawing.Size(920, 435); - this.lvAction.SmallImageList = this.ilIcons; - this.lvAction.TabIndex = 2; - this.lvAction.UseCompatibleStateImageBehavior = false; - this.lvAction.View = System.Windows.Forms.View.Details; - this.lvAction.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.lvAction_ItemCheck); - this.lvAction.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lvAction_ItemChecked); - this.lvAction.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.lvAction_RetrieveVirtualItem); - this.lvAction.SelectedIndexChanged += new System.EventHandler(this.lvAction_SelectedIndexChanged); - this.lvAction.DragDrop += new System.Windows.Forms.DragEventHandler(this.lvAction_DragDrop); - this.lvAction.DragEnter += new System.Windows.Forms.DragEventHandler(this.lvAction_DragEnter); - this.lvAction.DragOver += new System.Windows.Forms.DragEventHandler(this.lvAction_DragEnter); - this.lvAction.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvAction_KeyDown); - this.lvAction.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvAction_MouseClick); - this.lvAction.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvAction_MouseDoubleClick); - // - // columnHeader48 - // - this.columnHeader48.Text = "Show"; - this.columnHeader48.Width = 155; - // - // columnHeader49 - // - this.columnHeader49.Text = "Season"; - this.columnHeader49.Width = 50; - // - // columnHeader51 - // - this.columnHeader51.Text = "Episode"; - this.columnHeader51.Width = 50; - // - // columnHeader52 - // - this.columnHeader52.Text = "Date"; - this.columnHeader52.Width = 70; - // - // columnHeader53 - // - this.columnHeader53.Text = "Folder"; - this.columnHeader53.Width = 180; - // - // columnHeader54 - // - this.columnHeader54.Text = "Episode/Filename"; - this.columnHeader54.Width = 180; - // - // columnHeader55 - // - this.columnHeader55.Text = "Folder/Filename"; - this.columnHeader55.Width = 180; - // - // columnHeader56 - // - this.columnHeader56.Text = "Filename"; - this.columnHeader56.Width = 180; - // - // columnHeader58 - // - this.columnHeader58.Text = "Errors"; - this.columnHeader58.Width = 180; - // // ilIcons // this.ilIcons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ilIcons.ImageStream"))); @@ -1243,89 +1161,6 @@ public void InitializeComponent() this.calCalendar.TabIndex = 5; this.calCalendar.DateSelected += new System.Windows.Forms.DateRangeEventHandler(this.calCalendar_DateSelected); // - // lvWhenToWatch - // - this.lvWhenToWatch.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvWhenToWatch.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader29, - this.columnHeader30, - this.columnHeader31, - this.columnHeader32, - this.columnHeader36, - this.columnHeader33, - this.columnHeader34, - this.columnHeader35}); - this.lvWhenToWatch.FullRowSelect = true; - listViewGroup11.Header = "Recently Aired"; - listViewGroup11.Name = "justPassed"; - listViewGroup12.Header = "Next 7 Days"; - listViewGroup12.Name = "next7days"; - listViewGroup12.Tag = "1"; - listViewGroup13.Header = "Future Episodes"; - listViewGroup13.Name = "futureEps"; - listViewGroup14.Header = "Later"; - listViewGroup14.Name = "later"; - listViewGroup14.Tag = "2"; - this.lvWhenToWatch.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { - listViewGroup11, - listViewGroup12, - listViewGroup13, - listViewGroup14}); - this.lvWhenToWatch.HideSelection = false; - this.lvWhenToWatch.Location = new System.Drawing.Point(0, 35); - this.lvWhenToWatch.Name = "lvWhenToWatch"; - this.lvWhenToWatch.ShowItemToolTips = true; - this.lvWhenToWatch.Size = new System.Drawing.Size(923, 297); - this.lvWhenToWatch.SmallImageList = this.ilIcons; - this.lvWhenToWatch.TabIndex = 3; - this.lvWhenToWatch.UseCompatibleStateImageBehavior = false; - this.lvWhenToWatch.View = System.Windows.Forms.View.Details; - this.lvWhenToWatch.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lvWhenToWatch_ColumnClick); - this.lvWhenToWatch.SelectedIndexChanged += new System.EventHandler(this.lvWhenToWatch_Click); - this.lvWhenToWatch.DoubleClick += new System.EventHandler(this.lvWhenToWatch_DoubleClick); - this.lvWhenToWatch.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvWhenToWatch_MouseClick); - // - // columnHeader29 - // - this.columnHeader29.Text = "Show"; - this.columnHeader29.Width = 187; - // - // columnHeader30 - // - this.columnHeader30.Text = "Season"; - this.columnHeader30.Width = 51; - // - // columnHeader31 - // - this.columnHeader31.Text = "Episode"; - this.columnHeader31.Width = 55; - // - // columnHeader32 - // - this.columnHeader32.Text = "Air Date"; - this.columnHeader32.Width = 81; - // - // columnHeader36 - // - this.columnHeader36.Text = "Time"; - // - // columnHeader33 - // - this.columnHeader33.Text = "Day"; - this.columnHeader33.Width = 42; - // - // columnHeader34 - // - this.columnHeader34.Text = "How Long"; - this.columnHeader34.Width = 69; - // - // columnHeader35 - // - this.columnHeader35.Text = "Episode Name"; - this.columnHeader35.Width = 360; - // // tableLayoutPanel2 // this.tableLayoutPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) @@ -1508,6 +1343,204 @@ public void InitializeComponent() this.btnUpdateAvailable.Visible = false; this.btnUpdateAvailable.Click += new System.EventHandler(this.btnUpdateAvailable_Click); // + // lvAction + // + this.lvAction.AllowDrop = true; + this.lvAction.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvAction.CheckBoxes = true; + this.lvAction.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader48, + this.columnHeader49, + this.columnHeader51, + this.columnHeader52, + this.columnHeader53, + this.columnHeader54, + this.columnHeader55, + this.columnHeader56, + this.columnHeader58}); + this.lvAction.FullRowSelect = true; + listViewGroup1.Header = "Missing"; + listViewGroup1.Name = "lvgActionMissing"; + listViewGroup2.Header = "Rename"; + listViewGroup2.Name = "lvgActionRename"; + listViewGroup3.Header = "Copy"; + listViewGroup3.Name = "lvgActionCopy"; + listViewGroup4.Header = "Move"; + listViewGroup4.Name = "lvgActionMove"; + listViewGroup5.Header = "Remove"; + listViewGroup5.Name = "lvgActionDelete"; + listViewGroup6.Header = "Download RSS"; + listViewGroup6.Name = "lvgActionDownloadRSS"; + listViewGroup7.Header = "Download"; + listViewGroup7.Name = "lvgActionDownload"; + listViewGroup8.Header = "Media Center Metadata"; + listViewGroup8.Name = "lvgActionMeta"; + listViewGroup9.Header = "Update File Metadata"; + listViewGroup9.Name = "lvgUpdateFileDates"; + listViewGroup10.Header = "Downloading"; + listViewGroup10.Name = "lvgDownloading"; + this.lvAction.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { + listViewGroup1, + listViewGroup2, + listViewGroup3, + listViewGroup4, + listViewGroup5, + listViewGroup6, + listViewGroup7, + listViewGroup8, + listViewGroup9, + listViewGroup10}); + this.lvAction.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.lvAction.HideSelection = false; + this.lvAction.Location = new System.Drawing.Point(0, 35); + this.lvAction.Name = "lvAction"; + this.lvAction.ShowItemToolTips = true; + this.lvAction.Size = new System.Drawing.Size(920, 435); + this.lvAction.SmallImageList = this.ilIcons; + this.lvAction.TabIndex = 2; + this.lvAction.UseCompatibleStateImageBehavior = false; + this.lvAction.View = System.Windows.Forms.View.Details; + this.lvAction.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.lvAction_ItemCheck); + this.lvAction.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lvAction_ItemChecked); + this.lvAction.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.lvAction_RetrieveVirtualItem); + this.lvAction.SelectedIndexChanged += new System.EventHandler(this.lvAction_SelectedIndexChanged); + this.lvAction.DragDrop += new System.Windows.Forms.DragEventHandler(this.lvAction_DragDrop); + this.lvAction.DragEnter += new System.Windows.Forms.DragEventHandler(this.lvAction_DragEnter); + this.lvAction.DragOver += new System.Windows.Forms.DragEventHandler(this.lvAction_DragEnter); + this.lvAction.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvAction_KeyDown); + this.lvAction.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvAction_MouseClick); + this.lvAction.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvAction_MouseDoubleClick); + // + // columnHeader48 + // + this.columnHeader48.Text = "Show"; + this.columnHeader48.Width = 155; + // + // columnHeader49 + // + this.columnHeader49.Text = "Season"; + this.columnHeader49.Width = 50; + // + // columnHeader51 + // + this.columnHeader51.Text = "Episode"; + this.columnHeader51.Width = 50; + // + // columnHeader52 + // + this.columnHeader52.Text = "Date"; + this.columnHeader52.Width = 70; + // + // columnHeader53 + // + this.columnHeader53.Text = "Folder"; + this.columnHeader53.Width = 180; + // + // columnHeader54 + // + this.columnHeader54.Text = "Episode/Filename"; + this.columnHeader54.Width = 180; + // + // columnHeader55 + // + this.columnHeader55.Text = "Folder/Filename"; + this.columnHeader55.Width = 180; + // + // columnHeader56 + // + this.columnHeader56.Text = "Filename"; + this.columnHeader56.Width = 180; + // + // columnHeader58 + // + this.columnHeader58.Text = "Errors"; + this.columnHeader58.Width = 180; + // + // lvWhenToWatch + // + this.lvWhenToWatch.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvWhenToWatch.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader29, + this.columnHeader30, + this.columnHeader31, + this.columnHeader32, + this.columnHeader36, + this.columnHeader33, + this.columnHeader34, + this.columnHeader35}); + this.lvWhenToWatch.FullRowSelect = true; + listViewGroup11.Header = "Recently Aired"; + listViewGroup11.Name = "justPassed"; + listViewGroup12.Header = "Next 7 Days"; + listViewGroup12.Name = "next7days"; + listViewGroup12.Tag = "1"; + listViewGroup13.Header = "Future Episodes"; + listViewGroup13.Name = "futureEps"; + listViewGroup14.Header = "Later"; + listViewGroup14.Name = "later"; + listViewGroup14.Tag = "2"; + this.lvWhenToWatch.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { + listViewGroup11, + listViewGroup12, + listViewGroup13, + listViewGroup14}); + this.lvWhenToWatch.HideSelection = false; + this.lvWhenToWatch.Location = new System.Drawing.Point(0, 35); + this.lvWhenToWatch.Name = "lvWhenToWatch"; + this.lvWhenToWatch.ShowItemToolTips = true; + this.lvWhenToWatch.Size = new System.Drawing.Size(923, 297); + this.lvWhenToWatch.SmallImageList = this.ilIcons; + this.lvWhenToWatch.TabIndex = 3; + this.lvWhenToWatch.UseCompatibleStateImageBehavior = false; + this.lvWhenToWatch.View = System.Windows.Forms.View.Details; + this.lvWhenToWatch.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lvWhenToWatch_ColumnClick); + this.lvWhenToWatch.SelectedIndexChanged += new System.EventHandler(this.lvWhenToWatch_Click); + this.lvWhenToWatch.DoubleClick += new System.EventHandler(this.lvWhenToWatch_DoubleClick); + this.lvWhenToWatch.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvWhenToWatch_MouseClick); + // + // columnHeader29 + // + this.columnHeader29.Text = "Show"; + this.columnHeader29.Width = 187; + // + // columnHeader30 + // + this.columnHeader30.Text = "Season"; + this.columnHeader30.Width = 51; + // + // columnHeader31 + // + this.columnHeader31.Text = "Episode"; + this.columnHeader31.Width = 55; + // + // columnHeader32 + // + this.columnHeader32.Text = "Air Date"; + this.columnHeader32.Width = 81; + // + // columnHeader36 + // + this.columnHeader36.Text = "Time"; + // + // columnHeader33 + // + this.columnHeader33.Text = "Day"; + this.columnHeader33.Width = 42; + // + // columnHeader34 + // + this.columnHeader34.Text = "How Long"; + this.columnHeader34.Width = 69; + // + // columnHeader35 + // + this.columnHeader35.Text = "Episode Name"; + this.columnHeader35.Width = 360; + // // UI // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1687,5 +1720,9 @@ public void InitializeComponent() private ToolStripSeparator toolStripSeparator5; private ToolStripSeparator toolStripSeparator7; private ToolStripSeparator toolStripSeparator6; + private ToolStripMenuItem collToolStripMenuItem; + private ToolStripSeparator toolStripSeparator0; + private ToolStripMenuItem aeCollToolStripMenuItem; + private ToolStripSeparator toolStripSeparator8; } } diff --git a/TVRename/Forms/UI.cs b/TVRename/Forms/UI.cs index 1daf081a0..ab5c43138 100644 --- a/TVRename/Forms/UI.cs +++ b/TVRename/Forms/UI.cs @@ -148,6 +148,13 @@ public UI(TVDoc doc, TVRenameSplash splash, bool showUi) } UpdateSplashStatus(splash, "Filling Shows"); + + if (!TVSettings.Instance.ShowCollections) + { + collToolStripMenuItem.Visible = false; + toolStripSeparator0.Visible = false; + } + FillMyShows(); UpdateSearchButtons(); ClearInfoWindows(); @@ -162,6 +169,8 @@ public UI(TVDoc doc, TVRenameSplash splash, bool showUi) UpdateSplashStatus(splash, "Setting Notifications"); ShowHideNotificationIcon(); + BuildCollectionsMenu(); + int t = TVSettings.Instance.StartupTab; if (t < tabControl1.TabCount) tabControl1.SelectedIndex = TVSettings.Instance.StartupTab; @@ -555,7 +564,9 @@ private void UI_FormClosing(object sender, FormClosingEventArgs e) MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning); if (res == DialogResult.Yes) - mDoc.WriteXMLSettings(); + { + mDoc.WriteXMLFile(FileToHandle.Settings | FileToHandle.Shows | FileToHandle.TvDB); + } else if (res == DialogResult.Cancel) e.Cancel = true; else if (res == DialogResult.No) @@ -1457,6 +1468,106 @@ private void MenuFolders(LVResults lvr) } } + private void BuildCollectionsMenu () + { + // ActualCollMenuItem + if (mDoc.ShowCollections.Count == 0) + { + // Setup a default collection when we come's from 2.4.x RCy + ShowCollection Sc = new ShowCollection("2.1"); + Sc.Name = "Default"; + Sc.Description = "Default collection in mono collection use"; + mDoc.ShowCollections.Add(Sc); + mDoc.WriteXMLFile(FileToHandle.Collections); + } + + ToolStripMenuItem[] CollMenu = new ToolStripMenuItem[mDoc.ShowCollections.Count]; + int i = 0; + foreach (ShowCollection ShowColl in mDoc.ShowCollections) + { + CollMenu[i] = new ToolStripMenuItem(); + CollMenu[i].Name = "CollectionMenuItem" + i.ToString(); + CollMenu[i].Tag = ShowColl; + CollMenu[i].Text = ShowColl.Name; + CollMenu[i].ToolTipText = ShowColl.Description; + if (ShowColl.Path == PathManager.ShowCollection) + { + CollMenu[i].Checked = true; + } + CollMenu[i].Click += new EventHandler(SelCollMenuItemClickHandler); + i++; + } + + collToolStripMenuItem.DropDownItems.AddRange(CollMenu); + } + + private void RemoveCollectionsMenu () + { + int iCount = collToolStripMenuItem.DropDownItems.Count -2; + string MenuItemName = ""; + for (int iCurr = 0; iCurr < iCount; iCurr++) + { + MenuItemName = "CollectionMenuItem" + iCurr.ToString(); + collToolStripMenuItem.DropDownItems.RemoveAt(2); + } + } + + private void SelCollMenuItemClickHandler(object sender, EventArgs e) + { + bool bNeedCancel = false; + ToolStripMenuItem clickedItem = (ToolStripMenuItem)sender; + ShowCollection SelectedCollection = (ShowCollection)clickedItem.Tag; + + try + { + if (mDoc.Dirty()) + { + DialogResult res = MessageBox.Show( + "Your changes have not been saved. Do you wish to save before changing show collection?", "Unsaved data", + MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning); + + if (res == DialogResult.Yes) + { + mDoc.WriteXMLFile(FileToHandle.Settings | FileToHandle.Shows | FileToHandle.TvDB); + } + else if (res == DialogResult.Cancel) + bNeedCancel = true; + else if (res == DialogResult.No) + { + bNeedCancel = false; + } + } + + if (!bNeedCancel) + { + ToolStripItemCollection TSMIC = collToolStripMenuItem.DropDownItems; + ToolStripMenuItem TsM; + foreach (ToolStripItem TsI in TSMIC) + { + try + { + TsM = (ToolStripMenuItem)TsI; + TsM.Checked = false; + } + catch (Exception) + { + // Just a pass thru for MenuSeparators + } + } + clickedItem.Checked = true; + + mDoc.SwitchToCollection(SelectedCollection.Path); + mDoc.WriteXMLFile(FileToHandle.Collections); + FillMyShows(); + } + } + catch (Exception ex) + { + MessageBox.Show(this, ex.Message + "\r\n\r\n" + ex.StackTrace, "Switch Show Collection", + MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + private void BuildRightClickMenu(Point pt) { showRightClickMenu.Items.Clear(); @@ -1776,6 +1887,8 @@ private void DoPrefs(bool scanOptions) ShowHideNotificationIcon(); FillWhenToWatchList(); ShowInTaskbar = TVSettings.Instance.ShowInTaskbar; + collToolStripMenuItem.Visible = (TVSettings.Instance.ShowCollections) ? true : false; + toolStripSeparator0.Visible = (TVSettings.Instance.ShowCollections) ? true : false; FillEpGuideHtml(); mAutoFolderMonitor.SettingsChanged(TVSettings.Instance.MonitorFolders); betaToolsToolStripMenuItem.Visible = TVSettings.Instance.IncludeBetaUpdates(); @@ -1790,8 +1903,7 @@ private void saveToolStripMenuItem_Click(object sender, EventArgs e) { try { - mDoc.WriteXMLSettings(); - TheTVDB.Instance.SaveCache(); + mDoc.WriteXMLFile(FileToHandle.Collections | FileToHandle.Settings | FileToHandle.Shows | FileToHandle.TvDB); if (!SaveLayoutXml()) { Logger.Error("Failed to Save Layout Configuration Files"); @@ -1848,7 +1960,7 @@ private void statusTimer_Tick(object sender, EventArgs e) if (n == 0 && lastDlRemaining > 0) { // we've just finished a bunch of background downloads - TheTVDB.Instance.SaveCache(); + mDoc.WriteXMLFile(FileToHandle.TvDB); RefreshWTW(false); backgroundDownloadNowToolStripMenuItem.Enabled = true; @@ -2190,7 +2302,7 @@ private void DeleteShow(ShowItem si) if (res != DialogResult.Yes) return; - if (Directory.Exists(si.AutoAddFolderBase)) + if ((Directory.Exists(si.AutoAddFolderBase)) && TVSettings.Instance.DeleteShowFromDisk) { DialogResult res3 = MessageBox.Show( $"Remove folder \"{si.AutoAddFolderBase}\" from disk?", @@ -3586,5 +3698,15 @@ private void exportToolStripMenuItem_Click(object sender, EventArgs e) { } + + private void aeCollToolStripMenuItem_Click(object sender, EventArgs e) + { + AddEditCollection AEC = new AddEditCollection(mDoc); + if (AEC.ShowDialog() == DialogResult.OK) + { + RemoveCollectionsMenu(); + BuildCollectionsMenu(); + } + } } } diff --git a/TVRename/Forms/UI.resx b/TVRename/Forms/UI.resx index db513d471..b4bfa1d05 100644 --- a/TVRename/Forms/UI.resx +++ b/TVRename/Forms/UI.resx @@ -120,6 +120,19 @@ 139, 17 + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1 + MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAACwwAAAsMAT9AIsgAAAE7SURBVDhPlZIhc4QwEIX5S5W1 + lUjkWWQlEotERmKRyJOxkZErYyMjI7dvEzg4kk6nmfnmuMm+717CNcxcZTGBlfYvhpUyi+V5NRjJc0Xw + QEKyfDhxIabPWQceIZK5algQgQwbd/KkyHCkZ4WGE5pUw4IIZNhiWJCQhuBoIXvdZOth4SXASRIXybaL + HiJwumVv+oJCcJNIi9TAPT/xg+WqCi6SmyBydDNQHP0CtrQpAkLo4CqRvSzYDgHCIOienfr4k7OBCGJg + rwf2W8d+bTlYlQZ+WyIIyGTBer0D9NrJRylBzVuDJJCAnP/EU8YBQiNrZzZmYiKbBN1o9te4VATpQicw + ggF8gwdHajGaBVjp/9I4le/gDN7DPcjhSF8VwYwvOFc64/4m3kWAICPIAAfzLiDVskj+g2SygJsf4FxG + MwKGJzMAAAAASUVORK5CYII= + + 17, 95 @@ -128,7 +141,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADk - HQAAAk1TRnQBSQFMAgEBEwEAAbABAwGwAQMBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + HQAAAk1TRnQBSQFMAgEBEwEAARABBAEQAQQBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAAVADAAEBAQABCAYAARQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -258,7 +271,6 @@ AgABgAEBAgABgAEBAgABwAEDAgABgAEBAgAB8AEPAgAC/wIACw== - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 @@ -274,7 +286,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC0 - HQAAAk1TRnQBSQFMAgEBCwEAAcwBAwHMAQMBEgEAAQ0BAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFI + HQAAAk1TRnQBSQFMAgEBCwEAASwBBAEsAQQBEgEAAQ0BAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFI AwABJwMAAQEBAAEYBQAB6AEgGAAD7wMSBjADCQYwAw8DKgMwAxsD0Q8AASEB1gEIASEB1gEIASEB1gEI ASEB1gEIMAAC+AH3AfMB6AHaAfEB0wG2AeEBswGMAdYBnAFxAdIBlAFoAdIBlAFnAdQBmgFvAd8BrQGG AfAB0QGzAfMB5gHVAfcB9gH1RQAD7wM8A58D5gMwA+ADzgNPA9gDtwOPA9EMAAEhAdYBCAEhAdYBCAEh @@ -712,7 +724,7 @@ 829, 56 - 112 + 81 diff --git a/TVRename/Forms/Utilities/RecoverXML.resx b/TVRename/Forms/Utilities/RecoverXML.resx index bcc03471a..bacb4057a 100644 --- a/TVRename/Forms/Utilities/RecoverXML.resx +++ b/TVRename/Forms/Utilities/RecoverXML.resx @@ -112,12 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + AAABAAIAICAQAAAABADoAgAAJgAAABAQEAAAAAQAKAEAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAAAAAC diff --git a/TVRename/Properties/AssemblyInfo.cs b/TVRename/Properties/AssemblyInfo.cs index c6f11e729..6016a5609 100644 --- a/TVRename/Properties/AssemblyInfo.cs +++ b/TVRename/Properties/AssemblyInfo.cs @@ -16,4 +16,4 @@ [assembly: AssemblyVersion("2.5.0.0")] [assembly: AssemblyFileVersion("2.5.0")] -[assembly: AssemblyInformationalVersion("2.5.0")] // Display version +[assembly: AssemblyInformationalVersion("2.5.5")] // Display version diff --git a/TVRename/Resources/openFile.png b/TVRename/Resources/openFile.png new file mode 100644 index 0000000000000000000000000000000000000000..e2dcf54594ad9d5c0996a57a4f3da87c36dde5cb GIT binary patch literal 495 zcmV(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRZ-bxA})RCwBqlc96lFc`&u-5JPCVF~n~(6I#uuCT0ug@uKq9SdC8LdOON8){~_ zu?ogaVt(u!kR8XXFSqYbC&}mc^ZTCU8#80B4s|khI`2ap^P&^0QanF=x&gqUg9qFx_}Ifg7Z=5C;D9z|1|78!~+w+1h#E197v=PAO(fn|ApLwbQX?zcm165T4~bac#P`llZ=PV1uQ__DAp8G l$gK$bd;Y(U$c;Dm?*LdL$i<^CZu9^E002ovPDHLkV1kSu+(iHY literal 0 HcmV?d00001 diff --git a/TVRename/Settings/Settings.cs b/TVRename/Settings/Settings.cs index 94845c552..9f3027161 100644 --- a/TVRename/Settings/Settings.cs +++ b/TVRename/Settings/Settings.cs @@ -77,6 +77,7 @@ public class ShowStatusColoringTypeList : Dictionary 1) + { + SeasonFolderFormat = defaultSeasonWord.Trim() + " " + (LeadingZeroOnSeason ? "{Season:2}" : "{Season}"); + } + else + { + SeasonFolderFormat = defaultSeasonWord.Trim() + (LeadingZeroOnSeason ? "{Season:2}" : "{Season}"); + } } } @@ -879,6 +893,8 @@ public void WriteXML(XmlWriter writer) TheSearchers.WriteXML(writer); XmlHelper.WriteElementToXml(writer,"BGDownload",BGDownload); XmlHelper.WriteElementToXml(writer,"OfflineMode",OfflineMode); + XmlHelper.WriteElementToXml(writer,"ShowCollections", ShowCollections); + XmlHelper.WriteElementToXml(writer, "DeleteShowFromDisk", DeleteShowFromDisk); writer.WriteStartElement("Replacements"); foreach (Replacement R in Replacements) { diff --git a/TVRename/TVRename.csproj b/TVRename/TVRename.csproj index e881cb4b9..8dfcb7e63 100644 --- a/TVRename/TVRename.csproj +++ b/TVRename/TVRename.csproj @@ -132,6 +132,12 @@ + + Form + + + AddEditCollection.cs + Form @@ -212,6 +218,7 @@ + @@ -390,6 +397,9 @@ + + AddEditCollection.cs + ActorsGrid.cs Designer diff --git a/TVRename/TVRename.csproj.user b/TVRename/TVRename.csproj.user new file mode 100644 index 000000000..d14eb3bf7 --- /dev/null +++ b/TVRename/TVRename.csproj.user @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/TVRename/TVRename/PathManager.cs b/TVRename/TVRename/PathManager.cs index 600b46a04..8a8154d68 100644 --- a/TVRename/TVRename/PathManager.cs +++ b/TVRename/TVRename/PathManager.cs @@ -10,13 +10,18 @@ public static class PathManager private const string SETTINGS_FILE_NAME = "TVRenameSettings.xml"; private const string UI_LAYOUT_FILE_NAME = "Layout.xml"; private const string STATISTICS_FILE_NAME = "Statistics.xml"; + private const string SHOWS_FILE_NAME = "TVRenameShows.xml"; + private const string SHOWS_COLLECTION_FILE_NAME = "TVRenameColls.xml"; + private const string SHOWS_DEFAULT_COLLECTION = "2.1"; private static string UserDefinedBasePath; + private static string SHOWS_COLLECTION = ""; public static FileInfo[] GetPossibleSettingsHistory() { return new DirectoryInfo(System.IO.Path.GetDirectoryName(TVDocSettingsFile.FullName)).GetFiles(SETTINGS_FILE_NAME + "*"); } + public static FileInfo[] GetPossibleTvdbHistory() { return new DirectoryInfo(System.IO.Path.GetDirectoryName(TVDocSettingsFile.FullName)).GetFiles(TVDB_FILE_NAME + "*"); @@ -48,6 +53,40 @@ private static FileInfo GetFileInfo(string path, string file) return new FileInfo(System.IO.Path.Combine(path, file)); } + public static string ShowCollection + { + get + { + return SHOWS_COLLECTION; + } + set + { + if (value != SHOWS_DEFAULT_COLLECTION) + { + SHOWS_COLLECTION = value; + } + else + { + SHOWS_COLLECTION = ""; + } + } + } + + public static FileInfo ShowCollectionFile + { + get + { + if (!string.IsNullOrEmpty(UserDefinedBasePath)) + { + return GetFileInfo(UserDefinedBasePath, SHOWS_COLLECTION_FILE_NAME); + } + else + { + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename"), SHOWS_COLLECTION_FILE_NAME); + } + } + } + public static FileInfo StatisticsFile { get @@ -58,7 +97,7 @@ public static FileInfo StatisticsFile } else { - return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", "2.1"), STATISTICS_FILE_NAME); + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? SHOWS_COLLECTION : SHOWS_DEFAULT_COLLECTION)), STATISTICS_FILE_NAME); } } } @@ -74,7 +113,7 @@ public static FileInfo UILayoutFile } else { - return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", "2.1"), UI_LAYOUT_FILE_NAME); + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? "" : SHOWS_DEFAULT_COLLECTION)), UI_LAYOUT_FILE_NAME); } } } @@ -90,7 +129,7 @@ public static FileInfo TVDBFile } else { - return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", "2.1"), TVDB_FILE_NAME); + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? SHOWS_COLLECTION : SHOWS_DEFAULT_COLLECTION)), TVDB_FILE_NAME); } } } @@ -106,10 +145,24 @@ public static FileInfo TVDocSettingsFile } else { - return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", "2.1"), SETTINGS_FILE_NAME); + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? "" : SHOWS_DEFAULT_COLLECTION)), SETTINGS_FILE_NAME); } } } + public static FileInfo TVDocShowsFile + { + get + { + if (!string.IsNullOrEmpty(UserDefinedBasePath)) + { + return GetFileInfo(UserDefinedBasePath, SHOWS_FILE_NAME); + } + else + { + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? SHOWS_COLLECTION : SHOWS_DEFAULT_COLLECTION)), (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? SHOWS_FILE_NAME : SETTINGS_FILE_NAME)); + } + } + } } } diff --git a/TVRename/TVRename/ShowCollection.cs b/TVRename/TVRename/ShowCollection.cs new file mode 100644 index 000000000..0dcbd51f9 --- /dev/null +++ b/TVRename/TVRename/ShowCollection.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using Alphaleonis.Win32.Filesystem; +using System.Text.RegularExpressions; +using System.Threading; +using System.Windows.Forms; +using System.Linq; +using System.Xml; +using Directory = Alphaleonis.Win32.Filesystem.Directory; +using DirectoryInfo = Alphaleonis.Win32.Filesystem.DirectoryInfo; +using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; +using System.Text; +using NodaTime.Extensions; + +namespace TVRename +{ + public class ShowCollection + { + public string Path { get; set; } + public string Name { get; set; } + public string Description { get; set; } + + public ShowCollection (string Pa) + { + Path = Pa; + } + + public ShowCollection (XmlReader reader) + { + LoadXMLCollectionItem(reader); + } + + public void WriteXMLCollectionItem (XmlWriter writer) + { + writer.WriteStartElement("CollectionItem"); + XmlHelper.WriteElementToXml(writer, "Path", Path); + XmlHelper.WriteElementToXml(writer, "Name", Name); + XmlHelper.WriteElementToXml(writer, "Description", Description); + writer.WriteEndElement(); + } + + private void LoadXMLCollectionItem (XmlReader reader) + { + reader.Read(); + while (!reader.EOF) + { + if ((reader.Name == "CollectionItem") && (!reader.IsStartElement())) + { + break; + } + + if (reader.Name == "Path") + { + Path = reader.ReadElementContentAsString(); + } + if (reader.Name == "Name") + { + Name = reader.ReadElementContentAsString(); + } + if (reader.Name == "Description") + { + Description = reader.ReadElementContentAsString(); + } + else + { + reader.ReadOuterXml(); + } + } + } + } +} diff --git a/TVRename/TVRename/TVDoc.cs b/TVRename/TVRename/TVDoc.cs index 929edf899..5110aa320 100644 --- a/TVRename/TVRename/TVDoc.cs +++ b/TVRename/TVRename/TVDoc.cs @@ -26,9 +26,18 @@ namespace TVRename { + public enum FileToHandle + { + Collections = 1, + Settings = 2, + Shows = 4, + TvDB = 8 + } + // ReSharper disable once InconsistentNaming public class TVDoc : IDisposable { + public readonly List ShowCollections; private readonly DownloadIdentifiersController downloadIdentifiers; private readonly List finders; public readonly ShowLibrary Library; @@ -49,21 +58,22 @@ public class TVDoc : IDisposable private bool currentlyBusy = false; // This is set to true when scanning and indicates to other objects not to commence a scan of their own private DateTime busySince; - public TVDoc(FileInfo settingsFile, CommandLineArgs args) + public TVDoc(CommandLineArgs args) { Args = args; - Library = new ShowLibrary(); - mStats = new TVRenameStats(); - actionManager = new ActionEngine(mStats); - cacheManager = new CacheUpdater(); + ShowCollections = new List(); + Library = new ShowLibrary(); + mStats = new TVRenameStats(); + actionManager = new ActionEngine(mStats); + cacheManager = new CacheUpdater(); - mDirty = false; - TheActionList = new ItemList(); + mDirty = false; + TheActionList = new ItemList(); - actionCancel = false; + actionCancel = false; - scanProgDlg = null; + scanProgDlg = null; finders = new List //These should be in order { @@ -75,8 +85,23 @@ public TVDoc(FileInfo settingsFile, CommandLineArgs args) }; downloadIdentifiers = new DownloadIdentifiersController(); + LoadOk = LoadXMLFile(FileToHandle.Collections, true); - LoadOk = ((settingsFile == null) || LoadXMLSettings(settingsFile)) && TheTVDB.Instance.LoadOk; + if (LoadOk) + { + LoadOk = LoadXMLFile(FileToHandle.TvDB | FileToHandle.Settings | FileToHandle.Shows, true); + } + } + + public void SwitchToCollection (string Collection) + { + PathManager.ShowCollection = Collection; + Library.Clear(); + TheActionList.Clear(); + + TheTVDB.Instance.ClearCache(); + + LoadXMLFile(FileToHandle.TvDB | FileToHandle.Settings | FileToHandle.Shows, false); } public TVRenameStats Stats() @@ -243,28 +268,88 @@ private static List FindEpOnDisk(DirFilesCache dfc, ShowItem si, Episo return ret; } - // ReSharper disable once InconsistentNaming - public void WriteXMLSettings() + public void WriteXMLFile (FileToHandle Files) { - // backup old settings before writing new ones - FileHelper.Rotate(PathManager.TVDocSettingsFile.FullName); - Logger.Info("Saving Settings to {0}", PathManager.TVDocSettingsFile.FullName); - XmlWriterSettings settings = new XmlWriterSettings { Indent = true, NewLineOnAttributes = true }; - using (XmlWriter writer = XmlWriter.Create(PathManager.TVDocSettingsFile.FullName, settings)) + if ((Files & FileToHandle.Collections) > 0) { - writer.WriteStartDocument(); - writer.WriteStartElement("TVRename"); + FileHelper.Rotate(PathManager.ShowCollectionFile.FullName); + Logger.Info("Saving Collections to {0}", PathManager.ShowCollectionFile.FullName); + XmlWriter writer = XmlWriter.Create(PathManager.ShowCollectionFile.FullName, settings); + WriteXMLCollections(writer); + } + if ((Files & FileToHandle.Settings) > 0) + { + FileHelper.Rotate(PathManager.TVDocSettingsFile.FullName); + Logger.Info("Saving Settings to {0}", PathManager.TVDocSettingsFile.FullName); + XmlWriter writer = XmlWriter.Create(PathManager.TVDocSettingsFile.FullName, settings); + WriteXMLSettings(writer); + } + if (((Files & FileToHandle.Shows) > 0) && (!string.IsNullOrEmpty(PathManager.ShowCollection))) + { + FileHelper.Rotate(PathManager.TVDocShowsFile.FullName); + Logger.Info("Saving Shows to {0}", PathManager.TVDocShowsFile.FullName); + XmlWriter writer = XmlWriter.Create(PathManager.TVDocShowsFile.FullName, settings); + WriteXMLHeader(writer); + WriteXMLShows(writer); + } + + if ((Files & FileToHandle.TvDB) > 0) + { + TheTVDB.Instance.SaveCache(); + } + } + + private void WriteXMLCollections(XmlWriter writer) + { + using (writer) + { + WriteXMLHeader(writer); + + writer.WriteStartElement("Collections"); + foreach (ShowCollection sc in ShowCollections) + { + sc.WriteXMLCollectionItem(writer); + } - XmlHelper.WriteAttributeToXml(writer, "Version", "2.1"); + writer.WriteEndElement(); // Collections + XmlHelper.WriteElementToXml(writer, "Current", (PathManager.ShowCollection == "" ? "2.1" : PathManager.ShowCollection)); + + WriteXMLFooter(writer); + } + } + + // ReSharper disable once InconsistentNaming + private void WriteXMLSettings(XmlWriter writer) + { + using (writer) + { + WriteXMLHeader(writer); TVSettings.Instance.WriteXML(writer); // + if (string.IsNullOrEmpty(PathManager.ShowCollection)) + { + WriteXMLShows(writer); + } + else + { + WriteXMLFooter(writer); + } + } + + mDirty = false; + } + + private void WriteXMLShows(XmlWriter writer) + { + using (writer) + { writer.WriteStartElement("MyShows"); foreach (ShowItem si in Library.Values) si.WriteXmlSettings(writer); @@ -273,10 +358,8 @@ public void WriteXMLSettings() XmlHelper.WriteStringsToXml(TVSettings.Instance.LibraryFolders, writer, "MonitorFolders", "Folder"); XmlHelper.WriteStringsToXml(TVSettings.Instance.IgnoreFolders, writer, "IgnoreFolders", "Folder"); - XmlHelper.WriteStringsToXml(TVSettings.Instance.DownloadFolders, writer, "FinderSearchFolders", - "Folder"); - XmlHelper.WriteStringsToXml(TVSettings.Instance.IgnoredAutoAddHints, writer, "IgnoredAutoAddHints", - "Hint"); + XmlHelper.WriteStringsToXml(TVSettings.Instance.DownloadFolders, writer, "FinderSearchFolders", "Folder"); + XmlHelper.WriteStringsToXml(TVSettings.Instance.IgnoredAutoAddHints, writer, "IgnoredAutoAddHints", "Hint"); writer.WriteStartElement("IgnoreItems"); foreach (IgnoreItem ii in TVSettings.Instance.Ignore) @@ -284,118 +367,377 @@ public void WriteXMLSettings() writer.WriteEndElement(); // IgnoreItems - writer.WriteEndElement(); // tvrename - writer.WriteEndDocument(); + WriteXMLFooter(writer); } mDirty = false; Stats().Save(); } - // ReSharper disable once InconsistentNaming - private bool LoadXMLSettings(FileInfo from) + private static void WriteXMLHeader(XmlWriter writer) { - Logger.Info("Loading Settings from {0}", from?.FullName); - if (from == null) - return true; + writer.WriteStartDocument(); + writer.WriteStartElement("TVRename"); - try + XmlHelper.WriteAttributeToXml(writer, "Version", "2.1"); + } + + private static void WriteXMLFooter(XmlWriter writer) + { + writer.WriteEndElement(); // tvrename + writer.WriteEndDocument(); + } + + private bool LoadXMLFile (FileToHandle Files, bool bInit) + { + bool bLoadOk = false; + XmlReaderSettings settings = new XmlReaderSettings { - XmlReaderSettings settings = new XmlReaderSettings + IgnoreComments = true, + IgnoreWhitespace = true + }; + + if ((Files & FileToHandle.Collections) > 0) + { + bLoadOk = ReadXMLCollections(settings, ShowCollections, LoadErr); + } + if ((Files & FileToHandle.TvDB) > 0) + { + bLoadOk = ReadXMLTvDBCache(bInit, Args); + } + if ((Files & FileToHandle.Settings) > 0) + { + bLoadOk = ReadXMLSettings(settings, LoadErr); + } + if ((Files & FileToHandle.Shows) > 0) + { + bLoadOk = ReadXMLShows(settings, Library, mStats, LoadErr); + } + + return bLoadOk; + } + + private static bool ReadXMLCollections(XmlReaderSettings settings, List lSc, string Err) + { + bool bLoadOk; + FileInfo showColls = PathManager.ShowCollectionFile; + Logger.Info("Loading Collections from {0}", showColls.FullName); + if (showColls == null) + { + bLoadOk = true; + } + else + { + try { - IgnoreComments = true, - IgnoreWhitespace = true - }; + XmlReader reader = XmlReader.Create(showColls.FullName, settings); + bLoadOk = LoadXMLCollections(reader, showColls, lSc, Err); + } + catch (Exception e) + { + if (!showColls.Exists) + { + bLoadOk = true; + } + else + { + Logger.Warn(e, "Problem on Startup loading Collection File"); + Err = showColls.Name + " : " + e.Message; + bLoadOk = false; + } + } + } + return bLoadOk; + } - if (!from.Exists) + private static bool ReadXMLTvDBCache (bool bInit, CommandLineArgs args) + { + bool bLoadOk; + FileInfo tvdbFile = PathManager.TVDBFile; + if (tvdbFile == null) + { + bLoadOk = true; + } + else + { + if (bInit) { - return true; // that's ok + TheTVDB.Instance.Setup(tvdbFile, PathManager.TVDBFile, args); } + else + { + TheTVDB.Instance.RelaodCache(tvdbFile, PathManager.TVDBFile); + } + bLoadOk = TheTVDB.Instance.LoadOk; + } + return bLoadOk; + } - using (XmlReader reader = XmlReader.Create(from.FullName, settings)) + private static bool LoadXMLCollections(XmlReader reader, FileInfo from, List lSc, string Err) + { + using (reader) + { + bool bGoodHeader = ReadXmlHeaderFromFile(reader, from, "Collections", Err); + if (bGoodHeader) { - reader.Read(); - if (reader.Name != "xml") + while (!reader.EOF) { - LoadErr = from.Name + " : Not a valid XML file"; - return false; + if (reader.Name == "TVRename" && !reader.IsStartElement()) + { + break; // end of it all + } + + if (reader.Name == "Collections") + { + LoadXMLEveryCollection(reader, lSc); + } + else if (reader.Name == "Current") + { + PathManager.ShowCollection = reader.ReadElementContentAsString(); + } + else + { + reader.ReadOuterXml(); + } + reader.Read(); } + } + } + + return true; + } + + private static void LoadXMLEveryCollection (XmlReader reader, List Lsc) + { + while (!reader.EOF) + { + reader.Read(); - reader.Read(); + if ((reader.Name == "Collections") && (!reader.IsStartElement())) + { + break; + } - if (reader.Name != "TVRename") + if (reader.Name == "CollectionItem") + { + ShowCollection Collection = new ShowCollection(reader); + + Lsc.Add(Collection); + } + else + { + reader.ReadOuterXml(); + } + } + } + + private static bool ReadXMLSettings(XmlReaderSettings settings, string Err) + { + bool bLoadOk; + + FileInfo settingsFile = PathManager.TVDocSettingsFile; + Logger.Info("Loading Settings from {0}", settingsFile.FullName); + if (settingsFile == null) + { + bLoadOk = true; + } + else + { + try + { + XmlReader reader = XmlReader.Create(settingsFile.FullName, settings); + bLoadOk = LoadXMLSettings(reader, settingsFile, Err); + } + catch (Exception e) + { + if (!settingsFile.Exists) { - LoadErr = from.Name + " : Not a TVRename settings file"; - return false; + bLoadOk = true; } - - if (reader.GetAttribute("Version") != "2.1") + else { - LoadErr = from.Name + " : Incompatible version"; - return false; + Logger.Warn(e, "Problem on Startup loading Settings File"); + Err = settingsFile.Name + " : " + e.Message; + bLoadOk = false; } + } + } + return bLoadOk; + } - reader.Read(); // move forward one - + // ReSharper disable once InconsistentNaming + private static bool LoadXMLSettings(XmlReader reader, FileInfo from, string Err) + { + using (reader) + { + bool bGoodHeader = ReadXmlHeaderFromFile(reader, from, "Settings", Err); + if (bGoodHeader) + { while (!reader.EOF) { if (reader.Name == "TVRename" && !reader.IsStartElement()) + { break; // end of it all + } if (reader.Name == "Settings") { TVSettings.Instance.load(reader.ReadSubtree()); reader.Read(); } - else if (reader.Name == "MyShows") + else { - Library.LoadFromXml(reader.ReadSubtree()); - reader.Read(); + reader.ReadOuterXml(); } - else if (reader.Name == "MonitorFolders") - TVSettings.Instance.LibraryFolders = - XmlHelper.ReadStringsFromXml(reader, "MonitorFolders", "Folder"); - else if (reader.Name == "IgnoreFolders") - TVSettings.Instance.IgnoreFolders = - XmlHelper.ReadStringsFromXml(reader, "IgnoreFolders", "Folder"); - else if (reader.Name == "FinderSearchFolders") - TVSettings.Instance.DownloadFolders = - XmlHelper.ReadStringsFromXml(reader, "FinderSearchFolders", "Folder"); - else if (reader.Name == "IgnoredAutoAddHints") - TVSettings.Instance.IgnoredAutoAddHints = - XmlHelper.ReadStringsFromXml(reader, "IgnoredAutoAddHints", "Hint"); - else if (reader.Name == "IgnoreItems") + } + } + } + return true; + } + + private static bool ReadXMLShows(XmlReaderSettings settings, ShowLibrary Sl, TVRenameStats St, string Err) + { + bool bLoadOk; + FileInfo showsFile = PathManager.TVDocShowsFile; + Logger.Info("Loading Shows from {0}", showsFile.FullName); + if (showsFile == null) + { + bLoadOk = true; + } + else + { + try + { + XmlReader reader = XmlReader.Create(showsFile.FullName, settings); + bLoadOk = LoadXMLSHows(reader, showsFile, Sl, Err); + try + { + St = TVRenameStats.Load(); + } + catch (Exception) + { + // not worried if stats loading fails + } + } + catch (Exception e) + { + if (!showsFile.Exists) + { + bLoadOk = true; + } + else + { + Logger.Warn(e, "Problem on Startup loading Shows File"); + Err = showsFile.Name + " : " + e.Message; + bLoadOk = false; + } + } + } + return bLoadOk; + } + + private static bool LoadXMLSHows(XmlReader reader, FileInfo from, ShowLibrary Sl, string Err) + { + using (reader) + { + bool bGoodHeader = ReadXmlHeaderFromFile(reader, from, "Shows", Err); + if (bGoodHeader) + { + while (!reader.EOF) + { + if (reader.Name == "TVRename" && !reader.IsStartElement()) { - XmlReader r2 = reader.ReadSubtree(); - r2.Read(); - r2.Read(); - while (r2.Name == "Ignore") - TVSettings.Instance.Ignore.Add(new IgnoreItem(r2)); + break; // end of it all + } + if (reader.Name == "MyShows") + { + Sl.LoadFromXml(reader.ReadSubtree()); reader.Read(); } - else - reader.ReadOuterXml(); + LoadXMLShowFolderStuff(reader); } } } - catch (Exception e) + + return true; + } + + private static void LoadXMLShowFolderStuff(XmlReader reader) + { + if (reader.Name == "MonitorFolders") { - Logger.Warn(e, "Problem on Startup loading File"); - LoadErr = from.Name + " : " + e.Message; - return false; + TVSettings.Instance.LibraryFolders = + XmlHelper.ReadStringsFromXml(reader, "MonitorFolders", "Folder"); } + else if (reader.Name == "IgnoreFolders") + { + TVSettings.Instance.IgnoreFolders = + XmlHelper.ReadStringsFromXml(reader, "IgnoreFolders", "Folder"); + } + else if (reader.Name == "FinderSearchFolders") + { + TVSettings.Instance.DownloadFolders = + XmlHelper.ReadStringsFromXml(reader, "FinderSearchFolders", "Folder"); + } + else if (reader.Name == "IgnoredAutoAddHints") + { + TVSettings.Instance.IgnoredAutoAddHints = + XmlHelper.ReadStringsFromXml(reader, "IgnoredAutoAddHints", "Hint"); + } + else if (reader.Name == "IgnoreItems") + { + XmlReader r2 = reader.ReadSubtree(); + r2.Read(); + r2.Read(); + while (r2.Name == "Ignore") + { + TVSettings.Instance.Ignore.Add(new IgnoreItem(r2)); + } - try + reader.Read(); + } + else + { + reader.ReadOuterXml(); + } + } + + private static bool ReadXmlHeaderFromFile (XmlReader reader, FileInfo from, string contains, string Err) + { + bool bIsValidHeader; + + reader.Read(); + if (reader.Name != "xml") { - mStats = TVRenameStats.Load(); + Err = from.Name + " : Not a valid XML file"; + bIsValidHeader = false; } - catch (Exception) + else { - // not worried if stats loading fails + reader.Read(); + if (reader.Name != "TVRename") + { + Err = from.Name + " : Not a TVRename " + contains + " file"; + bIsValidHeader = false; + } + else + { + if (reader.GetAttribute("Version") != "2.1") + { + Err = from.Name + " : Incompatible version"; + bIsValidHeader = false; + } + else + { + reader.Read(); // move forward one + Err = ""; + bIsValidHeader = true; + } + } } - return true; + return bIsValidHeader; } private void OutputActionFiles(TVSettings.ScanType st) diff --git a/TVRename/TheTVDB/Episode.cs b/TVRename/TheTVDB/Episode.cs index 9cc92d71c..2bc62d15f 100644 --- a/TVRename/TheTVDB/Episode.cs +++ b/TVRename/TheTVDB/Episode.cs @@ -362,9 +362,9 @@ private void LoadJson(int seriesId, JObject r) else if (!int.TryParse(dvdEpNumString, out DvdEpNum)) DvdEpNum = 0; SrvLastUpdated = (long) r["lastUpdated"]; - Overview = System.Web.HttpUtility.HtmlDecode((string)r["overview"]); + Overview = System.Web.HttpUtility.HtmlDecode((string) r["overview"]); EpisodeRating = (string) r["siteRating"]; - Name = System.Web.HttpUtility.HtmlDecode((string)r["episodeName"]); + Name = System.Web.HttpUtility.HtmlDecode((string) r["episodeName"]); string sn = (string) r["airedSeason"]; if (sn == null) diff --git a/TVRename/TheTVDB/SeriesInfo.cs b/TVRename/TheTVDB/SeriesInfo.cs index 708044b75..ea8b9743a 100644 --- a/TVRename/TheTVDB/SeriesInfo.cs +++ b/TVRename/TheTVDB/SeriesInfo.cs @@ -441,7 +441,7 @@ private void LoadJson(JObject bestLanguageR, JObject backupLanguageR) Items["overview"] = System.Web.HttpUtility.HtmlDecode(Items["overview"]); //Looking at the data then the aliases, banner and runtime are also different by language - + if ((string.IsNullOrWhiteSpace(Items["aliases"]))) { Items["aliases"] = JsonHelper.Flatten(backupLanguageR["aliases"], "|"); diff --git a/TVRename/TheTVDB/TheTVDB.cs b/TVRename/TheTVDB/TheTVDB.cs index 964b6de7f..9043b22d4 100644 --- a/TVRename/TheTVDB/TheTVDB.cs +++ b/TVRename/TheTVDB/TheTVDB.cs @@ -219,6 +219,42 @@ private bool LoadCache(FileInfo loadFrom) } } + public void RelaodCache(FileInfo loadFrom, FileInfo cache) + { + System.Diagnostics.Debug.Assert(cache != null); + cacheFile = cache; + + LastError = ""; + Connected = false; + extraEpisodes.Clear(); + removeEpisodeIds.Clear(); + + LanguageList = new List { new Language(7, "en", "English", "English") }; + + //assume that the data is up to date (this will be overridden by the value in the XML if we have a prior install) + //If we have no prior install then the app has no shows and is by definition up-to-date + newSrvTime = DateTime.UtcNow.ToUnixTime(); + + srvTime = 0; + + LoadOk = (loadFrom == null) || LoadCache(loadFrom); + + forceReloadOn.Clear(); + } + + public void ClearCache() + { + if (!GetLock("ClearCache")) + return; + + series.Clear(); + extraEpisodes.Clear(); + removeEpisodeIds.Clear(); + Unlock("ClearCache"); + + newSrvTime = DateTime.UtcNow.ToUnixTime(); + } + public void UpdatesDoneOk() { // call when all downloading and updating is done. updates local Srv_Time with the tentative @@ -426,7 +462,7 @@ public byte[] GetTvdbDownload(string url, bool forceReload = false) } } - public void ForgetEverything() + public void ForgetEverything() { if (!GetLock("ForgetEverything")) return; From 5144dfe28921b0ef8d825eea7b522d4ce57b4485 Mon Sep 17 00:00:00 2001 From: Chlorel Date: Sun, 7 Oct 2018 11:25:00 +0200 Subject: [PATCH 02/12] Revert "Merge branch 'coll-showcollection' into master" This reverts commit b1fd7fa1de640f4ec6eb8971349a058db68b124d, reversing changes made to a3c5a00c87432b6e82efcf0bdd9c8e3fe803fa1f. --- TVRename/App/ApplicationBase.cs | 39 +- .../Collection/AddEditCollection.Designer.cs | 266 --------- .../Forms/Collection/AddEditCollection.cs | 228 -------- .../Forms/Collection/AddEditCollection.resx | 213 -------- .../Forms/Preferences/Preferences.Designer.cs | 72 +-- TVRename/Forms/Preferences/Preferences.cs | 4 - TVRename/Forms/UI.Designer.cs | 487 ++++++++--------- TVRename/Forms/UI.cs | 132 +---- TVRename/Forms/UI.resx | 20 +- TVRename/Forms/Utilities/RecoverXML.resx | 6 +- TVRename/Properties/AssemblyInfo.cs | 4 +- TVRename/Resources/openFile.png | Bin 495 -> 0 bytes TVRename/Settings/Settings.cs | 24 +- TVRename/TVRename.csproj | 10 - TVRename/TVRename.csproj.user | 7 - TVRename/TVRename/PathManager.cs | 61 +-- TVRename/TVRename/ShowCollection.cs | 72 --- TVRename/TVRename/TVDoc.cs | 512 +++--------------- TVRename/TheTVDB/Episode.cs | 4 +- TVRename/TheTVDB/SeriesInfo.cs | 2 +- TVRename/TheTVDB/TheTVDB.cs | 38 +- 21 files changed, 378 insertions(+), 1823 deletions(-) delete mode 100644 TVRename/Forms/Collection/AddEditCollection.Designer.cs delete mode 100644 TVRename/Forms/Collection/AddEditCollection.cs delete mode 100644 TVRename/Forms/Collection/AddEditCollection.resx delete mode 100644 TVRename/Resources/openFile.png delete mode 100644 TVRename/TVRename.csproj.user delete mode 100644 TVRename/TVRename/ShowCollection.cs diff --git a/TVRename/App/ApplicationBase.cs b/TVRename/App/ApplicationBase.cs index 85e9a1e98..304b1c625 100644 --- a/TVRename/App/ApplicationBase.cs +++ b/TVRename/App/ApplicationBase.cs @@ -54,8 +54,6 @@ protected override void OnCreateMainForm() recoverText = "Recover manually requested."; } - PathManager.ShowCollection = ""; - // Check arguments for custom settings path if (!string.IsNullOrEmpty(clargs.UserFilePath)) { @@ -73,26 +71,12 @@ protected override void OnCreateMainForm() } } + FileInfo tvdbFile = PathManager.TVDBFile; + FileInfo settingsFile = PathManager.TVDocSettingsFile; TVDoc doc; do // Loop until files correctly load { - // Try loading settings file - doc = new TVDoc(clargs); - - FileInfo tvdbFile = PathManager.TVDBFile; - FileInfo showsFile = PathManager.TVDocShowsFile; - - if (recover) doc.SetDirty(); - recover = !doc.LoadOk; - - // Continue if correctly loaded - if (!recover) continue; - - // Set recover message - recoverText = string.Empty; - if (!doc.LoadOk && !string.IsNullOrEmpty(doc.LoadErr)) recoverText = doc.LoadErr; - if (!TheTVDB.Instance.LoadOk && !string.IsNullOrEmpty(TheTVDB.Instance.LoadErr)) recoverText += $"{Environment.NewLine}{TheTVDB.Instance.LoadErr}"; if (recover) // Recovery required, prompt user { RecoverXML recoveryForm = new RecoverXML(recoverText); @@ -100,7 +84,7 @@ protected override void OnCreateMainForm() if (recoveryForm.ShowDialog() == DialogResult.OK) { tvdbFile = recoveryForm.DbFile; - showsFile = recoveryForm.SettingsFile; + settingsFile = recoveryForm.SettingsFile; } else { @@ -108,6 +92,23 @@ protected override void OnCreateMainForm() return; } } + + // Try loading TheTVDB cache file + TheTVDB.Instance.Setup(tvdbFile, PathManager.TVDBFile, clargs); + + // Try loading settings file + doc = new TVDoc(settingsFile, clargs); + + if (recover) doc.SetDirty(); + recover = !doc.LoadOk; + + // Continue if correctly loaded + if (!recover) continue; + + // Set recover message + recoverText = string.Empty; + if (!doc.LoadOk && !string.IsNullOrEmpty(doc.LoadErr)) recoverText = doc.LoadErr; + if (!TheTVDB.Instance.LoadOk && !string.IsNullOrEmpty(TheTVDB.Instance.LoadErr)) recoverText += $"{Environment.NewLine}{TheTVDB.Instance.LoadErr}"; } while (recover); ConvertSeriesTimeZones(doc, TheTVDB.Instance); diff --git a/TVRename/Forms/Collection/AddEditCollection.Designer.cs b/TVRename/Forms/Collection/AddEditCollection.Designer.cs deleted file mode 100644 index 4c2f1c0a2..000000000 --- a/TVRename/Forms/Collection/AddEditCollection.Designer.cs +++ /dev/null @@ -1,266 +0,0 @@ -namespace TVRename -{ - partial class AddEditCollection - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddEditCollection)); - this.TvColl = new System.Windows.Forms.TreeView(); - this.TxtCollPath = new System.Windows.Forms.TextBox(); - this.TxtCollName = new System.Windows.Forms.TextBox(); - this.TxtCollDesc = new System.Windows.Forms.TextBox(); - this.LblFolder = new System.Windows.Forms.Label(); - this.LblCollName = new System.Windows.Forms.Label(); - this.LblCollDesc = new System.Windows.Forms.Label(); - this.PnlCollAddUpdate = new System.Windows.Forms.Panel(); - this.BtCancel = new System.Windows.Forms.Button(); - this.BtSave = new System.Windows.Forms.Button(); - this.BtOk = new System.Windows.Forms.Button(); - this.BtUp = new System.Windows.Forms.Button(); - this.ImgList = new System.Windows.Forms.ImageList(this.components); - this.BtEdit = new System.Windows.Forms.Button(); - this.BtDel = new System.Windows.Forms.Button(); - this.BtDown = new System.Windows.Forms.Button(); - this.BtAdd = new System.Windows.Forms.Button(); - this.PnlCollAddUpdate.SuspendLayout(); - this.SuspendLayout(); - // - // TvColl - // - this.TvColl.Location = new System.Drawing.Point(12, 12); - this.TvColl.Name = "TvColl"; - this.TvColl.ShowNodeToolTips = true; - this.TvColl.Size = new System.Drawing.Size(152, 142); - this.TvColl.TabIndex = 0; - this.TvColl.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.TvColl_AfterSelect); - // - // TxtCollPath - // - this.TxtCollPath.Location = new System.Drawing.Point(76, 6); - this.TxtCollPath.Name = "TxtCollPath"; - this.TxtCollPath.Size = new System.Drawing.Size(100, 20); - this.TxtCollPath.TabIndex = 7; - // - // TxtCollName - // - this.TxtCollName.Location = new System.Drawing.Point(76, 32); - this.TxtCollName.Name = "TxtCollName"; - this.TxtCollName.Size = new System.Drawing.Size(100, 20); - this.TxtCollName.TabIndex = 9; - // - // TxtCollDesc - // - this.TxtCollDesc.Location = new System.Drawing.Point(76, 58); - this.TxtCollDesc.Multiline = true; - this.TxtCollDesc.Name = "TxtCollDesc"; - this.TxtCollDesc.Size = new System.Drawing.Size(158, 55); - this.TxtCollDesc.TabIndex = 11; - // - // LblFolder - // - this.LblFolder.Location = new System.Drawing.Point(5, 6); - this.LblFolder.Name = "LblFolder"; - this.LblFolder.Size = new System.Drawing.Size(65, 20); - this.LblFolder.TabIndex = 6; - this.LblFolder.Text = "Folder"; - this.LblFolder.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // LblCollName - // - this.LblCollName.Location = new System.Drawing.Point(5, 32); - this.LblCollName.Name = "LblCollName"; - this.LblCollName.Size = new System.Drawing.Size(65, 20); - this.LblCollName.TabIndex = 8; - this.LblCollName.Text = "Name"; - this.LblCollName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // LblCollDesc - // - this.LblCollDesc.Location = new System.Drawing.Point(5, 58); - this.LblCollDesc.Name = "LblCollDesc"; - this.LblCollDesc.Size = new System.Drawing.Size(65, 20); - this.LblCollDesc.TabIndex = 10; - this.LblCollDesc.Text = "Description"; - this.LblCollDesc.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // PnlCollAddUpdate - // - this.PnlCollAddUpdate.Controls.Add(this.BtCancel); - this.PnlCollAddUpdate.Controls.Add(this.BtSave); - this.PnlCollAddUpdate.Controls.Add(this.TxtCollDesc); - this.PnlCollAddUpdate.Controls.Add(this.LblCollDesc); - this.PnlCollAddUpdate.Controls.Add(this.TxtCollPath); - this.PnlCollAddUpdate.Controls.Add(this.LblCollName); - this.PnlCollAddUpdate.Controls.Add(this.TxtCollName); - this.PnlCollAddUpdate.Controls.Add(this.LblFolder); - this.PnlCollAddUpdate.Location = new System.Drawing.Point(200, 12); - this.PnlCollAddUpdate.Name = "PnlCollAddUpdate"; - this.PnlCollAddUpdate.Size = new System.Drawing.Size(241, 145); - this.PnlCollAddUpdate.TabIndex = 5; - // - // BtCancel - // - this.BtCancel.Location = new System.Drawing.Point(76, 119); - this.BtCancel.Name = "BtCancel"; - this.BtCancel.Size = new System.Drawing.Size(75, 23); - this.BtCancel.TabIndex = 12; - this.BtCancel.Text = "Cancel"; - this.BtCancel.UseVisualStyleBackColor = true; - this.BtCancel.Click += new System.EventHandler(this.BtCancel_Click); - // - // BtSave - // - this.BtSave.Location = new System.Drawing.Point(159, 119); - this.BtSave.Name = "BtSave"; - this.BtSave.Size = new System.Drawing.Size(75, 23); - this.BtSave.TabIndex = 13; - this.BtSave.Text = "Save"; - this.BtSave.UseVisualStyleBackColor = true; - this.BtSave.Click += new System.EventHandler(this.BtSave_Click); - // - // BtOk - // - this.BtOk.Location = new System.Drawing.Point(366, 163); - this.BtOk.Name = "BtOk"; - this.BtOk.Size = new System.Drawing.Size(75, 23); - this.BtOk.TabIndex = 14; - this.BtOk.Text = "Ok"; - this.BtOk.UseVisualStyleBackColor = true; - this.BtOk.Click += new System.EventHandler(this.BtOk_Click); - // - // BtUp - // - this.BtUp.ImageIndex = 0; - this.BtUp.ImageList = this.ImgList; - this.BtUp.Location = new System.Drawing.Point(170, 11); - this.BtUp.Name = "BtUp"; - this.BtUp.Size = new System.Drawing.Size(24, 24); - this.BtUp.TabIndex = 1; - this.BtUp.UseVisualStyleBackColor = true; - this.BtUp.Click += new System.EventHandler(this.BtUp_Click); - // - // ImgList - // - this.ImgList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ImgList.ImageStream"))); - this.ImgList.TransparentColor = System.Drawing.Color.Transparent; - this.ImgList.Images.SetKeyName(0, "UpArrow.png"); - this.ImgList.Images.SetKeyName(1, "DownArrow.png"); - this.ImgList.Images.SetKeyName(2, "AddIcon.png"); - this.ImgList.Images.SetKeyName(3, "RemoveIcon.png"); - this.ImgList.Images.SetKeyName(4, "EditIcon.png"); - // - // BtEdit - // - this.BtEdit.ImageIndex = 4; - this.BtEdit.ImageList = this.ImgList; - this.BtEdit.Location = new System.Drawing.Point(170, 101); - this.BtEdit.Name = "BtEdit"; - this.BtEdit.Size = new System.Drawing.Size(24, 24); - this.BtEdit.TabIndex = 4; - this.BtEdit.UseVisualStyleBackColor = true; - this.BtEdit.Click += new System.EventHandler(this.BtEdit_Click); - // - // BtDel - // - this.BtDel.ImageIndex = 3; - this.BtDel.ImageList = this.ImgList; - this.BtDel.Location = new System.Drawing.Point(170, 131); - this.BtDel.Name = "BtDel"; - this.BtDel.Size = new System.Drawing.Size(24, 24); - this.BtDel.TabIndex = 5; - this.BtDel.UseVisualStyleBackColor = true; - this.BtDel.Click += new System.EventHandler(this.BtDel_Click); - // - // BtDown - // - this.BtDown.ImageIndex = 1; - this.BtDown.ImageList = this.ImgList; - this.BtDown.Location = new System.Drawing.Point(170, 41); - this.BtDown.Name = "BtDown"; - this.BtDown.Size = new System.Drawing.Size(24, 24); - this.BtDown.TabIndex = 2; - this.BtDown.UseVisualStyleBackColor = true; - this.BtDown.Click += new System.EventHandler(this.BtDown_Click); - // - // BtAdd - // - this.BtAdd.ImageIndex = 2; - this.BtAdd.ImageList = this.ImgList; - this.BtAdd.Location = new System.Drawing.Point(170, 71); - this.BtAdd.Name = "BtAdd"; - this.BtAdd.Size = new System.Drawing.Size(24, 24); - this.BtAdd.TabIndex = 3; - this.BtAdd.UseVisualStyleBackColor = true; - this.BtAdd.Click += new System.EventHandler(this.BtAdd_Click); - // - // AddEditCollection - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(452, 198); - this.Controls.Add(this.BtAdd); - this.Controls.Add(this.BtDown); - this.Controls.Add(this.BtDel); - this.Controls.Add(this.BtEdit); - this.Controls.Add(this.BtUp); - this.Controls.Add(this.BtOk); - this.Controls.Add(this.PnlCollAddUpdate); - this.Controls.Add(this.TvColl); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "AddEditCollection"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Add / Edit collections"; - this.PnlCollAddUpdate.ResumeLayout(false); - this.PnlCollAddUpdate.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.TreeView TvColl; - private System.Windows.Forms.TextBox TxtCollPath; - private System.Windows.Forms.TextBox TxtCollName; - private System.Windows.Forms.TextBox TxtCollDesc; - private System.Windows.Forms.Label LblFolder; - private System.Windows.Forms.Label LblCollName; - private System.Windows.Forms.Label LblCollDesc; - private System.Windows.Forms.Panel PnlCollAddUpdate; - private System.Windows.Forms.Button BtSave; - private System.Windows.Forms.Button BtOk; - private System.Windows.Forms.Button BtCancel; - private System.Windows.Forms.Button BtUp; - private System.Windows.Forms.ImageList ImgList; - private System.Windows.Forms.Button BtEdit; - private System.Windows.Forms.Button BtDel; - private System.Windows.Forms.Button BtDown; - private System.Windows.Forms.Button BtAdd; - } -} diff --git a/TVRename/Forms/Collection/AddEditCollection.cs b/TVRename/Forms/Collection/AddEditCollection.cs deleted file mode 100644 index fe2c2d4cf..000000000 --- a/TVRename/Forms/Collection/AddEditCollection.cs +++ /dev/null @@ -1,228 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace TVRename -{ - public partial class AddEditCollection : Form - { - private static AddEditCollection aecf; - private readonly TVDoc mDoc; - private int iColl = -1; - private bool bActualMode; - private bool bActualButtons; - private bool bAddMode; - - public AddEditCollection(TVDoc doc) - { - InitializeComponent(); - mDoc = doc; - aecf = this; - bActualMode = SetTextBoxes(false, true); - bActualButtons = SetButtons(false, true); - - FillCollTreeView(); - } - - private static bool SetTextBoxes(bool bMode, bool bFull = false) - { - if (bFull) - { - aecf.TxtCollPath.Enabled = bMode; - } - aecf.TxtCollName.Enabled = bMode; - aecf.TxtCollDesc.Enabled = bMode; - - return bMode; - } - - private static bool SetButtons(bool bMode, bool bFull = false) - { - aecf.BtEdit.Enabled = bMode; - aecf.BtDel.Enabled = bMode; - aecf.BtUp.Enabled = bMode; - aecf.BtDown.Enabled = bMode; - if (bFull) - { - aecf.BtSave.Enabled = bMode; - aecf.BtCancel.Enabled = bMode; - } - return bMode; - } - - private static void ClearTextBoxes () - { - aecf.TxtCollName.Text = ""; - aecf.TxtCollPath.Text = ""; - aecf.TxtCollDesc.Text = ""; - } - - private static void FillTextBoxes (ShowCollection Collection) - { - aecf.TxtCollName.Text = Collection.Name; - aecf.TxtCollPath.Text = Collection.Path; - aecf.TxtCollDesc.Text = Collection.Description; - } - - private static ShowCollection FillCollectionFromTextBoxes () - { - ShowCollection Collection = new ShowCollection(aecf.TxtCollPath.Text); - Collection.Name = aecf.TxtCollName.Text; - Collection.Description = aecf.TxtCollDesc.Text; - - return Collection; - } - - private static void FillCollTreeView() - { - aecf.TvColl.Nodes.Clear(); - if (aecf.mDoc.ShowCollections.Count > 0) - { - TreeNode RootNode; - RootNode = aecf.TvColl.Nodes.Add("Root"); - int iCurr = 0; - foreach (ShowCollection ShowColl in aecf.mDoc.ShowCollections) - { - TreeNode CurNode; - CurNode = RootNode.Nodes.Add(ShowColl.Name); - CurNode.ToolTipText = ShowColl.Description; - CurNode.Tag = iCurr; - iCurr++; - } - aecf.TvColl.ExpandAll(); - } - } - - #region Control functions - private void TvColl_AfterSelect(object sender, TreeViewEventArgs e) - { - TreeView Tv = (TreeView)sender; - TreeNode Node = TvColl.SelectedNode; - string Sep = Tv.PathSeparator; - string[] Nodelevels = Node.FullPath.Split(Sep[0]); - - if (Nodelevels.Length == 2) - { - iColl = (int)Node.Tag; - FillTextBoxes(mDoc.ShowCollections[iColl]); - bActualButtons = SetButtons(true); - } - } - - private void BtDel_Click(object sender, EventArgs e) - { - if (iColl != -1) - { - mDoc.ShowCollections.RemoveAt(iColl); - } - - mDoc.WriteXMLFile(FileToHandle.Collections); - ClearTextBoxes(); - bActualButtons = SetButtons(false, true); - iColl = -1; - FillCollTreeView(); - } - - private void BtEdit_Click(object sender, EventArgs e) - { - if (iColl > 0) - { - bActualButtons = SetButtons(true, true); - bActualButtons = SetButtons(false); - bActualMode = SetTextBoxes(true); - BtAdd.Enabled = false; - bAddMode = false; - TvColl.Enabled = false; - } - } - - private void BtSave_Click(object sender, EventArgs e) - { - ShowCollection Sc = FillCollectionFromTextBoxes(); - if (bAddMode) - { - mDoc.ShowCollections.Add(Sc); - } - else - { - mDoc.ShowCollections[iColl] = Sc; - } - - mDoc.WriteXMLFile(FileToHandle.Collections); - - ClearTextBoxes(); - FillCollTreeView(); - - TvColl.Enabled = true; - bActualMode = SetTextBoxes(false, true); - bActualButtons = SetButtons(false, true); - iColl = -1; - BtAdd.Enabled = true; - } - - private void BtAdd_Click(object sender, EventArgs e) - { - ClearTextBoxes(); - bActualButtons = SetButtons(true, true); - bActualButtons = SetButtons(false); - bActualMode = SetTextBoxes(true, true); - BtAdd.Enabled = false; - iColl = -1; - bAddMode = true; - TvColl.Enabled = false; - } - - private void BtOk_Click(object sender, EventArgs e) - { - DialogResult = DialogResult.OK; - Close(); - } - - private void BtCancel_Click(object sender, EventArgs e) - { - ClearTextBoxes(); - bActualMode = SetTextBoxes(false, true); - bActualButtons = SetButtons(false, true); - BtAdd.Enabled = true; - bAddMode = false; - iColl = -1; - FillCollTreeView(); - TvColl.Enabled = true; - } - - private void BtUp_Click(object sender, EventArgs e) - { - ShowCollection Sc; - // No swap over the Default collection - if (iColl > 1) - { - Sc = mDoc.ShowCollections[iColl]; - mDoc.ShowCollections[iColl] = mDoc.ShowCollections[iColl - 1]; - mDoc.ShowCollections[iColl - 1] = Sc; - } - iColl = -1; - FillCollTreeView(); - } - - private void BtDown_Click(object sender, EventArgs e) - { - ShowCollection Sc; - // No Swap after last collection - if (iColl < mDoc.ShowCollections.Count - 1) - { - Sc = mDoc.ShowCollections[iColl]; - mDoc.ShowCollections[iColl] = mDoc.ShowCollections[iColl + 1]; - mDoc.ShowCollections[iColl + 1] = Sc; - } - iColl = -1; - FillCollTreeView(); - } - #endregion - } -} diff --git a/TVRename/Forms/Collection/AddEditCollection.resx b/TVRename/Forms/Collection/AddEditCollection.resx deleted file mode 100644 index 0e6b3f77b..000000000 --- a/TVRename/Forms/Collection/AddEditCollection.resx +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA+ - DQAAAk1TRnQBSQFMAgEBBQEAAQgBAAEIAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo - AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA - AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 - AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA - AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm - AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM - AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA - ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz - AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ - AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM - AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA - AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA - AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ - AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/ - AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA - AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm - ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ - Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz - AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA - AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM - AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM - ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM - Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA - AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM - AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ - AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz - AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm - AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw - AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/wEAATcBWQFYAXkBGgH/ - OgABmgJZATEBUgEaOgAB9AJ6AVgBMQF5OwABwwFZAXoBMQFzAbQB9DkAAf8BGgF6AZkBvAGzAbsB9DsA - AhkBCQK0AfQ6AAH0AhkBCQG0AXIB9DoAAfQCGQFWAS4BlwH0OgAB9AGYAXgBVgEuAXgB9DoAAfQCeAFW - AS4BlwH0OgAB9AJ4AVYBLgGYAfQ6AAH0AZgBeAFWAU8BCDsAAfQCmQFWAU8B8TsAAfQBGwFXAVYBeD0A - ARsBeAGZdQAB9AOtAawBpgEJCgAB/wEJAa0BCQH/CgAB8wKmAYoBtQHyBgAB/wHwAUUBkwH0BAAB/wGT - AekBGgH/BgAB9AGzAdsCswGtAQkJAAH/AQkBtAGzAa0BCQH/CQAB8wKmAawBugHzBgAB8ANGAZMB9AIA - Af8BkwFFAm8B8gH/BQAB9AGzAdsCswGtAQkJAAEJAdsBCQGzAq0BCQkAAfMCpgGKAbQB8wUAAfIDRgJv - AZMB9AEAAZMB6QFGAW8BlAGTARsFAAH0AbMB2wKzAa0BCQgAAQkBtAEJAdwCswGtAaYBCQgAAfMDigGz - AfMFAAFGAW8BlAFvAUYBbwFGAW8BkwEfA0YCFgFGBQAB9AGzAdsCswGtAQkGAAH/AQkB1APcArMCrQGm - AbsB/wYAAfMBigGsAYoBswHyBQAB8wGTAb0BlAFvA0YBHwRGAUwBRgEHBQAB9AGzAdsCswGtAQkFAAH/ - AQkB1APVAdsCswGtAawBpgGGAQcB/wUJAbUBigGLAYoBrQG1AfAB8QPyAQAB8wEaAb0BlAFvCEYBBwH/ - BQAB9AGzAdsCswGtAQkFAAH/A/QB8QGzAdUCswGtAfAC8wH0Af8BpgWKAq0BiwKtArMBugIJAQAB/wHz - ApQB4wZGASUBGgH/BgAB9AGzAdsCswGtAfMJAAH0AbQB2wKzAa0B9AQAAawCswqtArMBtAMAAfQBRgHj - ARcERgElARoIAAH0AbMB2wKzAa0B8wkAAfQBtAHbArMBrQHxBAABswHcAboBtASzBq0BswGsAgAB/wGT - AUYBFwZGAb0B/wMAAf8B3QEJAfEBCQHVAdwCswGtAbUCCQHwAf8FAAH0AbQB2wKzAa0BCQQAAbsB3AG6 - ArMCtAKzAa0BigKtAawCigEAAf8BkwFGAhcGRgHjARsB9AIAAf8BGQHUAdUB3AIJArMCrQGmAYsBvAH/ - BQAB9AG0AdsCswGtAQkEAAX0AfICugGzAa0BtQXzAQABkwJGAW8BFwNGAW8CRgHjAZQBGwH/AwABGQGt - AdUC3AKzAa0BrAGmAbwHAAH0AbQB2wKzAa0BCQkAAfQB3AG6ArMBCQUAAZQBJQHjARYBbwJGASUBIAEX - ARYCRgIWAb0EAAEZAbMB2wHcArMBrQGLAbwIAAH0AbQB2wKzAa0BCQkAAfQC3AKzAQkFAAGUARYBvQGU - AW8CRgGTARoBRwHjARYBRgFvARcBRwUAAfEBtAHbAbMCrQHwCQAB9AG0AdsCswGtAQkJAAH0AQkB3AKz - AQkFAAH0Ab0ClAJGAZMB/wEAARoC4wFvAkYBGgUAAf8B3QGzAq0B8AH/CQAB9AG0AdwCswGtAQkJAAH0 - AQkB3AG0AbMBCQYAAfQBlAFHASABkwH/AgAB/wEaAUcCRgEaAf8HAAEJAa0B8AsAAfQDrQGsAccBCQkA - AfQB2wGyAqwBCQcAAfQB4wGUBgABGgFGAfMCAAFCAU0BPgcAAT4DAAEoAwABQAMAASADAAEBAQABAQYA - AQEWAAP/AQABAwH/BgABAwH/BgABAwH/BgABgAH/BgABgAF/BgAB8AE/BgAB8AEfBgAB+AEPBgAB/AEH - BgAB/gEDBgAB/wEBBgAB/wGBBgAB/wHABgAB/wHgBgAB/wH4BgAC/wYAAfgBDwH8AR8B+AEfAYMBwQH4 - AQ8B+AEPAfgBHwGBAYAB+AEPAfgBDwH4AR8BAAGAAfgBDwHwAQcB+AEfAgAB+AEPAcABAQH4AR8CAAH4 - AQ8BgAMAAYABAAH4AQ8BgAMAAYABAQH4AQ8B+AEPAgAB4AEHAfgBDwH4AQ8CAAHAAQMBgAEAAfgBDwIA - AYABAQGAAQAB+AEPAgABgAEAAeABAwH4AQ8B+AEfAgAB8AEHAfgBDwH4AR8CAAH4AQ8B+AEPAfgBHwEA - AYAB+AEPAfgBDwH4AR8BgQGAAf4BPwH4AQ8B+AEfAccB4ws= - - - - 60 - - - - - AAABAAIAICAQAAAABADoAgAAJgAAABAQEAAAAAQAKAEAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAAAAAC - AAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAICAgADAwMAAAAD/AAD/ - AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////wAAAAD///////////////8AAAAA - ////mf////+Z////AAAAAP///5n/////mf///wAAAAD///+Z/////5n///8AAAAA////mf////+Z//// - AAAAAP///5n///+Z/5n//wAAAAD///+Z////mf+Z//8AAAAA////mf///5n/mf//AAAAAP///5n///+Z - /5n//wAAAAD/mZmZmZn/mf+Z//8AAAAA/5mZmZmZ/5n/mf//AAAAAP///////////////wAAAAD///// - //////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////// - ///AAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AA - AAPAAAADwAAAA8AAAAP/8z////Mf///Pz///z8///8/z///P8///P/z//z/8//////////////////// - //8oAAAAEAAAACAAAAABAAQAAAAAAIAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAgAAAgAAAAICAAIAA - AACAAIAAgIAAAICAgADAwMAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAA - AAAA////////AAD/+f//n/8AAP/5//+f/wAA//n/+fn/AAD/+f/5+f8AAPmZmfn5/wAA////////AAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAIAB - AACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAP1/AAD7fwAA+78AAPffAAD//wAA//8AAA== - - - \ No newline at end of file diff --git a/TVRename/Forms/Preferences/Preferences.Designer.cs b/TVRename/Forms/Preferences/Preferences.Designer.cs index 90ede532a..9606199fc 100644 --- a/TVRename/Forms/Preferences/Preferences.Designer.cs +++ b/TVRename/Forms/Preferences/Preferences.Designer.cs @@ -76,7 +76,6 @@ private void InitializeComponent() this.label6 = new System.Windows.Forms.Label(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tbGeneral = new System.Windows.Forms.TabPage(); - this.cbShowCollections = new System.Windows.Forms.CheckBox(); this.chkHideWtWSpoilers = new System.Windows.Forms.CheckBox(); this.chkHideMyShowsSpoilers = new System.Windows.Forms.CheckBox(); this.label37 = new System.Windows.Forms.Label(); @@ -267,7 +266,6 @@ private void InitializeComponent() this.pyTivoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mede8erToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.noneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.cbDeleteShowFromDisk = new System.Windows.Forms.CheckBox(); this.groupBox2.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tbGeneral.SuspendLayout(); @@ -297,7 +295,7 @@ private void InitializeComponent() // OKButton // this.OKButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.OKButton.Location = new System.Drawing.Point(369, 554); + this.OKButton.Location = new System.Drawing.Point(369, 551); this.OKButton.Name = "OKButton"; this.OKButton.Size = new System.Drawing.Size(75, 23); this.OKButton.TabIndex = 0; @@ -309,7 +307,7 @@ private void InitializeComponent() // this.bnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.bnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.bnCancel.Location = new System.Drawing.Point(450, 554); + this.bnCancel.Location = new System.Drawing.Point(450, 551); this.bnCancel.Name = "bnCancel"; this.bnCancel.Size = new System.Drawing.Size(75, 23); this.bnCancel.TabIndex = 1; @@ -551,7 +549,7 @@ private void InitializeComponent() // cbShowEpisodePictures // this.cbShowEpisodePictures.AutoSize = true; - this.cbShowEpisodePictures.Location = new System.Drawing.Point(9, 159); + this.cbShowEpisodePictures.Location = new System.Drawing.Point(9, 138); this.cbShowEpisodePictures.Name = "cbShowEpisodePictures"; this.cbShowEpisodePictures.Size = new System.Drawing.Size(218, 17); this.cbShowEpisodePictures.TabIndex = 10; @@ -582,7 +580,7 @@ private void InitializeComponent() // chkShowInTaskbar // this.chkShowInTaskbar.AutoSize = true; - this.chkShowInTaskbar.Location = new System.Drawing.Point(169, 136); + this.chkShowInTaskbar.Location = new System.Drawing.Point(169, 115); this.chkShowInTaskbar.Name = "chkShowInTaskbar"; this.chkShowInTaskbar.Size = new System.Drawing.Size(102, 17); this.chkShowInTaskbar.TabIndex = 9; @@ -593,7 +591,7 @@ private void InitializeComponent() // cbNotificationIcon // this.cbNotificationIcon.AutoSize = true; - this.cbNotificationIcon.Location = new System.Drawing.Point(9, 136); + this.cbNotificationIcon.Location = new System.Drawing.Point(9, 115); this.cbNotificationIcon.Name = "cbNotificationIcon"; this.cbNotificationIcon.Size = new System.Drawing.Size(154, 17); this.cbNotificationIcon.TabIndex = 8; @@ -665,12 +663,11 @@ private void InitializeComponent() this.tabControl1.Multiline = true; this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(517, 536); + this.tabControl1.Size = new System.Drawing.Size(517, 533); this.tabControl1.TabIndex = 0; // // tbGeneral // - this.tbGeneral.Controls.Add(this.cbShowCollections); this.tbGeneral.Controls.Add(this.chkHideWtWSpoilers); this.tbGeneral.Controls.Add(this.chkHideMyShowsSpoilers); this.tbGeneral.Controls.Add(this.label37); @@ -698,25 +695,15 @@ private void InitializeComponent() this.tbGeneral.Location = new System.Drawing.Point(4, 40); this.tbGeneral.Name = "tbGeneral"; this.tbGeneral.Padding = new System.Windows.Forms.Padding(3); - this.tbGeneral.Size = new System.Drawing.Size(509, 492); + this.tbGeneral.Size = new System.Drawing.Size(509, 489); this.tbGeneral.TabIndex = 0; this.tbGeneral.Text = "General"; this.tbGeneral.UseVisualStyleBackColor = true; // - // cbShowCollections - // - this.cbShowCollections.AutoSize = true; - this.cbShowCollections.Location = new System.Drawing.Point(9, 115); - this.cbShowCollections.Name = "cbShowCollections"; - this.cbShowCollections.Size = new System.Drawing.Size(145, 17); - this.cbShowCollections.TabIndex = 2; - this.cbShowCollections.Text = "Multiple Show collections"; - this.cbShowCollections.UseVisualStyleBackColor = true; - // // chkHideWtWSpoilers // this.chkHideWtWSpoilers.AutoSize = true; - this.chkHideWtWSpoilers.Location = new System.Drawing.Point(9, 205); + this.chkHideWtWSpoilers.Location = new System.Drawing.Point(9, 184); this.chkHideWtWSpoilers.Name = "chkHideWtWSpoilers"; this.chkHideWtWSpoilers.Size = new System.Drawing.Size(182, 17); this.chkHideWtWSpoilers.TabIndex = 24; @@ -726,7 +713,7 @@ private void InitializeComponent() // chkHideMyShowsSpoilers // this.chkHideMyShowsSpoilers.AutoSize = true; - this.chkHideMyShowsSpoilers.Location = new System.Drawing.Point(9, 182); + this.chkHideMyShowsSpoilers.Location = new System.Drawing.Point(9, 161); this.chkHideMyShowsSpoilers.Name = "chkHideMyShowsSpoilers"; this.chkHideMyShowsSpoilers.Size = new System.Drawing.Size(151, 17); this.chkHideMyShowsSpoilers.TabIndex = 23; @@ -736,7 +723,7 @@ private void InitializeComponent() // label37 // this.label37.AutoSize = true; - this.label37.Location = new System.Drawing.Point(6, 250); + this.label37.Location = new System.Drawing.Point(6, 229); this.label37.Name = "label37"; this.label37.Size = new System.Drawing.Size(114, 13); this.label37.TabIndex = 20; @@ -745,7 +732,7 @@ private void InitializeComponent() // label38 // this.label38.AutoSize = true; - this.label38.Location = new System.Drawing.Point(158, 250); + this.label38.Location = new System.Drawing.Point(158, 229); this.label38.Name = "label38"; this.label38.Size = new System.Drawing.Size(132, 13); this.label38.TabIndex = 22; @@ -753,7 +740,7 @@ private void InitializeComponent() // // tbPercentDirty // - this.tbPercentDirty.Location = new System.Drawing.Point(123, 247); + this.tbPercentDirty.Location = new System.Drawing.Point(123, 226); this.tbPercentDirty.Name = "tbPercentDirty"; this.tbPercentDirty.Size = new System.Drawing.Size(28, 20); this.tbPercentDirty.TabIndex = 21; @@ -765,7 +752,7 @@ private void InitializeComponent() this.cbMode.Items.AddRange(new object[] { "Beta", "Production"}); - this.cbMode.Location = new System.Drawing.Point(112, 341); + this.cbMode.Location = new System.Drawing.Point(112, 320); this.cbMode.Name = "cbMode"; this.cbMode.Size = new System.Drawing.Size(146, 21); this.cbMode.Sorted = true; @@ -774,7 +761,7 @@ private void InitializeComponent() // label34 // this.label34.AutoSize = true; - this.label34.Location = new System.Drawing.Point(6, 344); + this.label34.Location = new System.Drawing.Point(6, 323); this.label34.Name = "label34"; this.label34.Size = new System.Drawing.Size(37, 13); this.label34.TabIndex = 18; @@ -805,7 +792,7 @@ private void InitializeComponent() // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(6, 320); + this.label10.Location = new System.Drawing.Point(6, 299); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(100, 13); this.label10.TabIndex = 16; @@ -814,7 +801,7 @@ private void InitializeComponent() // cbLookForAirdate // this.cbLookForAirdate.AutoSize = true; - this.cbLookForAirdate.Location = new System.Drawing.Point(9, 296); + this.cbLookForAirdate.Location = new System.Drawing.Point(9, 275); this.cbLookForAirdate.Name = "cbLookForAirdate"; this.cbLookForAirdate.Size = new System.Drawing.Size(158, 17); this.cbLookForAirdate.TabIndex = 15; @@ -829,7 +816,7 @@ private void InitializeComponent() "My Shows", "Scan", "When to Watch"}); - this.cbLanguages.Location = new System.Drawing.Point(112, 317); + this.cbLanguages.Location = new System.Drawing.Point(112, 296); this.cbLanguages.Name = "cbLanguages"; this.cbLanguages.Size = new System.Drawing.Size(146, 21); this.cbLanguages.Sorted = true; @@ -838,7 +825,7 @@ private void InitializeComponent() // label21 // this.label21.AutoSize = true; - this.label21.Location = new System.Drawing.Point(6, 226); + this.label21.Location = new System.Drawing.Point(6, 205); this.label21.Name = "label21"; this.label21.Size = new System.Drawing.Size(82, 13); this.label21.TabIndex = 11; @@ -847,7 +834,7 @@ private void InitializeComponent() // cbAutoSelInMyShows // this.cbAutoSelInMyShows.AutoSize = true; - this.cbAutoSelInMyShows.Location = new System.Drawing.Point(9, 273); + this.cbAutoSelInMyShows.Location = new System.Drawing.Point(9, 252); this.cbAutoSelInMyShows.Name = "cbAutoSelInMyShows"; this.cbAutoSelInMyShows.Size = new System.Drawing.Size(268, 17); this.cbAutoSelInMyShows.TabIndex = 14; @@ -866,7 +853,7 @@ private void InitializeComponent() // label20 // this.label20.AutoSize = true; - this.label20.Location = new System.Drawing.Point(126, 226); + this.label20.Location = new System.Drawing.Point(126, 205); this.label20.Name = "label20"; this.label20.Size = new System.Drawing.Size(170, 13); this.label20.TabIndex = 13; @@ -874,7 +861,7 @@ private void InitializeComponent() // // txtParallelDownloads // - this.txtParallelDownloads.Location = new System.Drawing.Point(92, 223); + this.txtParallelDownloads.Location = new System.Drawing.Point(92, 202); this.txtParallelDownloads.Name = "txtParallelDownloads"; this.txtParallelDownloads.Size = new System.Drawing.Size(28, 20); this.txtParallelDownloads.TabIndex = 12; @@ -1556,7 +1543,6 @@ private void InitializeComponent() // // tbFolderDeleting // - this.tbFolderDeleting.Controls.Add(this.cbDeleteShowFromDisk); this.tbFolderDeleting.Controls.Add(this.cbCleanUpDownloadDir); this.tbFolderDeleting.Controls.Add(this.label32); this.tbFolderDeleting.Controls.Add(this.label30); @@ -1572,7 +1558,7 @@ private void InitializeComponent() this.tbFolderDeleting.Location = new System.Drawing.Point(4, 40); this.tbFolderDeleting.Name = "tbFolderDeleting"; this.tbFolderDeleting.Padding = new System.Windows.Forms.Padding(3); - this.tbFolderDeleting.Size = new System.Drawing.Size(509, 492); + this.tbFolderDeleting.Size = new System.Drawing.Size(509, 489); this.tbFolderDeleting.TabIndex = 9; this.tbFolderDeleting.Text = "Folder Deleting"; this.tbFolderDeleting.UseVisualStyleBackColor = true; @@ -2747,23 +2733,13 @@ private void InitializeComponent() this.noneToolStripMenuItem.Tag = "4"; this.noneToolStripMenuItem.Text = "&None"; // - // cbDeleteShowFromDisk - // - this.cbDeleteShowFromDisk.AutoSize = true; - this.cbDeleteShowFromDisk.Location = new System.Drawing.Point(16, 267); - this.cbDeleteShowFromDisk.Name = "cbDeleteShowFromDisk"; - this.cbDeleteShowFromDisk.Size = new System.Drawing.Size(269, 17); - this.cbDeleteShowFromDisk.TabIndex = 11; - this.cbDeleteShowFromDisk.Text = "Delete from disk when deleting show from database"; - this.cbDeleteShowFromDisk.UseVisualStyleBackColor = true; - // // Preferences // this.AcceptButton = this.OKButton; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.bnCancel; - this.ClientSize = new System.Drawing.Size(541, 579); + this.ClientSize = new System.Drawing.Size(541, 576); this.ControlBox = false; this.Controls.Add(this.tabControl1); this.Controls.Add(this.bnCancel); @@ -3067,7 +3043,5 @@ private void InitializeComponent() private System.Windows.Forms.TextBox txtSeasonFormat; private System.Windows.Forms.Label label47; private System.Windows.Forms.CheckBox cbWDLiveEpisodeFiles; - private System.Windows.Forms.CheckBox cbShowCollections; - private System.Windows.Forms.CheckBox cbDeleteShowFromDisk; } } diff --git a/TVRename/Forms/Preferences/Preferences.cs b/TVRename/Forms/Preferences/Preferences.cs index 55af2b635..5e696d197 100644 --- a/TVRename/Forms/Preferences/Preferences.cs +++ b/TVRename/Forms/Preferences/Preferences.cs @@ -147,8 +147,6 @@ private void OKButton_Click(object sender, EventArgs e) s.ShowInTaskbar = chkShowInTaskbar.Checked; s.RenameTxtToSub = cbTxtToSub.Checked; s.ShowEpisodePictures = cbShowEpisodePictures.Checked; - s.ShowCollections = cbShowCollections.Checked; - s.DeleteShowFromDisk = cbDeleteShowFromDisk.Checked; s.HideMyShowsSpoilers = chkHideMyShowsSpoilers.Checked; s.HideWtWSpoilers = chkHideWtWSpoilers.Checked; s.AutoSelectShowInMyShows = cbAutoSelInMyShows.Checked; @@ -383,8 +381,6 @@ private void Preferences_Load(object sender, EventArgs e) chkHideWtWSpoilers.Checked = s.HideWtWSpoilers; cbAutoCreateFolders.Checked = s.AutoCreateFolders; cbAutoSelInMyShows.Checked = s.AutoSelectShowInMyShows; - cbShowCollections.Checked = s.ShowCollections; - cbDeleteShowFromDisk.Checked = s.DeleteShowFromDisk; txtSpecialsFolderName.Text = s.SpecialsFolderName; txtSeasonFormat.Text= s.SeasonFolderFormat ; cbForceLower.Checked = s.ForceLowercaseFilenames; diff --git a/TVRename/Forms/UI.Designer.cs b/TVRename/Forms/UI.Designer.cs index a2b8c08d4..9400591f8 100644 --- a/TVRename/Forms/UI.Designer.cs +++ b/TVRename/Forms/UI.Designer.cs @@ -63,10 +63,6 @@ public void InitializeComponent() System.Windows.Forms.ListViewGroup listViewGroup14 = new System.Windows.Forms.ListViewGroup("Later", System.Windows.Forms.HorizontalAlignment.Left); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.collToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.aeCollToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripSeparator0 = new System.Windows.Forms.ToolStripSeparator(); this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); @@ -138,6 +134,16 @@ public void InitializeComponent() this.bnActionOptions = new System.Windows.Forms.Button(); this.bnActionWhichSearch = new System.Windows.Forms.Button(); this.bnActionBTSearch = new System.Windows.Forms.Button(); + this.lvAction = new TVRename.MyListView(); + this.columnHeader48 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader49 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader51 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader52 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader53 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader54 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader55 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader56 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader58 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.ilIcons = new System.Windows.Forms.ImageList(this.components); this.bnActionAction = new System.Windows.Forms.Button(); this.bnActionRecentCheck = new System.Windows.Forms.Button(); @@ -148,6 +154,15 @@ public void InitializeComponent() this.bnWhenToWatchCheck = new System.Windows.Forms.Button(); this.txtWhenToWatchSynopsis = new System.Windows.Forms.TextBox(); this.calCalendar = new System.Windows.Forms.MonthCalendar(); + this.lvWhenToWatch = new TVRename.ListViewFlickerFree(); + this.columnHeader29 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader30 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader31 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader32 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader36 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader33 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader34 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader35 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.pbProgressBarx = new System.Windows.Forms.ProgressBar(); this.txtDLStatusLabel = new System.Windows.Forms.Label(); @@ -176,25 +191,6 @@ public void InitializeComponent() this.tmrPeriodicScan = new System.Windows.Forms.Timer(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.btnUpdateAvailable = new System.Windows.Forms.Button(); - this.lvAction = new TVRename.MyListView(); - this.columnHeader48 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader49 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader51 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader52 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader53 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader54 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader55 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader56 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader58 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.lvWhenToWatch = new TVRename.ListViewFlickerFree(); - this.columnHeader29 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader30 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader31 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader32 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader36 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader33 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader34 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader35 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.menuStrip1.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tbMyShows.SuspendLayout(); @@ -228,8 +224,6 @@ public void InitializeComponent() // fileToolStripMenuItem // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.collToolStripMenuItem, - this.toolStripSeparator0, this.exportToolStripMenuItem, this.saveToolStripMenuItem, this.toolStripSeparator1, @@ -239,38 +233,11 @@ public void InitializeComponent() this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "&File"; // - // collToolStripMenuItem - // - this.collToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.aeCollToolStripMenuItem, - this.toolStripSeparator8}); - this.collToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("collToolStripMenuItem.Image"))); - this.collToolStripMenuItem.Name = "collToolStripMenuItem"; - this.collToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.collToolStripMenuItem.Text = "&Collection"; - // - // aeCollToolStripMenuItem - // - this.aeCollToolStripMenuItem.Name = "aeCollToolStripMenuItem"; - this.aeCollToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.aeCollToolStripMenuItem.Text = "Add / Edit"; - this.aeCollToolStripMenuItem.Click += new System.EventHandler(this.aeCollToolStripMenuItem_Click); - // - // toolStripSeparator8 - // - this.toolStripSeparator8.Name = "toolStripSeparator8"; - this.toolStripSeparator8.Size = new System.Drawing.Size(177, 6); - // - // toolStripSeparator0 - // - this.toolStripSeparator0.Name = "toolStripSeparator0"; - this.toolStripSeparator0.Size = new System.Drawing.Size(177, 6); - // // exportToolStripMenuItem // this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; this.exportToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); - this.exportToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.exportToolStripMenuItem.Size = new System.Drawing.Size(147, 22); this.exportToolStripMenuItem.Text = "&Export"; this.exportToolStripMenuItem.Click += new System.EventHandler(this.exportToolStripMenuItem_Click); // @@ -279,20 +246,20 @@ public void InitializeComponent() this.saveToolStripMenuItem.Image = global::TVRename.Properties.Resources.saveHS; this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(147, 22); this.saveToolStripMenuItem.Text = "&Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(144, 6); // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); - this.exitToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.exitToolStripMenuItem.Size = new System.Drawing.Size(147, 22); this.exitToolStripMenuItem.Text = "E&xit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); // @@ -440,19 +407,19 @@ public void InitializeComponent() // this.statisticsToolStripMenuItem.Image = global::TVRename.Properties.Resources.graphhs; this.statisticsToolStripMenuItem.Name = "statisticsToolStripMenuItem"; - this.statisticsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.statisticsToolStripMenuItem.Size = new System.Drawing.Size(166, 22); this.statisticsToolStripMenuItem.Text = "&Statistics..."; this.statisticsToolStripMenuItem.Click += new System.EventHandler(this.statisticsToolStripMenuItem_Click); // // toolStripSeparator5 // this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(177, 6); + this.toolStripSeparator5.Size = new System.Drawing.Size(163, 6); // // showSummaryToolStripMenuItem // this.showSummaryToolStripMenuItem.Name = "showSummaryToolStripMenuItem"; - this.showSummaryToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.showSummaryToolStripMenuItem.Size = new System.Drawing.Size(166, 22); this.showSummaryToolStripMenuItem.Text = "Show Summary..."; this.showSummaryToolStripMenuItem.Click += new System.EventHandler(this.showSummaryToolStripMenuItem_Click); // @@ -460,7 +427,7 @@ public void InitializeComponent() // this.actorsToolStripMenuItem.Image = global::TVRename.Properties.Resources.TableHS; this.actorsToolStripMenuItem.Name = "actorsToolStripMenuItem"; - this.actorsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.actorsToolStripMenuItem.Size = new System.Drawing.Size(166, 22); this.actorsToolStripMenuItem.Text = "&Actors Grid..."; this.actorsToolStripMenuItem.Click += new System.EventHandler(this.actorsToolStripMenuItem_Click); // @@ -1032,6 +999,121 @@ public void InitializeComponent() this.bnActionBTSearch.UseVisualStyleBackColor = true; this.bnActionBTSearch.Click += new System.EventHandler(this.bnActionBTSearch_Click); // + // lvAction + // + this.lvAction.AllowDrop = true; + this.lvAction.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvAction.CheckBoxes = true; + this.lvAction.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader48, + this.columnHeader49, + this.columnHeader51, + this.columnHeader52, + this.columnHeader53, + this.columnHeader54, + this.columnHeader55, + this.columnHeader56, + this.columnHeader58}); + this.lvAction.FullRowSelect = true; + listViewGroup1.Header = "Missing"; + listViewGroup1.Name = "lvgActionMissing"; + listViewGroup2.Header = "Rename"; + listViewGroup2.Name = "lvgActionRename"; + listViewGroup3.Header = "Copy"; + listViewGroup3.Name = "lvgActionCopy"; + listViewGroup4.Header = "Move"; + listViewGroup4.Name = "lvgActionMove"; + listViewGroup5.Header = "Remove"; + listViewGroup5.Name = "lvgActionDelete"; + listViewGroup6.Header = "Download RSS"; + listViewGroup6.Name = "lvgActionDownloadRSS"; + listViewGroup7.Header = "Download"; + listViewGroup7.Name = "lvgActionDownload"; + listViewGroup8.Header = "Media Center Metadata"; + listViewGroup8.Name = "lvgActionMeta"; + listViewGroup9.Header = "Update File Metadata"; + listViewGroup9.Name = "lvgUpdateFileDates"; + listViewGroup10.Header = "Downloading"; + listViewGroup10.Name = "lvgDownloading"; + this.lvAction.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { + listViewGroup1, + listViewGroup2, + listViewGroup3, + listViewGroup4, + listViewGroup5, + listViewGroup6, + listViewGroup7, + listViewGroup8, + listViewGroup9, + listViewGroup10}); + this.lvAction.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.lvAction.HideSelection = false; + this.lvAction.Location = new System.Drawing.Point(0, 35); + this.lvAction.Name = "lvAction"; + this.lvAction.ShowItemToolTips = true; + this.lvAction.Size = new System.Drawing.Size(920, 435); + this.lvAction.SmallImageList = this.ilIcons; + this.lvAction.TabIndex = 2; + this.lvAction.UseCompatibleStateImageBehavior = false; + this.lvAction.View = System.Windows.Forms.View.Details; + this.lvAction.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.lvAction_ItemCheck); + this.lvAction.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lvAction_ItemChecked); + this.lvAction.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.lvAction_RetrieveVirtualItem); + this.lvAction.SelectedIndexChanged += new System.EventHandler(this.lvAction_SelectedIndexChanged); + this.lvAction.DragDrop += new System.Windows.Forms.DragEventHandler(this.lvAction_DragDrop); + this.lvAction.DragEnter += new System.Windows.Forms.DragEventHandler(this.lvAction_DragEnter); + this.lvAction.DragOver += new System.Windows.Forms.DragEventHandler(this.lvAction_DragEnter); + this.lvAction.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvAction_KeyDown); + this.lvAction.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvAction_MouseClick); + this.lvAction.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvAction_MouseDoubleClick); + // + // columnHeader48 + // + this.columnHeader48.Text = "Show"; + this.columnHeader48.Width = 155; + // + // columnHeader49 + // + this.columnHeader49.Text = "Season"; + this.columnHeader49.Width = 50; + // + // columnHeader51 + // + this.columnHeader51.Text = "Episode"; + this.columnHeader51.Width = 50; + // + // columnHeader52 + // + this.columnHeader52.Text = "Date"; + this.columnHeader52.Width = 70; + // + // columnHeader53 + // + this.columnHeader53.Text = "Folder"; + this.columnHeader53.Width = 180; + // + // columnHeader54 + // + this.columnHeader54.Text = "Episode/Filename"; + this.columnHeader54.Width = 180; + // + // columnHeader55 + // + this.columnHeader55.Text = "Folder/Filename"; + this.columnHeader55.Width = 180; + // + // columnHeader56 + // + this.columnHeader56.Text = "Filename"; + this.columnHeader56.Width = 180; + // + // columnHeader58 + // + this.columnHeader58.Text = "Errors"; + this.columnHeader58.Width = 180; + // // ilIcons // this.ilIcons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ilIcons.ImageStream"))); @@ -1161,6 +1243,89 @@ public void InitializeComponent() this.calCalendar.TabIndex = 5; this.calCalendar.DateSelected += new System.Windows.Forms.DateRangeEventHandler(this.calCalendar_DateSelected); // + // lvWhenToWatch + // + this.lvWhenToWatch.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvWhenToWatch.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader29, + this.columnHeader30, + this.columnHeader31, + this.columnHeader32, + this.columnHeader36, + this.columnHeader33, + this.columnHeader34, + this.columnHeader35}); + this.lvWhenToWatch.FullRowSelect = true; + listViewGroup11.Header = "Recently Aired"; + listViewGroup11.Name = "justPassed"; + listViewGroup12.Header = "Next 7 Days"; + listViewGroup12.Name = "next7days"; + listViewGroup12.Tag = "1"; + listViewGroup13.Header = "Future Episodes"; + listViewGroup13.Name = "futureEps"; + listViewGroup14.Header = "Later"; + listViewGroup14.Name = "later"; + listViewGroup14.Tag = "2"; + this.lvWhenToWatch.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { + listViewGroup11, + listViewGroup12, + listViewGroup13, + listViewGroup14}); + this.lvWhenToWatch.HideSelection = false; + this.lvWhenToWatch.Location = new System.Drawing.Point(0, 35); + this.lvWhenToWatch.Name = "lvWhenToWatch"; + this.lvWhenToWatch.ShowItemToolTips = true; + this.lvWhenToWatch.Size = new System.Drawing.Size(923, 297); + this.lvWhenToWatch.SmallImageList = this.ilIcons; + this.lvWhenToWatch.TabIndex = 3; + this.lvWhenToWatch.UseCompatibleStateImageBehavior = false; + this.lvWhenToWatch.View = System.Windows.Forms.View.Details; + this.lvWhenToWatch.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lvWhenToWatch_ColumnClick); + this.lvWhenToWatch.SelectedIndexChanged += new System.EventHandler(this.lvWhenToWatch_Click); + this.lvWhenToWatch.DoubleClick += new System.EventHandler(this.lvWhenToWatch_DoubleClick); + this.lvWhenToWatch.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvWhenToWatch_MouseClick); + // + // columnHeader29 + // + this.columnHeader29.Text = "Show"; + this.columnHeader29.Width = 187; + // + // columnHeader30 + // + this.columnHeader30.Text = "Season"; + this.columnHeader30.Width = 51; + // + // columnHeader31 + // + this.columnHeader31.Text = "Episode"; + this.columnHeader31.Width = 55; + // + // columnHeader32 + // + this.columnHeader32.Text = "Air Date"; + this.columnHeader32.Width = 81; + // + // columnHeader36 + // + this.columnHeader36.Text = "Time"; + // + // columnHeader33 + // + this.columnHeader33.Text = "Day"; + this.columnHeader33.Width = 42; + // + // columnHeader34 + // + this.columnHeader34.Text = "How Long"; + this.columnHeader34.Width = 69; + // + // columnHeader35 + // + this.columnHeader35.Text = "Episode Name"; + this.columnHeader35.Width = 360; + // // tableLayoutPanel2 // this.tableLayoutPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) @@ -1343,204 +1508,6 @@ public void InitializeComponent() this.btnUpdateAvailable.Visible = false; this.btnUpdateAvailable.Click += new System.EventHandler(this.btnUpdateAvailable_Click); // - // lvAction - // - this.lvAction.AllowDrop = true; - this.lvAction.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvAction.CheckBoxes = true; - this.lvAction.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader48, - this.columnHeader49, - this.columnHeader51, - this.columnHeader52, - this.columnHeader53, - this.columnHeader54, - this.columnHeader55, - this.columnHeader56, - this.columnHeader58}); - this.lvAction.FullRowSelect = true; - listViewGroup1.Header = "Missing"; - listViewGroup1.Name = "lvgActionMissing"; - listViewGroup2.Header = "Rename"; - listViewGroup2.Name = "lvgActionRename"; - listViewGroup3.Header = "Copy"; - listViewGroup3.Name = "lvgActionCopy"; - listViewGroup4.Header = "Move"; - listViewGroup4.Name = "lvgActionMove"; - listViewGroup5.Header = "Remove"; - listViewGroup5.Name = "lvgActionDelete"; - listViewGroup6.Header = "Download RSS"; - listViewGroup6.Name = "lvgActionDownloadRSS"; - listViewGroup7.Header = "Download"; - listViewGroup7.Name = "lvgActionDownload"; - listViewGroup8.Header = "Media Center Metadata"; - listViewGroup8.Name = "lvgActionMeta"; - listViewGroup9.Header = "Update File Metadata"; - listViewGroup9.Name = "lvgUpdateFileDates"; - listViewGroup10.Header = "Downloading"; - listViewGroup10.Name = "lvgDownloading"; - this.lvAction.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { - listViewGroup1, - listViewGroup2, - listViewGroup3, - listViewGroup4, - listViewGroup5, - listViewGroup6, - listViewGroup7, - listViewGroup8, - listViewGroup9, - listViewGroup10}); - this.lvAction.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.lvAction.HideSelection = false; - this.lvAction.Location = new System.Drawing.Point(0, 35); - this.lvAction.Name = "lvAction"; - this.lvAction.ShowItemToolTips = true; - this.lvAction.Size = new System.Drawing.Size(920, 435); - this.lvAction.SmallImageList = this.ilIcons; - this.lvAction.TabIndex = 2; - this.lvAction.UseCompatibleStateImageBehavior = false; - this.lvAction.View = System.Windows.Forms.View.Details; - this.lvAction.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.lvAction_ItemCheck); - this.lvAction.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lvAction_ItemChecked); - this.lvAction.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.lvAction_RetrieveVirtualItem); - this.lvAction.SelectedIndexChanged += new System.EventHandler(this.lvAction_SelectedIndexChanged); - this.lvAction.DragDrop += new System.Windows.Forms.DragEventHandler(this.lvAction_DragDrop); - this.lvAction.DragEnter += new System.Windows.Forms.DragEventHandler(this.lvAction_DragEnter); - this.lvAction.DragOver += new System.Windows.Forms.DragEventHandler(this.lvAction_DragEnter); - this.lvAction.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvAction_KeyDown); - this.lvAction.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvAction_MouseClick); - this.lvAction.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvAction_MouseDoubleClick); - // - // columnHeader48 - // - this.columnHeader48.Text = "Show"; - this.columnHeader48.Width = 155; - // - // columnHeader49 - // - this.columnHeader49.Text = "Season"; - this.columnHeader49.Width = 50; - // - // columnHeader51 - // - this.columnHeader51.Text = "Episode"; - this.columnHeader51.Width = 50; - // - // columnHeader52 - // - this.columnHeader52.Text = "Date"; - this.columnHeader52.Width = 70; - // - // columnHeader53 - // - this.columnHeader53.Text = "Folder"; - this.columnHeader53.Width = 180; - // - // columnHeader54 - // - this.columnHeader54.Text = "Episode/Filename"; - this.columnHeader54.Width = 180; - // - // columnHeader55 - // - this.columnHeader55.Text = "Folder/Filename"; - this.columnHeader55.Width = 180; - // - // columnHeader56 - // - this.columnHeader56.Text = "Filename"; - this.columnHeader56.Width = 180; - // - // columnHeader58 - // - this.columnHeader58.Text = "Errors"; - this.columnHeader58.Width = 180; - // - // lvWhenToWatch - // - this.lvWhenToWatch.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvWhenToWatch.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader29, - this.columnHeader30, - this.columnHeader31, - this.columnHeader32, - this.columnHeader36, - this.columnHeader33, - this.columnHeader34, - this.columnHeader35}); - this.lvWhenToWatch.FullRowSelect = true; - listViewGroup11.Header = "Recently Aired"; - listViewGroup11.Name = "justPassed"; - listViewGroup12.Header = "Next 7 Days"; - listViewGroup12.Name = "next7days"; - listViewGroup12.Tag = "1"; - listViewGroup13.Header = "Future Episodes"; - listViewGroup13.Name = "futureEps"; - listViewGroup14.Header = "Later"; - listViewGroup14.Name = "later"; - listViewGroup14.Tag = "2"; - this.lvWhenToWatch.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { - listViewGroup11, - listViewGroup12, - listViewGroup13, - listViewGroup14}); - this.lvWhenToWatch.HideSelection = false; - this.lvWhenToWatch.Location = new System.Drawing.Point(0, 35); - this.lvWhenToWatch.Name = "lvWhenToWatch"; - this.lvWhenToWatch.ShowItemToolTips = true; - this.lvWhenToWatch.Size = new System.Drawing.Size(923, 297); - this.lvWhenToWatch.SmallImageList = this.ilIcons; - this.lvWhenToWatch.TabIndex = 3; - this.lvWhenToWatch.UseCompatibleStateImageBehavior = false; - this.lvWhenToWatch.View = System.Windows.Forms.View.Details; - this.lvWhenToWatch.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lvWhenToWatch_ColumnClick); - this.lvWhenToWatch.SelectedIndexChanged += new System.EventHandler(this.lvWhenToWatch_Click); - this.lvWhenToWatch.DoubleClick += new System.EventHandler(this.lvWhenToWatch_DoubleClick); - this.lvWhenToWatch.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvWhenToWatch_MouseClick); - // - // columnHeader29 - // - this.columnHeader29.Text = "Show"; - this.columnHeader29.Width = 187; - // - // columnHeader30 - // - this.columnHeader30.Text = "Season"; - this.columnHeader30.Width = 51; - // - // columnHeader31 - // - this.columnHeader31.Text = "Episode"; - this.columnHeader31.Width = 55; - // - // columnHeader32 - // - this.columnHeader32.Text = "Air Date"; - this.columnHeader32.Width = 81; - // - // columnHeader36 - // - this.columnHeader36.Text = "Time"; - // - // columnHeader33 - // - this.columnHeader33.Text = "Day"; - this.columnHeader33.Width = 42; - // - // columnHeader34 - // - this.columnHeader34.Text = "How Long"; - this.columnHeader34.Width = 69; - // - // columnHeader35 - // - this.columnHeader35.Text = "Episode Name"; - this.columnHeader35.Width = 360; - // // UI // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1720,9 +1687,5 @@ public void InitializeComponent() private ToolStripSeparator toolStripSeparator5; private ToolStripSeparator toolStripSeparator7; private ToolStripSeparator toolStripSeparator6; - private ToolStripMenuItem collToolStripMenuItem; - private ToolStripSeparator toolStripSeparator0; - private ToolStripMenuItem aeCollToolStripMenuItem; - private ToolStripSeparator toolStripSeparator8; } } diff --git a/TVRename/Forms/UI.cs b/TVRename/Forms/UI.cs index ab5c43138..1daf081a0 100644 --- a/TVRename/Forms/UI.cs +++ b/TVRename/Forms/UI.cs @@ -148,13 +148,6 @@ public UI(TVDoc doc, TVRenameSplash splash, bool showUi) } UpdateSplashStatus(splash, "Filling Shows"); - - if (!TVSettings.Instance.ShowCollections) - { - collToolStripMenuItem.Visible = false; - toolStripSeparator0.Visible = false; - } - FillMyShows(); UpdateSearchButtons(); ClearInfoWindows(); @@ -169,8 +162,6 @@ public UI(TVDoc doc, TVRenameSplash splash, bool showUi) UpdateSplashStatus(splash, "Setting Notifications"); ShowHideNotificationIcon(); - BuildCollectionsMenu(); - int t = TVSettings.Instance.StartupTab; if (t < tabControl1.TabCount) tabControl1.SelectedIndex = TVSettings.Instance.StartupTab; @@ -564,9 +555,7 @@ private void UI_FormClosing(object sender, FormClosingEventArgs e) MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning); if (res == DialogResult.Yes) - { - mDoc.WriteXMLFile(FileToHandle.Settings | FileToHandle.Shows | FileToHandle.TvDB); - } + mDoc.WriteXMLSettings(); else if (res == DialogResult.Cancel) e.Cancel = true; else if (res == DialogResult.No) @@ -1468,106 +1457,6 @@ private void MenuFolders(LVResults lvr) } } - private void BuildCollectionsMenu () - { - // ActualCollMenuItem - if (mDoc.ShowCollections.Count == 0) - { - // Setup a default collection when we come's from 2.4.x RCy - ShowCollection Sc = new ShowCollection("2.1"); - Sc.Name = "Default"; - Sc.Description = "Default collection in mono collection use"; - mDoc.ShowCollections.Add(Sc); - mDoc.WriteXMLFile(FileToHandle.Collections); - } - - ToolStripMenuItem[] CollMenu = new ToolStripMenuItem[mDoc.ShowCollections.Count]; - int i = 0; - foreach (ShowCollection ShowColl in mDoc.ShowCollections) - { - CollMenu[i] = new ToolStripMenuItem(); - CollMenu[i].Name = "CollectionMenuItem" + i.ToString(); - CollMenu[i].Tag = ShowColl; - CollMenu[i].Text = ShowColl.Name; - CollMenu[i].ToolTipText = ShowColl.Description; - if (ShowColl.Path == PathManager.ShowCollection) - { - CollMenu[i].Checked = true; - } - CollMenu[i].Click += new EventHandler(SelCollMenuItemClickHandler); - i++; - } - - collToolStripMenuItem.DropDownItems.AddRange(CollMenu); - } - - private void RemoveCollectionsMenu () - { - int iCount = collToolStripMenuItem.DropDownItems.Count -2; - string MenuItemName = ""; - for (int iCurr = 0; iCurr < iCount; iCurr++) - { - MenuItemName = "CollectionMenuItem" + iCurr.ToString(); - collToolStripMenuItem.DropDownItems.RemoveAt(2); - } - } - - private void SelCollMenuItemClickHandler(object sender, EventArgs e) - { - bool bNeedCancel = false; - ToolStripMenuItem clickedItem = (ToolStripMenuItem)sender; - ShowCollection SelectedCollection = (ShowCollection)clickedItem.Tag; - - try - { - if (mDoc.Dirty()) - { - DialogResult res = MessageBox.Show( - "Your changes have not been saved. Do you wish to save before changing show collection?", "Unsaved data", - MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning); - - if (res == DialogResult.Yes) - { - mDoc.WriteXMLFile(FileToHandle.Settings | FileToHandle.Shows | FileToHandle.TvDB); - } - else if (res == DialogResult.Cancel) - bNeedCancel = true; - else if (res == DialogResult.No) - { - bNeedCancel = false; - } - } - - if (!bNeedCancel) - { - ToolStripItemCollection TSMIC = collToolStripMenuItem.DropDownItems; - ToolStripMenuItem TsM; - foreach (ToolStripItem TsI in TSMIC) - { - try - { - TsM = (ToolStripMenuItem)TsI; - TsM.Checked = false; - } - catch (Exception) - { - // Just a pass thru for MenuSeparators - } - } - clickedItem.Checked = true; - - mDoc.SwitchToCollection(SelectedCollection.Path); - mDoc.WriteXMLFile(FileToHandle.Collections); - FillMyShows(); - } - } - catch (Exception ex) - { - MessageBox.Show(this, ex.Message + "\r\n\r\n" + ex.StackTrace, "Switch Show Collection", - MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - private void BuildRightClickMenu(Point pt) { showRightClickMenu.Items.Clear(); @@ -1887,8 +1776,6 @@ private void DoPrefs(bool scanOptions) ShowHideNotificationIcon(); FillWhenToWatchList(); ShowInTaskbar = TVSettings.Instance.ShowInTaskbar; - collToolStripMenuItem.Visible = (TVSettings.Instance.ShowCollections) ? true : false; - toolStripSeparator0.Visible = (TVSettings.Instance.ShowCollections) ? true : false; FillEpGuideHtml(); mAutoFolderMonitor.SettingsChanged(TVSettings.Instance.MonitorFolders); betaToolsToolStripMenuItem.Visible = TVSettings.Instance.IncludeBetaUpdates(); @@ -1903,7 +1790,8 @@ private void saveToolStripMenuItem_Click(object sender, EventArgs e) { try { - mDoc.WriteXMLFile(FileToHandle.Collections | FileToHandle.Settings | FileToHandle.Shows | FileToHandle.TvDB); + mDoc.WriteXMLSettings(); + TheTVDB.Instance.SaveCache(); if (!SaveLayoutXml()) { Logger.Error("Failed to Save Layout Configuration Files"); @@ -1960,7 +1848,7 @@ private void statusTimer_Tick(object sender, EventArgs e) if (n == 0 && lastDlRemaining > 0) { // we've just finished a bunch of background downloads - mDoc.WriteXMLFile(FileToHandle.TvDB); + TheTVDB.Instance.SaveCache(); RefreshWTW(false); backgroundDownloadNowToolStripMenuItem.Enabled = true; @@ -2302,7 +2190,7 @@ private void DeleteShow(ShowItem si) if (res != DialogResult.Yes) return; - if ((Directory.Exists(si.AutoAddFolderBase)) && TVSettings.Instance.DeleteShowFromDisk) + if (Directory.Exists(si.AutoAddFolderBase)) { DialogResult res3 = MessageBox.Show( $"Remove folder \"{si.AutoAddFolderBase}\" from disk?", @@ -3698,15 +3586,5 @@ private void exportToolStripMenuItem_Click(object sender, EventArgs e) { } - - private void aeCollToolStripMenuItem_Click(object sender, EventArgs e) - { - AddEditCollection AEC = new AddEditCollection(mDoc); - if (AEC.ShowDialog() == DialogResult.OK) - { - RemoveCollectionsMenu(); - BuildCollectionsMenu(); - } - } } } diff --git a/TVRename/Forms/UI.resx b/TVRename/Forms/UI.resx index b4bfa1d05..db513d471 100644 --- a/TVRename/Forms/UI.resx +++ b/TVRename/Forms/UI.resx @@ -120,19 +120,6 @@ 139, 17 - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1 - MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAACwwAAAsMAT9AIsgAAAE7SURBVDhPlZIhc4QwEIX5S5W1 - lUjkWWQlEotERmKRyJOxkZErYyMjI7dvEzg4kk6nmfnmuMm+717CNcxcZTGBlfYvhpUyi+V5NRjJc0Xw - QEKyfDhxIabPWQceIZK5algQgQwbd/KkyHCkZ4WGE5pUw4IIZNhiWJCQhuBoIXvdZOth4SXASRIXybaL - HiJwumVv+oJCcJNIi9TAPT/xg+WqCi6SmyBydDNQHP0CtrQpAkLo4CqRvSzYDgHCIOienfr4k7OBCGJg - rwf2W8d+bTlYlQZ+WyIIyGTBer0D9NrJRylBzVuDJJCAnP/EU8YBQiNrZzZmYiKbBN1o9te4VATpQicw - ggF8gwdHajGaBVjp/9I4le/gDN7DPcjhSF8VwYwvOFc64/4m3kWAICPIAAfzLiDVskj+g2SygJsf4FxG - MwKGJzMAAAAASUVORK5CYII= - - 17, 95 @@ -141,7 +128,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADk - HQAAAk1TRnQBSQFMAgEBEwEAARABBAEQAQQBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + HQAAAk1TRnQBSQFMAgEBEwEAAbABAwGwAQMBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAAVADAAEBAQABCAYAARQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -271,6 +258,7 @@ AgABgAEBAgABgAEBAgABwAEDAgABgAEBAgAB8AEPAgAC/wIACw== + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 @@ -286,7 +274,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC0 - HQAAAk1TRnQBSQFMAgEBCwEAASwBBAEsAQQBEgEAAQ0BAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFI + HQAAAk1TRnQBSQFMAgEBCwEAAcwBAwHMAQMBEgEAAQ0BAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFI AwABJwMAAQEBAAEYBQAB6AEgGAAD7wMSBjADCQYwAw8DKgMwAxsD0Q8AASEB1gEIASEB1gEIASEB1gEI ASEB1gEIMAAC+AH3AfMB6AHaAfEB0wG2AeEBswGMAdYBnAFxAdIBlAFoAdIBlAFnAdQBmgFvAd8BrQGG AfAB0QGzAfMB5gHVAfcB9gH1RQAD7wM8A58D5gMwA+ADzgNPA9gDtwOPA9EMAAEhAdYBCAEhAdYBCAEh @@ -724,7 +712,7 @@ 829, 56 - 81 + 112 diff --git a/TVRename/Forms/Utilities/RecoverXML.resx b/TVRename/Forms/Utilities/RecoverXML.resx index bacb4057a..bcc03471a 100644 --- a/TVRename/Forms/Utilities/RecoverXML.resx +++ b/TVRename/Forms/Utilities/RecoverXML.resx @@ -112,12 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + AAABAAIAICAQAAAABADoAgAAJgAAABAQEAAAAAQAKAEAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAAAAAC diff --git a/TVRename/Properties/AssemblyInfo.cs b/TVRename/Properties/AssemblyInfo.cs index f9954e926..d23a4905d 100644 --- a/TVRename/Properties/AssemblyInfo.cs +++ b/TVRename/Properties/AssemblyInfo.cs @@ -14,8 +14,6 @@ [assembly: Guid("3b5746c1-a5f7-48c2-a8de-95619489049b")] [assembly: NeutralResourcesLanguageAttribute("")] - [assembly: AssemblyVersion("2.5.3.0")] [assembly: AssemblyFileVersion("2.5.3")] -[assembly: AssemblyInformationalVersion("2.5.5")] // Display version - +[assembly: AssemblyInformationalVersion("2.5.3")] // Display version diff --git a/TVRename/Resources/openFile.png b/TVRename/Resources/openFile.png deleted file mode 100644 index e2dcf54594ad9d5c0996a57a4f3da87c36dde5cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 495 zcmV(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRZ-bxA})RCwBqlc96lFc`&u-5JPCVF~n~(6I#uuCT0ug@uKq9SdC8LdOON8){~_ zu?ogaVt(u!kR8XXFSqYbC&}mc^ZTCU8#80B4s|khI`2ap^P&^0QanF=x&gqUg9qFx_}Ifg7Z=5C;D9z|1|78!~+w+1h#E197v=PAO(fn|ApLwbQX?zcm165T4~bac#P`llZ=PV1uQ__DAp8G l$gK$bd;Y(U$c;Dm?*LdL$i<^CZu9^E002ovPDHLkV1kSu+(iHY diff --git a/TVRename/Settings/Settings.cs b/TVRename/Settings/Settings.cs index 276666d6e..4df6e33c6 100644 --- a/TVRename/Settings/Settings.cs +++ b/TVRename/Settings/Settings.cs @@ -77,7 +77,6 @@ public class ShowStatusColoringTypeList : Dictionary 1) - { - SeasonFolderFormat = defaultSeasonWord.Trim() + " " + (LeadingZeroOnSeason ? "{Season:2}" : "{Season}"); - } - else - { - SeasonFolderFormat = defaultSeasonWord.Trim() + (LeadingZeroOnSeason ? "{Season:2}" : "{Season}"); - } + SeasonFolderFormat = defaultSeasonWord.Trim() +" " + (LeadingZeroOnSeason ? "{Season:2}": "{Season}"); } } @@ -893,8 +879,6 @@ public void WriteXML(XmlWriter writer) TheSearchers.WriteXML(writer); XmlHelper.WriteElementToXml(writer,"BGDownload",BGDownload); XmlHelper.WriteElementToXml(writer,"OfflineMode",OfflineMode); - XmlHelper.WriteElementToXml(writer,"ShowCollections", ShowCollections); - XmlHelper.WriteElementToXml(writer, "DeleteShowFromDisk", DeleteShowFromDisk); writer.WriteStartElement("Replacements"); foreach (Replacement R in Replacements) { diff --git a/TVRename/TVRename.csproj b/TVRename/TVRename.csproj index 8dfcb7e63..e881cb4b9 100644 --- a/TVRename/TVRename.csproj +++ b/TVRename/TVRename.csproj @@ -132,12 +132,6 @@ - - Form - - - AddEditCollection.cs - Form @@ -218,7 +212,6 @@ - @@ -397,9 +390,6 @@ - - AddEditCollection.cs - ActorsGrid.cs Designer diff --git a/TVRename/TVRename.csproj.user b/TVRename/TVRename.csproj.user deleted file mode 100644 index d14eb3bf7..000000000 --- a/TVRename/TVRename.csproj.user +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/TVRename/TVRename/PathManager.cs b/TVRename/TVRename/PathManager.cs index 8a8154d68..600b46a04 100644 --- a/TVRename/TVRename/PathManager.cs +++ b/TVRename/TVRename/PathManager.cs @@ -10,18 +10,13 @@ public static class PathManager private const string SETTINGS_FILE_NAME = "TVRenameSettings.xml"; private const string UI_LAYOUT_FILE_NAME = "Layout.xml"; private const string STATISTICS_FILE_NAME = "Statistics.xml"; - private const string SHOWS_FILE_NAME = "TVRenameShows.xml"; - private const string SHOWS_COLLECTION_FILE_NAME = "TVRenameColls.xml"; - private const string SHOWS_DEFAULT_COLLECTION = "2.1"; private static string UserDefinedBasePath; - private static string SHOWS_COLLECTION = ""; public static FileInfo[] GetPossibleSettingsHistory() { return new DirectoryInfo(System.IO.Path.GetDirectoryName(TVDocSettingsFile.FullName)).GetFiles(SETTINGS_FILE_NAME + "*"); } - public static FileInfo[] GetPossibleTvdbHistory() { return new DirectoryInfo(System.IO.Path.GetDirectoryName(TVDocSettingsFile.FullName)).GetFiles(TVDB_FILE_NAME + "*"); @@ -53,40 +48,6 @@ private static FileInfo GetFileInfo(string path, string file) return new FileInfo(System.IO.Path.Combine(path, file)); } - public static string ShowCollection - { - get - { - return SHOWS_COLLECTION; - } - set - { - if (value != SHOWS_DEFAULT_COLLECTION) - { - SHOWS_COLLECTION = value; - } - else - { - SHOWS_COLLECTION = ""; - } - } - } - - public static FileInfo ShowCollectionFile - { - get - { - if (!string.IsNullOrEmpty(UserDefinedBasePath)) - { - return GetFileInfo(UserDefinedBasePath, SHOWS_COLLECTION_FILE_NAME); - } - else - { - return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename"), SHOWS_COLLECTION_FILE_NAME); - } - } - } - public static FileInfo StatisticsFile { get @@ -97,7 +58,7 @@ public static FileInfo StatisticsFile } else { - return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? SHOWS_COLLECTION : SHOWS_DEFAULT_COLLECTION)), STATISTICS_FILE_NAME); + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", "2.1"), STATISTICS_FILE_NAME); } } } @@ -113,7 +74,7 @@ public static FileInfo UILayoutFile } else { - return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? "" : SHOWS_DEFAULT_COLLECTION)), UI_LAYOUT_FILE_NAME); + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", "2.1"), UI_LAYOUT_FILE_NAME); } } } @@ -129,7 +90,7 @@ public static FileInfo TVDBFile } else { - return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? SHOWS_COLLECTION : SHOWS_DEFAULT_COLLECTION)), TVDB_FILE_NAME); + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", "2.1"), TVDB_FILE_NAME); } } } @@ -145,24 +106,10 @@ public static FileInfo TVDocSettingsFile } else { - return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? "" : SHOWS_DEFAULT_COLLECTION)), SETTINGS_FILE_NAME); + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", "2.1"), SETTINGS_FILE_NAME); } } } - public static FileInfo TVDocShowsFile - { - get - { - if (!string.IsNullOrEmpty(UserDefinedBasePath)) - { - return GetFileInfo(UserDefinedBasePath, SHOWS_FILE_NAME); - } - else - { - return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? SHOWS_COLLECTION : SHOWS_DEFAULT_COLLECTION)), (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? SHOWS_FILE_NAME : SETTINGS_FILE_NAME)); - } - } - } } } diff --git a/TVRename/TVRename/ShowCollection.cs b/TVRename/TVRename/ShowCollection.cs deleted file mode 100644 index 0dcbd51f9..000000000 --- a/TVRename/TVRename/ShowCollection.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using Alphaleonis.Win32.Filesystem; -using System.Text.RegularExpressions; -using System.Threading; -using System.Windows.Forms; -using System.Linq; -using System.Xml; -using Directory = Alphaleonis.Win32.Filesystem.Directory; -using DirectoryInfo = Alphaleonis.Win32.Filesystem.DirectoryInfo; -using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; -using System.Text; -using NodaTime.Extensions; - -namespace TVRename -{ - public class ShowCollection - { - public string Path { get; set; } - public string Name { get; set; } - public string Description { get; set; } - - public ShowCollection (string Pa) - { - Path = Pa; - } - - public ShowCollection (XmlReader reader) - { - LoadXMLCollectionItem(reader); - } - - public void WriteXMLCollectionItem (XmlWriter writer) - { - writer.WriteStartElement("CollectionItem"); - XmlHelper.WriteElementToXml(writer, "Path", Path); - XmlHelper.WriteElementToXml(writer, "Name", Name); - XmlHelper.WriteElementToXml(writer, "Description", Description); - writer.WriteEndElement(); - } - - private void LoadXMLCollectionItem (XmlReader reader) - { - reader.Read(); - while (!reader.EOF) - { - if ((reader.Name == "CollectionItem") && (!reader.IsStartElement())) - { - break; - } - - if (reader.Name == "Path") - { - Path = reader.ReadElementContentAsString(); - } - if (reader.Name == "Name") - { - Name = reader.ReadElementContentAsString(); - } - if (reader.Name == "Description") - { - Description = reader.ReadElementContentAsString(); - } - else - { - reader.ReadOuterXml(); - } - } - } - } -} diff --git a/TVRename/TVRename/TVDoc.cs b/TVRename/TVRename/TVDoc.cs index a501c8a48..039ccfe98 100644 --- a/TVRename/TVRename/TVDoc.cs +++ b/TVRename/TVRename/TVDoc.cs @@ -26,18 +26,9 @@ namespace TVRename { - public enum FileToHandle - { - Collections = 1, - Settings = 2, - Shows = 4, - TvDB = 8 - } - // ReSharper disable once InconsistentNaming public class TVDoc : IDisposable { - public readonly List ShowCollections; private readonly DownloadIdentifiersController downloadIdentifiers; private readonly List finders; public readonly ShowLibrary Library; @@ -58,22 +49,21 @@ public class TVDoc : IDisposable private bool currentlyBusy = false; // This is set to true when scanning and indicates to other objects not to commence a scan of their own private DateTime busySince; - public TVDoc(CommandLineArgs args) + public TVDoc(FileInfo settingsFile, CommandLineArgs args) { Args = args; - ShowCollections = new List(); - Library = new ShowLibrary(); - mStats = new TVRenameStats(); - actionManager = new ActionEngine(mStats); - cacheManager = new CacheUpdater(); + Library = new ShowLibrary(); + mStats = new TVRenameStats(); + actionManager = new ActionEngine(mStats); + cacheManager = new CacheUpdater(); - mDirty = false; - TheActionList = new ItemList(); + mDirty = false; + TheActionList = new ItemList(); - actionCancel = false; + actionCancel = false; - scanProgDlg = null; + scanProgDlg = null; finders = new List //These should be in order { @@ -85,23 +75,8 @@ public TVDoc(CommandLineArgs args) }; downloadIdentifiers = new DownloadIdentifiersController(); - LoadOk = LoadXMLFile(FileToHandle.Collections, true); - if (LoadOk) - { - LoadOk = LoadXMLFile(FileToHandle.TvDB | FileToHandle.Settings | FileToHandle.Shows, true); - } - } - - public void SwitchToCollection (string Collection) - { - PathManager.ShowCollection = Collection; - Library.Clear(); - TheActionList.Clear(); - - TheTVDB.Instance.ClearCache(); - - LoadXMLFile(FileToHandle.TvDB | FileToHandle.Settings | FileToHandle.Shows, false); + LoadOk = ((settingsFile == null) || LoadXMLSettings(settingsFile)) && TheTVDB.Instance.LoadOk; } public TVRenameStats Stats() @@ -268,88 +243,28 @@ private static List FindEpOnDisk(DirFilesCache dfc, ShowItem si, Episo return ret; } - public void WriteXMLFile (FileToHandle Files) + // ReSharper disable once InconsistentNaming + public void WriteXMLSettings() { + // backup old settings before writing new ones + FileHelper.Rotate(PathManager.TVDocSettingsFile.FullName); + Logger.Info("Saving Settings to {0}", PathManager.TVDocSettingsFile.FullName); + XmlWriterSettings settings = new XmlWriterSettings { Indent = true, NewLineOnAttributes = true }; - if ((Files & FileToHandle.Collections) > 0) + using (XmlWriter writer = XmlWriter.Create(PathManager.TVDocSettingsFile.FullName, settings)) { - FileHelper.Rotate(PathManager.ShowCollectionFile.FullName); - Logger.Info("Saving Collections to {0}", PathManager.ShowCollectionFile.FullName); - XmlWriter writer = XmlWriter.Create(PathManager.ShowCollectionFile.FullName, settings); - WriteXMLCollections(writer); - } - if ((Files & FileToHandle.Settings) > 0) - { - FileHelper.Rotate(PathManager.TVDocSettingsFile.FullName); - Logger.Info("Saving Settings to {0}", PathManager.TVDocSettingsFile.FullName); - XmlWriter writer = XmlWriter.Create(PathManager.TVDocSettingsFile.FullName, settings); - WriteXMLSettings(writer); - } - if (((Files & FileToHandle.Shows) > 0) && (!string.IsNullOrEmpty(PathManager.ShowCollection))) - { - FileHelper.Rotate(PathManager.TVDocShowsFile.FullName); - Logger.Info("Saving Shows to {0}", PathManager.TVDocShowsFile.FullName); - XmlWriter writer = XmlWriter.Create(PathManager.TVDocShowsFile.FullName, settings); - WriteXMLHeader(writer); - WriteXMLShows(writer); - } - - if ((Files & FileToHandle.TvDB) > 0) - { - TheTVDB.Instance.SaveCache(); - } - } - - private void WriteXMLCollections(XmlWriter writer) - { - using (writer) - { - WriteXMLHeader(writer); - - writer.WriteStartElement("Collections"); - foreach (ShowCollection sc in ShowCollections) - { - sc.WriteXMLCollectionItem(writer); - } + writer.WriteStartDocument(); + writer.WriteStartElement("TVRename"); - writer.WriteEndElement(); // Collections - XmlHelper.WriteElementToXml(writer, "Current", (PathManager.ShowCollection == "" ? "2.1" : PathManager.ShowCollection)); - - WriteXMLFooter(writer); - } - } - - // ReSharper disable once InconsistentNaming - private void WriteXMLSettings(XmlWriter writer) - { - using (writer) - { - WriteXMLHeader(writer); + XmlHelper.WriteAttributeToXml(writer, "Version", "2.1"); TVSettings.Instance.WriteXML(writer); // - if (string.IsNullOrEmpty(PathManager.ShowCollection)) - { - WriteXMLShows(writer); - } - else - { - WriteXMLFooter(writer); - } - } - - mDirty = false; - } - - private void WriteXMLShows(XmlWriter writer) - { - using (writer) - { writer.WriteStartElement("MyShows"); foreach (ShowItem si in Library.Values) si.WriteXmlSettings(writer); @@ -358,8 +273,10 @@ private void WriteXMLShows(XmlWriter writer) XmlHelper.WriteStringsToXml(TVSettings.Instance.LibraryFolders, writer, "MonitorFolders", "Folder"); XmlHelper.WriteStringsToXml(TVSettings.Instance.IgnoreFolders, writer, "IgnoreFolders", "Folder"); - XmlHelper.WriteStringsToXml(TVSettings.Instance.DownloadFolders, writer, "FinderSearchFolders", "Folder"); - XmlHelper.WriteStringsToXml(TVSettings.Instance.IgnoredAutoAddHints, writer, "IgnoredAutoAddHints", "Hint"); + XmlHelper.WriteStringsToXml(TVSettings.Instance.DownloadFolders, writer, "FinderSearchFolders", + "Folder"); + XmlHelper.WriteStringsToXml(TVSettings.Instance.IgnoredAutoAddHints, writer, "IgnoredAutoAddHints", + "Hint"); writer.WriteStartElement("IgnoreItems"); foreach (IgnoreItem ii in TVSettings.Instance.Ignore) @@ -367,377 +284,118 @@ private void WriteXMLShows(XmlWriter writer) writer.WriteEndElement(); // IgnoreItems - WriteXMLFooter(writer); + writer.WriteEndElement(); // tvrename + writer.WriteEndDocument(); } mDirty = false; Stats().Save(); } - private static void WriteXMLHeader(XmlWriter writer) - { - writer.WriteStartDocument(); - writer.WriteStartElement("TVRename"); - - XmlHelper.WriteAttributeToXml(writer, "Version", "2.1"); - } - - private static void WriteXMLFooter(XmlWriter writer) - { - writer.WriteEndElement(); // tvrename - writer.WriteEndDocument(); - } - - private bool LoadXMLFile (FileToHandle Files, bool bInit) + // ReSharper disable once InconsistentNaming + private bool LoadXMLSettings(FileInfo from) { - bool bLoadOk = false; - XmlReaderSettings settings = new XmlReaderSettings - { - IgnoreComments = true, - IgnoreWhitespace = true - }; - - if ((Files & FileToHandle.Collections) > 0) - { - bLoadOk = ReadXMLCollections(settings, ShowCollections, LoadErr); - } - if ((Files & FileToHandle.TvDB) > 0) - { - bLoadOk = ReadXMLTvDBCache(bInit, Args); - } - if ((Files & FileToHandle.Settings) > 0) - { - bLoadOk = ReadXMLSettings(settings, LoadErr); - } - if ((Files & FileToHandle.Shows) > 0) - { - bLoadOk = ReadXMLShows(settings, Library, mStats, LoadErr); - } - - return bLoadOk; - } + Logger.Info("Loading Settings from {0}", from?.FullName); + if (from == null) + return true; - private static bool ReadXMLCollections(XmlReaderSettings settings, List lSc, string Err) - { - bool bLoadOk; - FileInfo showColls = PathManager.ShowCollectionFile; - Logger.Info("Loading Collections from {0}", showColls.FullName); - if (showColls == null) - { - bLoadOk = true; - } - else + try { - try + XmlReaderSettings settings = new XmlReaderSettings { - XmlReader reader = XmlReader.Create(showColls.FullName, settings); - bLoadOk = LoadXMLCollections(reader, showColls, lSc, Err); - } - catch (Exception e) - { - if (!showColls.Exists) - { - bLoadOk = true; - } - else - { - Logger.Warn(e, "Problem on Startup loading Collection File"); - Err = showColls.Name + " : " + e.Message; - bLoadOk = false; - } - } - } - return bLoadOk; - } + IgnoreComments = true, + IgnoreWhitespace = true + }; - private static bool ReadXMLTvDBCache (bool bInit, CommandLineArgs args) - { - bool bLoadOk; - FileInfo tvdbFile = PathManager.TVDBFile; - if (tvdbFile == null) - { - bLoadOk = true; - } - else - { - if (bInit) + if (!from.Exists) { - TheTVDB.Instance.Setup(tvdbFile, PathManager.TVDBFile, args); + return true; // that's ok } - else - { - TheTVDB.Instance.RelaodCache(tvdbFile, PathManager.TVDBFile); - } - bLoadOk = TheTVDB.Instance.LoadOk; - } - return bLoadOk; - } - private static bool LoadXMLCollections(XmlReader reader, FileInfo from, List lSc, string Err) - { - using (reader) - { - bool bGoodHeader = ReadXmlHeaderFromFile(reader, from, "Collections", Err); - if (bGoodHeader) + using (XmlReader reader = XmlReader.Create(from.FullName, settings)) { - while (!reader.EOF) + reader.Read(); + if (reader.Name != "xml") { - if (reader.Name == "TVRename" && !reader.IsStartElement()) - { - break; // end of it all - } - - if (reader.Name == "Collections") - { - LoadXMLEveryCollection(reader, lSc); - } - else if (reader.Name == "Current") - { - PathManager.ShowCollection = reader.ReadElementContentAsString(); - } - else - { - reader.ReadOuterXml(); - } - reader.Read(); + LoadErr = from.Name + " : Not a valid XML file"; + return false; } - } - } - - return true; - } - - private static void LoadXMLEveryCollection (XmlReader reader, List Lsc) - { - while (!reader.EOF) - { - reader.Read(); - if ((reader.Name == "Collections") && (!reader.IsStartElement())) - { - break; - } + reader.Read(); - if (reader.Name == "CollectionItem") - { - ShowCollection Collection = new ShowCollection(reader); - - Lsc.Add(Collection); - } - else - { - reader.ReadOuterXml(); - } - } - } - - private static bool ReadXMLSettings(XmlReaderSettings settings, string Err) - { - bool bLoadOk; - - FileInfo settingsFile = PathManager.TVDocSettingsFile; - Logger.Info("Loading Settings from {0}", settingsFile.FullName); - if (settingsFile == null) - { - bLoadOk = true; - } - else - { - try - { - XmlReader reader = XmlReader.Create(settingsFile.FullName, settings); - bLoadOk = LoadXMLSettings(reader, settingsFile, Err); - } - catch (Exception e) - { - if (!settingsFile.Exists) + if (reader.Name != "TVRename") { - bLoadOk = true; + LoadErr = from.Name + " : Not a TVRename settings file"; + return false; } - else + + if (reader.GetAttribute("Version") != "2.1") { - Logger.Warn(e, "Problem on Startup loading Settings File"); - Err = settingsFile.Name + " : " + e.Message; - bLoadOk = false; + LoadErr = from.Name + " : Incompatible version"; + return false; } - } - } - return bLoadOk; - } - // ReSharper disable once InconsistentNaming - private static bool LoadXMLSettings(XmlReader reader, FileInfo from, string Err) - { - using (reader) - { - bool bGoodHeader = ReadXmlHeaderFromFile(reader, from, "Settings", Err); - if (bGoodHeader) - { + reader.Read(); // move forward one + while (!reader.EOF) { if (reader.Name == "TVRename" && !reader.IsStartElement()) - { break; // end of it all - } if (reader.Name == "Settings") { TVSettings.Instance.load(reader.ReadSubtree()); reader.Read(); } - else + else if (reader.Name == "MyShows") { - reader.ReadOuterXml(); + Library.LoadFromXml(reader.ReadSubtree()); + reader.Read(); } - } - } - } - return true; - } - - private static bool ReadXMLShows(XmlReaderSettings settings, ShowLibrary Sl, TVRenameStats St, string Err) - { - bool bLoadOk; - FileInfo showsFile = PathManager.TVDocShowsFile; - Logger.Info("Loading Shows from {0}", showsFile.FullName); - if (showsFile == null) - { - bLoadOk = true; - } - else - { - try - { - XmlReader reader = XmlReader.Create(showsFile.FullName, settings); - bLoadOk = LoadXMLSHows(reader, showsFile, Sl, Err); - try - { - St = TVRenameStats.Load(); - } - catch (Exception) - { - // not worried if stats loading fails - } - } - catch (Exception e) - { - if (!showsFile.Exists) - { - bLoadOk = true; - } - else - { - Logger.Warn(e, "Problem on Startup loading Shows File"); - Err = showsFile.Name + " : " + e.Message; - bLoadOk = false; - } - } - } - return bLoadOk; - } - - private static bool LoadXMLSHows(XmlReader reader, FileInfo from, ShowLibrary Sl, string Err) - { - using (reader) - { - bool bGoodHeader = ReadXmlHeaderFromFile(reader, from, "Shows", Err); - if (bGoodHeader) - { - while (!reader.EOF) - { - if (reader.Name == "TVRename" && !reader.IsStartElement()) + else if (reader.Name == "MonitorFolders") + TVSettings.Instance.LibraryFolders = + XmlHelper.ReadStringsFromXml(reader, "MonitorFolders", "Folder"); + else if (reader.Name == "IgnoreFolders") + TVSettings.Instance.IgnoreFolders = + XmlHelper.ReadStringsFromXml(reader, "IgnoreFolders", "Folder"); + else if (reader.Name == "FinderSearchFolders") + TVSettings.Instance.DownloadFolders = + XmlHelper.ReadStringsFromXml(reader, "FinderSearchFolders", "Folder"); + else if (reader.Name == "IgnoredAutoAddHints") + TVSettings.Instance.IgnoredAutoAddHints = + XmlHelper.ReadStringsFromXml(reader, "IgnoredAutoAddHints", "Hint"); + else if (reader.Name == "IgnoreItems") { - break; // end of it all - } + XmlReader r2 = reader.ReadSubtree(); + r2.Read(); + r2.Read(); + while (r2.Name == "Ignore") + TVSettings.Instance.Ignore.Add(new IgnoreItem(r2)); - if (reader.Name == "MyShows") - { - Sl.LoadFromXml(reader.ReadSubtree()); reader.Read(); } - LoadXMLShowFolderStuff(reader); + else + reader.ReadOuterXml(); } } } - - return true; - } - - private static void LoadXMLShowFolderStuff(XmlReader reader) - { - if (reader.Name == "MonitorFolders") - { - TVSettings.Instance.LibraryFolders = - XmlHelper.ReadStringsFromXml(reader, "MonitorFolders", "Folder"); - } - else if (reader.Name == "IgnoreFolders") - { - TVSettings.Instance.IgnoreFolders = - XmlHelper.ReadStringsFromXml(reader, "IgnoreFolders", "Folder"); - } - else if (reader.Name == "FinderSearchFolders") - { - TVSettings.Instance.DownloadFolders = - XmlHelper.ReadStringsFromXml(reader, "FinderSearchFolders", "Folder"); - } - else if (reader.Name == "IgnoredAutoAddHints") - { - TVSettings.Instance.IgnoredAutoAddHints = - XmlHelper.ReadStringsFromXml(reader, "IgnoredAutoAddHints", "Hint"); - } - else if (reader.Name == "IgnoreItems") - { - XmlReader r2 = reader.ReadSubtree(); - r2.Read(); - r2.Read(); - while (r2.Name == "Ignore") - { - TVSettings.Instance.Ignore.Add(new IgnoreItem(r2)); - } - - reader.Read(); - } - else + catch (Exception e) { - reader.ReadOuterXml(); + Logger.Warn(e, "Problem on Startup loading File"); + LoadErr = from.Name + " : " + e.Message; + return false; } - } - - private static bool ReadXmlHeaderFromFile (XmlReader reader, FileInfo from, string contains, string Err) - { - bool bIsValidHeader; - reader.Read(); - if (reader.Name != "xml") + try { - Err = from.Name + " : Not a valid XML file"; - bIsValidHeader = false; + mStats = TVRenameStats.Load(); } - else + catch (Exception) { - reader.Read(); - if (reader.Name != "TVRename") - { - Err = from.Name + " : Not a TVRename " + contains + " file"; - bIsValidHeader = false; - } - else - { - if (reader.GetAttribute("Version") != "2.1") - { - Err = from.Name + " : Incompatible version"; - bIsValidHeader = false; - } - else - { - reader.Read(); // move forward one - Err = ""; - bIsValidHeader = true; - } - } + // not worried if stats loading fails } - return bIsValidHeader; + return true; } private void OutputActionFiles(TVSettings.ScanType st) diff --git a/TVRename/TheTVDB/Episode.cs b/TVRename/TheTVDB/Episode.cs index 88b1b3f90..6b5259e04 100644 --- a/TVRename/TheTVDB/Episode.cs +++ b/TVRename/TheTVDB/Episode.cs @@ -360,9 +360,9 @@ private void LoadJson(int seriesId, JObject r) else if (!int.TryParse(dvdEpNumString, out DvdEpNum)) DvdEpNum = 0; SrvLastUpdated = (long) r["lastUpdated"]; - Overview = System.Web.HttpUtility.HtmlDecode((string) r["overview"]); + Overview = System.Web.HttpUtility.HtmlDecode((string)r["overview"]); EpisodeRating = (string) r["siteRating"]; - Name = System.Web.HttpUtility.HtmlDecode((string) r["episodeName"]); + Name = System.Web.HttpUtility.HtmlDecode((string)r["episodeName"]); string sn = (string) r["airedSeason"]; if (sn == null) diff --git a/TVRename/TheTVDB/SeriesInfo.cs b/TVRename/TheTVDB/SeriesInfo.cs index e0f759902..126ad4b6a 100644 --- a/TVRename/TheTVDB/SeriesInfo.cs +++ b/TVRename/TheTVDB/SeriesInfo.cs @@ -441,7 +441,7 @@ private void LoadJson(JObject bestLanguageR, JObject backupLanguageR) } //Looking at the data then the aliases, banner and runtime are also different by language - + if ((string.IsNullOrWhiteSpace(Items["aliases"]))) { Items["aliases"] = JsonHelper.Flatten(backupLanguageR["aliases"], "|"); diff --git a/TVRename/TheTVDB/TheTVDB.cs b/TVRename/TheTVDB/TheTVDB.cs index 9043b22d4..964b6de7f 100644 --- a/TVRename/TheTVDB/TheTVDB.cs +++ b/TVRename/TheTVDB/TheTVDB.cs @@ -219,42 +219,6 @@ private bool LoadCache(FileInfo loadFrom) } } - public void RelaodCache(FileInfo loadFrom, FileInfo cache) - { - System.Diagnostics.Debug.Assert(cache != null); - cacheFile = cache; - - LastError = ""; - Connected = false; - extraEpisodes.Clear(); - removeEpisodeIds.Clear(); - - LanguageList = new List { new Language(7, "en", "English", "English") }; - - //assume that the data is up to date (this will be overridden by the value in the XML if we have a prior install) - //If we have no prior install then the app has no shows and is by definition up-to-date - newSrvTime = DateTime.UtcNow.ToUnixTime(); - - srvTime = 0; - - LoadOk = (loadFrom == null) || LoadCache(loadFrom); - - forceReloadOn.Clear(); - } - - public void ClearCache() - { - if (!GetLock("ClearCache")) - return; - - series.Clear(); - extraEpisodes.Clear(); - removeEpisodeIds.Clear(); - Unlock("ClearCache"); - - newSrvTime = DateTime.UtcNow.ToUnixTime(); - } - public void UpdatesDoneOk() { // call when all downloading and updating is done. updates local Srv_Time with the tentative @@ -462,7 +426,7 @@ public byte[] GetTvdbDownload(string url, bool forceReload = false) } } - public void ForgetEverything() + public void ForgetEverything() { if (!GetLock("ForgetEverything")) return; From 654cb9cef960e93c83a737b077c6a9b797e10845 Mon Sep 17 00:00:00 2001 From: Chlorel Date: Mon, 15 Oct 2018 17:32:26 +0200 Subject: [PATCH 03/12] Back to past --- TVRename/App/ApplicationBase.cs | 39 +- TVRename/Custom Controls/MyListView.cs | 2 +- TVRename/Finders/FileFinder.cs | 74 ++- TVRename/Finders/Finder.cs | 3 +- TVRename/Finders/SABnzbdFinder.cs | 2 +- TVRename/Finders/qBitTorrentFinder.cs | 1 + TVRename/Forms/BulkAdd/BulkAdd.cs | 1 + .../Collection/AddEditCollection.Designer.cs | 266 +++++++++ .../Forms/Collection/AddEditCollection.cs | 228 ++++++++ .../Forms/Collection/AddEditCollection.resx | 213 +++++++ .../Forms/Preferences/AddEditSearchEngine.cs | 2 +- .../Forms/Preferences/CustomNameDesigner.cs | 28 +- .../Forms/Preferences/Preferences.Designer.cs | 72 ++- TVRename/Forms/Preferences/Preferences.cs | 4 + TVRename/Forms/Supporting/CopyMoveProgress.cs | 11 +- .../Supporting/UpdateNotification.Designer.cs | 3 +- .../Forms/Supporting/UpdateNotification.cs | 67 ++- TVRename/Forms/Tools/ActorsGrid.cs | 6 +- TVRename/Forms/Tools/ShowSummary.cs | 2 +- TVRename/Forms/UI.Designer.cs | 509 +++++++++-------- TVRename/Forms/UI.cs | 134 ++++- TVRename/Forms/UI.resx | 20 +- TVRename/Forms/Utilities/RecoverXML.cs | 2 +- TVRename/Forms/Utilities/RecoverXML.resx | 6 +- .../ItemsAndActions/ActionCopyMoveRename.cs | 7 +- TVRename/ItemsAndActions/ActionDateTouch.cs | 53 +- TVRename/ItemsAndActions/ActionDelete.cs | 10 +- .../ItemsAndActions/ActionDownloadImage.cs | 46 +- TVRename/ItemsAndActions/ActionItem.cs | 115 ++-- TVRename/ItemsAndActions/ActionItemSorter.cs | 4 +- .../ItemsAndActions/ActionMede8erViewXML.cs | 25 +- TVRename/ItemsAndActions/ActionPyTivoMeta.cs | 1 + TVRename/ItemsAndActions/ActionRSS.cs | 28 +- TVRename/ItemsAndActions/ItemDownloading.cs | 67 ++- TVRename/ItemsAndActions/ItemMissing.cs | 36 +- TVRename/Properties/AssemblyInfo.cs | 4 +- TVRename/Resources/openFile.png | Bin 0 -> 495 bytes TVRename/Settings/Searchers.cs | 49 +- TVRename/Settings/Settings.cs | 30 +- TVRename/TVRename.csproj | 22 +- TVRename/TVRename/ActionEngine.cs | 4 +- TVRename/TVRename/PathManager.cs | 61 +- TVRename/TVRename/ShowCollection.cs | 72 +++ TVRename/TVRename/ShowLibrary.cs | 15 +- TVRename/TVRename/TVDoc.cs | 520 +++++++++++++++--- TVRename/TheTVDB/Actor.cs | 11 +- TVRename/TheTVDB/Episode.cs | 4 +- TVRename/TheTVDB/Season.cs | 55 +- TVRename/TheTVDB/SeriesInfo.cs | 2 +- TVRename/TheTVDB/TheTVDB.cs | 413 +++++++------- TVRename/Utility/BT.cs | 8 +- TVRename/Utility/DownloadInformation.cs | 2 +- TVRename/Utility/SAB/QueueSlotsSlot.cs | 8 +- 53 files changed, 2450 insertions(+), 917 deletions(-) create mode 100644 TVRename/Forms/Collection/AddEditCollection.Designer.cs create mode 100644 TVRename/Forms/Collection/AddEditCollection.cs create mode 100644 TVRename/Forms/Collection/AddEditCollection.resx create mode 100644 TVRename/Resources/openFile.png create mode 100644 TVRename/TVRename/ShowCollection.cs diff --git a/TVRename/App/ApplicationBase.cs b/TVRename/App/ApplicationBase.cs index 304b1c625..85e9a1e98 100644 --- a/TVRename/App/ApplicationBase.cs +++ b/TVRename/App/ApplicationBase.cs @@ -54,6 +54,8 @@ protected override void OnCreateMainForm() recoverText = "Recover manually requested."; } + PathManager.ShowCollection = ""; + // Check arguments for custom settings path if (!string.IsNullOrEmpty(clargs.UserFilePath)) { @@ -71,12 +73,26 @@ protected override void OnCreateMainForm() } } - FileInfo tvdbFile = PathManager.TVDBFile; - FileInfo settingsFile = PathManager.TVDocSettingsFile; TVDoc doc; do // Loop until files correctly load { + // Try loading settings file + doc = new TVDoc(clargs); + + FileInfo tvdbFile = PathManager.TVDBFile; + FileInfo showsFile = PathManager.TVDocShowsFile; + + if (recover) doc.SetDirty(); + recover = !doc.LoadOk; + + // Continue if correctly loaded + if (!recover) continue; + + // Set recover message + recoverText = string.Empty; + if (!doc.LoadOk && !string.IsNullOrEmpty(doc.LoadErr)) recoverText = doc.LoadErr; + if (!TheTVDB.Instance.LoadOk && !string.IsNullOrEmpty(TheTVDB.Instance.LoadErr)) recoverText += $"{Environment.NewLine}{TheTVDB.Instance.LoadErr}"; if (recover) // Recovery required, prompt user { RecoverXML recoveryForm = new RecoverXML(recoverText); @@ -84,7 +100,7 @@ protected override void OnCreateMainForm() if (recoveryForm.ShowDialog() == DialogResult.OK) { tvdbFile = recoveryForm.DbFile; - settingsFile = recoveryForm.SettingsFile; + showsFile = recoveryForm.SettingsFile; } else { @@ -92,23 +108,6 @@ protected override void OnCreateMainForm() return; } } - - // Try loading TheTVDB cache file - TheTVDB.Instance.Setup(tvdbFile, PathManager.TVDBFile, clargs); - - // Try loading settings file - doc = new TVDoc(settingsFile, clargs); - - if (recover) doc.SetDirty(); - recover = !doc.LoadOk; - - // Continue if correctly loaded - if (!recover) continue; - - // Set recover message - recoverText = string.Empty; - if (!doc.LoadOk && !string.IsNullOrEmpty(doc.LoadErr)) recoverText = doc.LoadErr; - if (!TheTVDB.Instance.LoadOk && !string.IsNullOrEmpty(TheTVDB.Instance.LoadErr)) recoverText += $"{Environment.NewLine}{TheTVDB.Instance.LoadErr}"; } while (recover); ConvertSeriesTimeZones(doc, TheTVDB.Instance); diff --git a/TVRename/Custom Controls/MyListView.cs b/TVRename/Custom Controls/MyListView.cs index ab77c9a52..61fd656b7 100644 --- a/TVRename/Custom Controls/MyListView.cs +++ b/TVRename/Custom Controls/MyListView.cs @@ -53,7 +53,7 @@ protected override void OnItemSelectionChanged(ListViewItemSelectionChangedEvent protected override void OnItemCheck(ItemCheckEventArgs ice) { - if (!menuCheck && !keyCheck && !checkEnable) + if (!menuCheck && !keyCheck && (false == checkEnable)) { ice.NewValue = ice.CurrentValue; return; diff --git a/TVRename/Finders/FileFinder.cs b/TVRename/Finders/FileFinder.cs index 2c21a8e5e..eacbb41c3 100644 --- a/TVRename/Finders/FileFinder.cs +++ b/TVRename/Finders/FileFinder.cs @@ -180,13 +180,27 @@ private void KeepTogether(ItemList actionlist) if ((TVSettings.Instance.RenameTxtToSub) && (newName.EndsWith(".txt"))) newName = newName.Substring(0, newName.Length - 4) + ".sub"; - ActionCopyMoveRename newitem = new ActionCopyMoveRename(action.Operation, fi, FileHelper.FileInFolder(action.To.Directory, newName), action.Episode, null, null); // tidyup on main action, not this + ActionCopyMoveRename newitem = new ActionCopyMoveRename(action.Operation, fi, FileHelper.FileInFolder(action.To.Directory, newName), action.Episode, null,null); // tidyup on main action, not this // check this item isn't already in our to-do list - if (ActionListContains(actionlist, newitem)) continue; + bool doNotAdd = false; + foreach (Item ai2 in actionlist) + { + if (!(ai2 is ActionCopyMoveRename)) + continue; + + if (((ActionCopyMoveRename)(ai2)).SameSource(newitem)) + { + doNotAdd = true; + break; + } + } - if (!newitem.SameAs(action)) // don't re-add ourself - extras.Add(newitem); + if (!doNotAdd) + { + if (!newitem.SameAs(action)) // don't re-add ourself + extras.Add(newitem); + } } } catch (System.IO.PathTooLongException e) @@ -201,50 +215,30 @@ private void KeepTogether(ItemList actionlist) foreach (Item action in extras) { // check we don't already have this in our list and, if we don't add it! - bool have = AlreadyHaveAction(actionlist, action); - - if (!have) - actionlist.Insert(0, action); // put before other actions, so tidyup is run last - } - } - - private static bool AlreadyHaveAction(ItemList actionlist, Item action) - { - foreach (Item action2 in actionlist) - { - if (action2.SameAs(action)) + bool have = false; + foreach (Item action2 in actionlist) { - return true; - } + if (action2.SameAs(action)) + { + have = true; + break; + } - if ((action is Action a1) && (action2 is Action a2)) - { - if (a2.Produces == a1.Produces) + if ((action is Action a1) && (action2 is Action) ) { - return true; + Action a2 = (Action)action2; + if (a2.Produces == a1.Produces) + { + have = true; + break; + } } } - } - return false; - } - - private static bool ActionListContains(ItemList actionlist, ActionCopyMoveRename newitem) - { - foreach (Item ai2 in actionlist) - { - if (!(ai2 is ActionCopyMoveRename)) - continue; - - if (((ActionCopyMoveRename)(ai2)).SameSource(newitem)) - { - return true; - } + if (!have) + actionlist.Insert(0, action); // put before other actions, so tidyup is run last } - - return false; } - // consider each of the files, see if it is suitable for series "ser" and episode "epi" // if so, add a rcitem for copy to "fi" diff --git a/TVRename/Finders/Finder.cs b/TVRename/Finders/Finder.cs index 328400ff8..d205a1a13 100644 --- a/TVRename/Finders/Finder.cs +++ b/TVRename/Finders/Finder.cs @@ -4,7 +4,6 @@ public abstract class Finder { public enum DownloadApp { - // ReSharper disable once InconsistentNaming SABnzbd, uTorrent, qBitTorrent @@ -19,7 +18,7 @@ public enum DownloadApp protected Finder(TVDoc doc) => Doc = doc; // ReSharper disable once InconsistentNaming - public enum FinderDisplayType { local, downloading, rss} + public enum FinderDisplayType { local, downloading, rss}; public abstract void Check(SetProgressDelegate prog, int startpct, int totPct); diff --git a/TVRename/Finders/SABnzbdFinder.cs b/TVRename/Finders/SABnzbdFinder.cs index 882973903..bff0cfad9 100644 --- a/TVRename/Finders/SABnzbdFinder.cs +++ b/TVRename/Finders/SABnzbdFinder.cs @@ -80,7 +80,7 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) } System.Diagnostics.Debug.Assert(sq != null); // shouldn't happen - if (sq.slots == null || sq.slots.Length == 0) // empty queue + if (sq?.slots == null || sq.slots.Length == 0) // empty queue return; ItemList newList = new ItemList(); diff --git a/TVRename/Finders/qBitTorrentFinder.cs b/TVRename/Finders/qBitTorrentFinder.cs index c7baff8bb..6ec305268 100644 --- a/TVRename/Finders/qBitTorrentFinder.cs +++ b/TVRename/Finders/qBitTorrentFinder.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Net; using System.Net.Http; +using System.Threading.Tasks; namespace TVRename { diff --git a/TVRename/Forms/BulkAdd/BulkAdd.cs b/TVRename/Forms/BulkAdd/BulkAdd.cs index 0435cc538..8f2288c44 100644 --- a/TVRename/Forms/BulkAdd/BulkAdd.cs +++ b/TVRename/Forms/BulkAdd/BulkAdd.cs @@ -7,6 +7,7 @@ // using System.Collections.Generic; +using System.Linq; using System.Windows.Forms; using System.Threading; using DirectoryInfo = Alphaleonis.Win32.Filesystem.DirectoryInfo; diff --git a/TVRename/Forms/Collection/AddEditCollection.Designer.cs b/TVRename/Forms/Collection/AddEditCollection.Designer.cs new file mode 100644 index 000000000..4c2f1c0a2 --- /dev/null +++ b/TVRename/Forms/Collection/AddEditCollection.Designer.cs @@ -0,0 +1,266 @@ +namespace TVRename +{ + partial class AddEditCollection + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddEditCollection)); + this.TvColl = new System.Windows.Forms.TreeView(); + this.TxtCollPath = new System.Windows.Forms.TextBox(); + this.TxtCollName = new System.Windows.Forms.TextBox(); + this.TxtCollDesc = new System.Windows.Forms.TextBox(); + this.LblFolder = new System.Windows.Forms.Label(); + this.LblCollName = new System.Windows.Forms.Label(); + this.LblCollDesc = new System.Windows.Forms.Label(); + this.PnlCollAddUpdate = new System.Windows.Forms.Panel(); + this.BtCancel = new System.Windows.Forms.Button(); + this.BtSave = new System.Windows.Forms.Button(); + this.BtOk = new System.Windows.Forms.Button(); + this.BtUp = new System.Windows.Forms.Button(); + this.ImgList = new System.Windows.Forms.ImageList(this.components); + this.BtEdit = new System.Windows.Forms.Button(); + this.BtDel = new System.Windows.Forms.Button(); + this.BtDown = new System.Windows.Forms.Button(); + this.BtAdd = new System.Windows.Forms.Button(); + this.PnlCollAddUpdate.SuspendLayout(); + this.SuspendLayout(); + // + // TvColl + // + this.TvColl.Location = new System.Drawing.Point(12, 12); + this.TvColl.Name = "TvColl"; + this.TvColl.ShowNodeToolTips = true; + this.TvColl.Size = new System.Drawing.Size(152, 142); + this.TvColl.TabIndex = 0; + this.TvColl.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.TvColl_AfterSelect); + // + // TxtCollPath + // + this.TxtCollPath.Location = new System.Drawing.Point(76, 6); + this.TxtCollPath.Name = "TxtCollPath"; + this.TxtCollPath.Size = new System.Drawing.Size(100, 20); + this.TxtCollPath.TabIndex = 7; + // + // TxtCollName + // + this.TxtCollName.Location = new System.Drawing.Point(76, 32); + this.TxtCollName.Name = "TxtCollName"; + this.TxtCollName.Size = new System.Drawing.Size(100, 20); + this.TxtCollName.TabIndex = 9; + // + // TxtCollDesc + // + this.TxtCollDesc.Location = new System.Drawing.Point(76, 58); + this.TxtCollDesc.Multiline = true; + this.TxtCollDesc.Name = "TxtCollDesc"; + this.TxtCollDesc.Size = new System.Drawing.Size(158, 55); + this.TxtCollDesc.TabIndex = 11; + // + // LblFolder + // + this.LblFolder.Location = new System.Drawing.Point(5, 6); + this.LblFolder.Name = "LblFolder"; + this.LblFolder.Size = new System.Drawing.Size(65, 20); + this.LblFolder.TabIndex = 6; + this.LblFolder.Text = "Folder"; + this.LblFolder.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // LblCollName + // + this.LblCollName.Location = new System.Drawing.Point(5, 32); + this.LblCollName.Name = "LblCollName"; + this.LblCollName.Size = new System.Drawing.Size(65, 20); + this.LblCollName.TabIndex = 8; + this.LblCollName.Text = "Name"; + this.LblCollName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // LblCollDesc + // + this.LblCollDesc.Location = new System.Drawing.Point(5, 58); + this.LblCollDesc.Name = "LblCollDesc"; + this.LblCollDesc.Size = new System.Drawing.Size(65, 20); + this.LblCollDesc.TabIndex = 10; + this.LblCollDesc.Text = "Description"; + this.LblCollDesc.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // PnlCollAddUpdate + // + this.PnlCollAddUpdate.Controls.Add(this.BtCancel); + this.PnlCollAddUpdate.Controls.Add(this.BtSave); + this.PnlCollAddUpdate.Controls.Add(this.TxtCollDesc); + this.PnlCollAddUpdate.Controls.Add(this.LblCollDesc); + this.PnlCollAddUpdate.Controls.Add(this.TxtCollPath); + this.PnlCollAddUpdate.Controls.Add(this.LblCollName); + this.PnlCollAddUpdate.Controls.Add(this.TxtCollName); + this.PnlCollAddUpdate.Controls.Add(this.LblFolder); + this.PnlCollAddUpdate.Location = new System.Drawing.Point(200, 12); + this.PnlCollAddUpdate.Name = "PnlCollAddUpdate"; + this.PnlCollAddUpdate.Size = new System.Drawing.Size(241, 145); + this.PnlCollAddUpdate.TabIndex = 5; + // + // BtCancel + // + this.BtCancel.Location = new System.Drawing.Point(76, 119); + this.BtCancel.Name = "BtCancel"; + this.BtCancel.Size = new System.Drawing.Size(75, 23); + this.BtCancel.TabIndex = 12; + this.BtCancel.Text = "Cancel"; + this.BtCancel.UseVisualStyleBackColor = true; + this.BtCancel.Click += new System.EventHandler(this.BtCancel_Click); + // + // BtSave + // + this.BtSave.Location = new System.Drawing.Point(159, 119); + this.BtSave.Name = "BtSave"; + this.BtSave.Size = new System.Drawing.Size(75, 23); + this.BtSave.TabIndex = 13; + this.BtSave.Text = "Save"; + this.BtSave.UseVisualStyleBackColor = true; + this.BtSave.Click += new System.EventHandler(this.BtSave_Click); + // + // BtOk + // + this.BtOk.Location = new System.Drawing.Point(366, 163); + this.BtOk.Name = "BtOk"; + this.BtOk.Size = new System.Drawing.Size(75, 23); + this.BtOk.TabIndex = 14; + this.BtOk.Text = "Ok"; + this.BtOk.UseVisualStyleBackColor = true; + this.BtOk.Click += new System.EventHandler(this.BtOk_Click); + // + // BtUp + // + this.BtUp.ImageIndex = 0; + this.BtUp.ImageList = this.ImgList; + this.BtUp.Location = new System.Drawing.Point(170, 11); + this.BtUp.Name = "BtUp"; + this.BtUp.Size = new System.Drawing.Size(24, 24); + this.BtUp.TabIndex = 1; + this.BtUp.UseVisualStyleBackColor = true; + this.BtUp.Click += new System.EventHandler(this.BtUp_Click); + // + // ImgList + // + this.ImgList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ImgList.ImageStream"))); + this.ImgList.TransparentColor = System.Drawing.Color.Transparent; + this.ImgList.Images.SetKeyName(0, "UpArrow.png"); + this.ImgList.Images.SetKeyName(1, "DownArrow.png"); + this.ImgList.Images.SetKeyName(2, "AddIcon.png"); + this.ImgList.Images.SetKeyName(3, "RemoveIcon.png"); + this.ImgList.Images.SetKeyName(4, "EditIcon.png"); + // + // BtEdit + // + this.BtEdit.ImageIndex = 4; + this.BtEdit.ImageList = this.ImgList; + this.BtEdit.Location = new System.Drawing.Point(170, 101); + this.BtEdit.Name = "BtEdit"; + this.BtEdit.Size = new System.Drawing.Size(24, 24); + this.BtEdit.TabIndex = 4; + this.BtEdit.UseVisualStyleBackColor = true; + this.BtEdit.Click += new System.EventHandler(this.BtEdit_Click); + // + // BtDel + // + this.BtDel.ImageIndex = 3; + this.BtDel.ImageList = this.ImgList; + this.BtDel.Location = new System.Drawing.Point(170, 131); + this.BtDel.Name = "BtDel"; + this.BtDel.Size = new System.Drawing.Size(24, 24); + this.BtDel.TabIndex = 5; + this.BtDel.UseVisualStyleBackColor = true; + this.BtDel.Click += new System.EventHandler(this.BtDel_Click); + // + // BtDown + // + this.BtDown.ImageIndex = 1; + this.BtDown.ImageList = this.ImgList; + this.BtDown.Location = new System.Drawing.Point(170, 41); + this.BtDown.Name = "BtDown"; + this.BtDown.Size = new System.Drawing.Size(24, 24); + this.BtDown.TabIndex = 2; + this.BtDown.UseVisualStyleBackColor = true; + this.BtDown.Click += new System.EventHandler(this.BtDown_Click); + // + // BtAdd + // + this.BtAdd.ImageIndex = 2; + this.BtAdd.ImageList = this.ImgList; + this.BtAdd.Location = new System.Drawing.Point(170, 71); + this.BtAdd.Name = "BtAdd"; + this.BtAdd.Size = new System.Drawing.Size(24, 24); + this.BtAdd.TabIndex = 3; + this.BtAdd.UseVisualStyleBackColor = true; + this.BtAdd.Click += new System.EventHandler(this.BtAdd_Click); + // + // AddEditCollection + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(452, 198); + this.Controls.Add(this.BtAdd); + this.Controls.Add(this.BtDown); + this.Controls.Add(this.BtDel); + this.Controls.Add(this.BtEdit); + this.Controls.Add(this.BtUp); + this.Controls.Add(this.BtOk); + this.Controls.Add(this.PnlCollAddUpdate); + this.Controls.Add(this.TvColl); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "AddEditCollection"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Add / Edit collections"; + this.PnlCollAddUpdate.ResumeLayout(false); + this.PnlCollAddUpdate.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TreeView TvColl; + private System.Windows.Forms.TextBox TxtCollPath; + private System.Windows.Forms.TextBox TxtCollName; + private System.Windows.Forms.TextBox TxtCollDesc; + private System.Windows.Forms.Label LblFolder; + private System.Windows.Forms.Label LblCollName; + private System.Windows.Forms.Label LblCollDesc; + private System.Windows.Forms.Panel PnlCollAddUpdate; + private System.Windows.Forms.Button BtSave; + private System.Windows.Forms.Button BtOk; + private System.Windows.Forms.Button BtCancel; + private System.Windows.Forms.Button BtUp; + private System.Windows.Forms.ImageList ImgList; + private System.Windows.Forms.Button BtEdit; + private System.Windows.Forms.Button BtDel; + private System.Windows.Forms.Button BtDown; + private System.Windows.Forms.Button BtAdd; + } +} diff --git a/TVRename/Forms/Collection/AddEditCollection.cs b/TVRename/Forms/Collection/AddEditCollection.cs new file mode 100644 index 000000000..fe2c2d4cf --- /dev/null +++ b/TVRename/Forms/Collection/AddEditCollection.cs @@ -0,0 +1,228 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace TVRename +{ + public partial class AddEditCollection : Form + { + private static AddEditCollection aecf; + private readonly TVDoc mDoc; + private int iColl = -1; + private bool bActualMode; + private bool bActualButtons; + private bool bAddMode; + + public AddEditCollection(TVDoc doc) + { + InitializeComponent(); + mDoc = doc; + aecf = this; + bActualMode = SetTextBoxes(false, true); + bActualButtons = SetButtons(false, true); + + FillCollTreeView(); + } + + private static bool SetTextBoxes(bool bMode, bool bFull = false) + { + if (bFull) + { + aecf.TxtCollPath.Enabled = bMode; + } + aecf.TxtCollName.Enabled = bMode; + aecf.TxtCollDesc.Enabled = bMode; + + return bMode; + } + + private static bool SetButtons(bool bMode, bool bFull = false) + { + aecf.BtEdit.Enabled = bMode; + aecf.BtDel.Enabled = bMode; + aecf.BtUp.Enabled = bMode; + aecf.BtDown.Enabled = bMode; + if (bFull) + { + aecf.BtSave.Enabled = bMode; + aecf.BtCancel.Enabled = bMode; + } + return bMode; + } + + private static void ClearTextBoxes () + { + aecf.TxtCollName.Text = ""; + aecf.TxtCollPath.Text = ""; + aecf.TxtCollDesc.Text = ""; + } + + private static void FillTextBoxes (ShowCollection Collection) + { + aecf.TxtCollName.Text = Collection.Name; + aecf.TxtCollPath.Text = Collection.Path; + aecf.TxtCollDesc.Text = Collection.Description; + } + + private static ShowCollection FillCollectionFromTextBoxes () + { + ShowCollection Collection = new ShowCollection(aecf.TxtCollPath.Text); + Collection.Name = aecf.TxtCollName.Text; + Collection.Description = aecf.TxtCollDesc.Text; + + return Collection; + } + + private static void FillCollTreeView() + { + aecf.TvColl.Nodes.Clear(); + if (aecf.mDoc.ShowCollections.Count > 0) + { + TreeNode RootNode; + RootNode = aecf.TvColl.Nodes.Add("Root"); + int iCurr = 0; + foreach (ShowCollection ShowColl in aecf.mDoc.ShowCollections) + { + TreeNode CurNode; + CurNode = RootNode.Nodes.Add(ShowColl.Name); + CurNode.ToolTipText = ShowColl.Description; + CurNode.Tag = iCurr; + iCurr++; + } + aecf.TvColl.ExpandAll(); + } + } + + #region Control functions + private void TvColl_AfterSelect(object sender, TreeViewEventArgs e) + { + TreeView Tv = (TreeView)sender; + TreeNode Node = TvColl.SelectedNode; + string Sep = Tv.PathSeparator; + string[] Nodelevels = Node.FullPath.Split(Sep[0]); + + if (Nodelevels.Length == 2) + { + iColl = (int)Node.Tag; + FillTextBoxes(mDoc.ShowCollections[iColl]); + bActualButtons = SetButtons(true); + } + } + + private void BtDel_Click(object sender, EventArgs e) + { + if (iColl != -1) + { + mDoc.ShowCollections.RemoveAt(iColl); + } + + mDoc.WriteXMLFile(FileToHandle.Collections); + ClearTextBoxes(); + bActualButtons = SetButtons(false, true); + iColl = -1; + FillCollTreeView(); + } + + private void BtEdit_Click(object sender, EventArgs e) + { + if (iColl > 0) + { + bActualButtons = SetButtons(true, true); + bActualButtons = SetButtons(false); + bActualMode = SetTextBoxes(true); + BtAdd.Enabled = false; + bAddMode = false; + TvColl.Enabled = false; + } + } + + private void BtSave_Click(object sender, EventArgs e) + { + ShowCollection Sc = FillCollectionFromTextBoxes(); + if (bAddMode) + { + mDoc.ShowCollections.Add(Sc); + } + else + { + mDoc.ShowCollections[iColl] = Sc; + } + + mDoc.WriteXMLFile(FileToHandle.Collections); + + ClearTextBoxes(); + FillCollTreeView(); + + TvColl.Enabled = true; + bActualMode = SetTextBoxes(false, true); + bActualButtons = SetButtons(false, true); + iColl = -1; + BtAdd.Enabled = true; + } + + private void BtAdd_Click(object sender, EventArgs e) + { + ClearTextBoxes(); + bActualButtons = SetButtons(true, true); + bActualButtons = SetButtons(false); + bActualMode = SetTextBoxes(true, true); + BtAdd.Enabled = false; + iColl = -1; + bAddMode = true; + TvColl.Enabled = false; + } + + private void BtOk_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.OK; + Close(); + } + + private void BtCancel_Click(object sender, EventArgs e) + { + ClearTextBoxes(); + bActualMode = SetTextBoxes(false, true); + bActualButtons = SetButtons(false, true); + BtAdd.Enabled = true; + bAddMode = false; + iColl = -1; + FillCollTreeView(); + TvColl.Enabled = true; + } + + private void BtUp_Click(object sender, EventArgs e) + { + ShowCollection Sc; + // No swap over the Default collection + if (iColl > 1) + { + Sc = mDoc.ShowCollections[iColl]; + mDoc.ShowCollections[iColl] = mDoc.ShowCollections[iColl - 1]; + mDoc.ShowCollections[iColl - 1] = Sc; + } + iColl = -1; + FillCollTreeView(); + } + + private void BtDown_Click(object sender, EventArgs e) + { + ShowCollection Sc; + // No Swap after last collection + if (iColl < mDoc.ShowCollections.Count - 1) + { + Sc = mDoc.ShowCollections[iColl]; + mDoc.ShowCollections[iColl] = mDoc.ShowCollections[iColl + 1]; + mDoc.ShowCollections[iColl + 1] = Sc; + } + iColl = -1; + FillCollTreeView(); + } + #endregion + } +} diff --git a/TVRename/Forms/Collection/AddEditCollection.resx b/TVRename/Forms/Collection/AddEditCollection.resx new file mode 100644 index 000000000..0e6b3f77b --- /dev/null +++ b/TVRename/Forms/Collection/AddEditCollection.resx @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA+ + DQAAAk1TRnQBSQFMAgEBBQEAAQgBAAEIAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA + AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 + AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA + AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm + AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM + AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA + ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz + AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ + AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM + AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA + AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA + AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ + AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/ + AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA + AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm + ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ + Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz + AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA + AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM + AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM + ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM + Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA + AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM + AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ + AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz + AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm + AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw + AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/wEAATcBWQFYAXkBGgH/ + OgABmgJZATEBUgEaOgAB9AJ6AVgBMQF5OwABwwFZAXoBMQFzAbQB9DkAAf8BGgF6AZkBvAGzAbsB9DsA + AhkBCQK0AfQ6AAH0AhkBCQG0AXIB9DoAAfQCGQFWAS4BlwH0OgAB9AGYAXgBVgEuAXgB9DoAAfQCeAFW + AS4BlwH0OgAB9AJ4AVYBLgGYAfQ6AAH0AZgBeAFWAU8BCDsAAfQCmQFWAU8B8TsAAfQBGwFXAVYBeD0A + ARsBeAGZdQAB9AOtAawBpgEJCgAB/wEJAa0BCQH/CgAB8wKmAYoBtQHyBgAB/wHwAUUBkwH0BAAB/wGT + AekBGgH/BgAB9AGzAdsCswGtAQkJAAH/AQkBtAGzAa0BCQH/CQAB8wKmAawBugHzBgAB8ANGAZMB9AIA + Af8BkwFFAm8B8gH/BQAB9AGzAdsCswGtAQkJAAEJAdsBCQGzAq0BCQkAAfMCpgGKAbQB8wUAAfIDRgJv + AZMB9AEAAZMB6QFGAW8BlAGTARsFAAH0AbMB2wKzAa0BCQgAAQkBtAEJAdwCswGtAaYBCQgAAfMDigGz + AfMFAAFGAW8BlAFvAUYBbwFGAW8BkwEfA0YCFgFGBQAB9AGzAdsCswGtAQkGAAH/AQkB1APcArMCrQGm + AbsB/wYAAfMBigGsAYoBswHyBQAB8wGTAb0BlAFvA0YBHwRGAUwBRgEHBQAB9AGzAdsCswGtAQkFAAH/ + AQkB1APVAdsCswGtAawBpgGGAQcB/wUJAbUBigGLAYoBrQG1AfAB8QPyAQAB8wEaAb0BlAFvCEYBBwH/ + BQAB9AGzAdsCswGtAQkFAAH/A/QB8QGzAdUCswGtAfAC8wH0Af8BpgWKAq0BiwKtArMBugIJAQAB/wHz + ApQB4wZGASUBGgH/BgAB9AGzAdsCswGtAfMJAAH0AbQB2wKzAa0B9AQAAawCswqtArMBtAMAAfQBRgHj + ARcERgElARoIAAH0AbMB2wKzAa0B8wkAAfQBtAHbArMBrQHxBAABswHcAboBtASzBq0BswGsAgAB/wGT + AUYBFwZGAb0B/wMAAf8B3QEJAfEBCQHVAdwCswGtAbUCCQHwAf8FAAH0AbQB2wKzAa0BCQQAAbsB3AG6 + ArMCtAKzAa0BigKtAawCigEAAf8BkwFGAhcGRgHjARsB9AIAAf8BGQHUAdUB3AIJArMCrQGmAYsBvAH/ + BQAB9AG0AdsCswGtAQkEAAX0AfICugGzAa0BtQXzAQABkwJGAW8BFwNGAW8CRgHjAZQBGwH/AwABGQGt + AdUC3AKzAa0BrAGmAbwHAAH0AbQB2wKzAa0BCQkAAfQB3AG6ArMBCQUAAZQBJQHjARYBbwJGASUBIAEX + ARYCRgIWAb0EAAEZAbMB2wHcArMBrQGLAbwIAAH0AbQB2wKzAa0BCQkAAfQC3AKzAQkFAAGUARYBvQGU + AW8CRgGTARoBRwHjARYBRgFvARcBRwUAAfEBtAHbAbMCrQHwCQAB9AG0AdsCswGtAQkJAAH0AQkB3AKz + AQkFAAH0Ab0ClAJGAZMB/wEAARoC4wFvAkYBGgUAAf8B3QGzAq0B8AH/CQAB9AG0AdwCswGtAQkJAAH0 + AQkB3AG0AbMBCQYAAfQBlAFHASABkwH/AgAB/wEaAUcCRgEaAf8HAAEJAa0B8AsAAfQDrQGsAccBCQkA + AfQB2wGyAqwBCQcAAfQB4wGUBgABGgFGAfMCAAFCAU0BPgcAAT4DAAEoAwABQAMAASADAAEBAQABAQYA + AQEWAAP/AQABAwH/BgABAwH/BgABAwH/BgABgAH/BgABgAF/BgAB8AE/BgAB8AEfBgAB+AEPBgAB/AEH + BgAB/gEDBgAB/wEBBgAB/wGBBgAB/wHABgAB/wHgBgAB/wH4BgAC/wYAAfgBDwH8AR8B+AEfAYMBwQH4 + AQ8B+AEPAfgBHwGBAYAB+AEPAfgBDwH4AR8BAAGAAfgBDwHwAQcB+AEfAgAB+AEPAcABAQH4AR8CAAH4 + AQ8BgAMAAYABAAH4AQ8BgAMAAYABAQH4AQ8B+AEPAgAB4AEHAfgBDwH4AQ8CAAHAAQMBgAEAAfgBDwIA + AYABAQGAAQAB+AEPAgABgAEAAeABAwH4AQ8B+AEfAgAB8AEHAfgBDwH4AR8CAAH4AQ8B+AEPAfgBHwEA + AYAB+AEPAfgBDwH4AR8BgQGAAf4BPwH4AQ8B+AEfAccB4ws= + + + + 60 + + + + + AAABAAIAICAQAAAABADoAgAAJgAAABAQEAAAAAQAKAEAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAAAAAC + AAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAICAgADAwMAAAAD/AAD/ + AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////wAAAAD///////////////8AAAAA + ////mf////+Z////AAAAAP///5n/////mf///wAAAAD///+Z/////5n///8AAAAA////mf////+Z//// + AAAAAP///5n///+Z/5n//wAAAAD///+Z////mf+Z//8AAAAA////mf///5n/mf//AAAAAP///5n///+Z + /5n//wAAAAD/mZmZmZn/mf+Z//8AAAAA/5mZmZmZ/5n/mf//AAAAAP///////////////wAAAAD///// + //////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////// + ///AAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AA + AAPAAAADwAAAA8AAAAP/8z////Mf///Pz///z8///8/z///P8///P/z//z/8//////////////////// + //8oAAAAEAAAACAAAAABAAQAAAAAAIAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAgAAAgAAAAICAAIAA + AACAAIAAgIAAAICAgADAwMAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAA + AAAA////////AAD/+f//n/8AAP/5//+f/wAA//n/+fn/AAD/+f/5+f8AAPmZmfn5/wAA////////AAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAIAB + AACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAP1/AAD7fwAA+78AAPffAAD//wAA//8AAA== + + + \ No newline at end of file diff --git a/TVRename/Forms/Preferences/AddEditSearchEngine.cs b/TVRename/Forms/Preferences/AddEditSearchEngine.cs index a60d670ec..ba681e94e 100644 --- a/TVRename/Forms/Preferences/AddEditSearchEngine.cs +++ b/TVRename/Forms/Preferences/AddEditSearchEngine.cs @@ -40,7 +40,7 @@ public AddEditSearchEngine(Searchers s, ProcessedEpisode pe) { AddNewRow(); grid1[i + 1, 0].Value = mSearchers.Name(i); - grid1[i + 1, 1].Value = mSearchers.Url(i); + grid1[i + 1, 1].Value = mSearchers.URL(i); } } diff --git a/TVRename/Forms/Preferences/CustomNameDesigner.cs b/TVRename/Forms/Preferences/CustomNameDesigner.cs index c81457324..8bd9f8fda 100644 --- a/TVRename/Forms/Preferences/CustomNameDesigner.cs +++ b/TVRename/Forms/Preferences/CustomNameDesigner.cs @@ -25,19 +25,21 @@ namespace TVRename /// public partial class CustomNameDesigner : Form { - private readonly CustomEpisodeName cn; - private readonly List eps; + private readonly CustomEpisodeName CN; + private readonly List Eps; + private TVDoc mDoc; - public CustomNameDesigner(List pel, CustomEpisodeName cn) + public CustomNameDesigner(List pel, CustomEpisodeName cn, TVDoc doc) { - eps = pel; - this.cn = cn; + Eps = pel; + CN = cn; + mDoc = doc; InitializeComponent(); - if (eps == null) + if (Eps == null) lvTest.Enabled = false; - txtTemplate.Text = this.cn.StyleString; + txtTemplate.Text = CN.StyleString; FillExamples(); FillCombos(); @@ -47,9 +49,9 @@ private void FillCombos() { cbTags.Items.Clear(); cbPresets.Items.Clear(); - ProcessedEpisode pe; + ProcessedEpisode pe = null; if (lvTest.SelectedItems.Count == 0) - pe = ((eps != null) && (eps.Count > 0)) ? eps[0] : null; + pe = ((Eps != null) && (Eps.Count > 0)) ? Eps[0] : null; else pe = (ProcessedEpisode) (lvTest.SelectedItems[0].Tag); @@ -69,14 +71,14 @@ private void FillCombos() private void FillExamples() { - if (eps == null) + if (Eps == null) return; lvTest.Items.Clear(); - foreach (ProcessedEpisode pe in eps) + foreach (ProcessedEpisode pe in Eps) { ListViewItem lvi = new ListViewItem(); - string fn = TVSettings.Instance.FilenameFriendly(cn.NameFor(pe)); + string fn = TVSettings.Instance.FilenameFriendly(CN.NameFor(pe)); lvi.Text = fn; bool ok = TVDoc.FindSeasEp(new FileInfo(fn + ".avi"), out int seas, out int ep, out int maxEp, pe.Show); @@ -109,7 +111,7 @@ private void cbPresets_SelectedIndexChanged(object sender, System.EventArgs e) private void txtTemplate_TextChanged(object sender, System.EventArgs e) { - cn.StyleString = txtTemplate.Text; + CN.StyleString = txtTemplate.Text; FillExamples(); } diff --git a/TVRename/Forms/Preferences/Preferences.Designer.cs b/TVRename/Forms/Preferences/Preferences.Designer.cs index 9606199fc..90ede532a 100644 --- a/TVRename/Forms/Preferences/Preferences.Designer.cs +++ b/TVRename/Forms/Preferences/Preferences.Designer.cs @@ -76,6 +76,7 @@ private void InitializeComponent() this.label6 = new System.Windows.Forms.Label(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tbGeneral = new System.Windows.Forms.TabPage(); + this.cbShowCollections = new System.Windows.Forms.CheckBox(); this.chkHideWtWSpoilers = new System.Windows.Forms.CheckBox(); this.chkHideMyShowsSpoilers = new System.Windows.Forms.CheckBox(); this.label37 = new System.Windows.Forms.Label(); @@ -266,6 +267,7 @@ private void InitializeComponent() this.pyTivoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mede8erToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.noneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.cbDeleteShowFromDisk = new System.Windows.Forms.CheckBox(); this.groupBox2.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tbGeneral.SuspendLayout(); @@ -295,7 +297,7 @@ private void InitializeComponent() // OKButton // this.OKButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.OKButton.Location = new System.Drawing.Point(369, 551); + this.OKButton.Location = new System.Drawing.Point(369, 554); this.OKButton.Name = "OKButton"; this.OKButton.Size = new System.Drawing.Size(75, 23); this.OKButton.TabIndex = 0; @@ -307,7 +309,7 @@ private void InitializeComponent() // this.bnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.bnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.bnCancel.Location = new System.Drawing.Point(450, 551); + this.bnCancel.Location = new System.Drawing.Point(450, 554); this.bnCancel.Name = "bnCancel"; this.bnCancel.Size = new System.Drawing.Size(75, 23); this.bnCancel.TabIndex = 1; @@ -549,7 +551,7 @@ private void InitializeComponent() // cbShowEpisodePictures // this.cbShowEpisodePictures.AutoSize = true; - this.cbShowEpisodePictures.Location = new System.Drawing.Point(9, 138); + this.cbShowEpisodePictures.Location = new System.Drawing.Point(9, 159); this.cbShowEpisodePictures.Name = "cbShowEpisodePictures"; this.cbShowEpisodePictures.Size = new System.Drawing.Size(218, 17); this.cbShowEpisodePictures.TabIndex = 10; @@ -580,7 +582,7 @@ private void InitializeComponent() // chkShowInTaskbar // this.chkShowInTaskbar.AutoSize = true; - this.chkShowInTaskbar.Location = new System.Drawing.Point(169, 115); + this.chkShowInTaskbar.Location = new System.Drawing.Point(169, 136); this.chkShowInTaskbar.Name = "chkShowInTaskbar"; this.chkShowInTaskbar.Size = new System.Drawing.Size(102, 17); this.chkShowInTaskbar.TabIndex = 9; @@ -591,7 +593,7 @@ private void InitializeComponent() // cbNotificationIcon // this.cbNotificationIcon.AutoSize = true; - this.cbNotificationIcon.Location = new System.Drawing.Point(9, 115); + this.cbNotificationIcon.Location = new System.Drawing.Point(9, 136); this.cbNotificationIcon.Name = "cbNotificationIcon"; this.cbNotificationIcon.Size = new System.Drawing.Size(154, 17); this.cbNotificationIcon.TabIndex = 8; @@ -663,11 +665,12 @@ private void InitializeComponent() this.tabControl1.Multiline = true; this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(517, 533); + this.tabControl1.Size = new System.Drawing.Size(517, 536); this.tabControl1.TabIndex = 0; // // tbGeneral // + this.tbGeneral.Controls.Add(this.cbShowCollections); this.tbGeneral.Controls.Add(this.chkHideWtWSpoilers); this.tbGeneral.Controls.Add(this.chkHideMyShowsSpoilers); this.tbGeneral.Controls.Add(this.label37); @@ -695,15 +698,25 @@ private void InitializeComponent() this.tbGeneral.Location = new System.Drawing.Point(4, 40); this.tbGeneral.Name = "tbGeneral"; this.tbGeneral.Padding = new System.Windows.Forms.Padding(3); - this.tbGeneral.Size = new System.Drawing.Size(509, 489); + this.tbGeneral.Size = new System.Drawing.Size(509, 492); this.tbGeneral.TabIndex = 0; this.tbGeneral.Text = "General"; this.tbGeneral.UseVisualStyleBackColor = true; // + // cbShowCollections + // + this.cbShowCollections.AutoSize = true; + this.cbShowCollections.Location = new System.Drawing.Point(9, 115); + this.cbShowCollections.Name = "cbShowCollections"; + this.cbShowCollections.Size = new System.Drawing.Size(145, 17); + this.cbShowCollections.TabIndex = 2; + this.cbShowCollections.Text = "Multiple Show collections"; + this.cbShowCollections.UseVisualStyleBackColor = true; + // // chkHideWtWSpoilers // this.chkHideWtWSpoilers.AutoSize = true; - this.chkHideWtWSpoilers.Location = new System.Drawing.Point(9, 184); + this.chkHideWtWSpoilers.Location = new System.Drawing.Point(9, 205); this.chkHideWtWSpoilers.Name = "chkHideWtWSpoilers"; this.chkHideWtWSpoilers.Size = new System.Drawing.Size(182, 17); this.chkHideWtWSpoilers.TabIndex = 24; @@ -713,7 +726,7 @@ private void InitializeComponent() // chkHideMyShowsSpoilers // this.chkHideMyShowsSpoilers.AutoSize = true; - this.chkHideMyShowsSpoilers.Location = new System.Drawing.Point(9, 161); + this.chkHideMyShowsSpoilers.Location = new System.Drawing.Point(9, 182); this.chkHideMyShowsSpoilers.Name = "chkHideMyShowsSpoilers"; this.chkHideMyShowsSpoilers.Size = new System.Drawing.Size(151, 17); this.chkHideMyShowsSpoilers.TabIndex = 23; @@ -723,7 +736,7 @@ private void InitializeComponent() // label37 // this.label37.AutoSize = true; - this.label37.Location = new System.Drawing.Point(6, 229); + this.label37.Location = new System.Drawing.Point(6, 250); this.label37.Name = "label37"; this.label37.Size = new System.Drawing.Size(114, 13); this.label37.TabIndex = 20; @@ -732,7 +745,7 @@ private void InitializeComponent() // label38 // this.label38.AutoSize = true; - this.label38.Location = new System.Drawing.Point(158, 229); + this.label38.Location = new System.Drawing.Point(158, 250); this.label38.Name = "label38"; this.label38.Size = new System.Drawing.Size(132, 13); this.label38.TabIndex = 22; @@ -740,7 +753,7 @@ private void InitializeComponent() // // tbPercentDirty // - this.tbPercentDirty.Location = new System.Drawing.Point(123, 226); + this.tbPercentDirty.Location = new System.Drawing.Point(123, 247); this.tbPercentDirty.Name = "tbPercentDirty"; this.tbPercentDirty.Size = new System.Drawing.Size(28, 20); this.tbPercentDirty.TabIndex = 21; @@ -752,7 +765,7 @@ private void InitializeComponent() this.cbMode.Items.AddRange(new object[] { "Beta", "Production"}); - this.cbMode.Location = new System.Drawing.Point(112, 320); + this.cbMode.Location = new System.Drawing.Point(112, 341); this.cbMode.Name = "cbMode"; this.cbMode.Size = new System.Drawing.Size(146, 21); this.cbMode.Sorted = true; @@ -761,7 +774,7 @@ private void InitializeComponent() // label34 // this.label34.AutoSize = true; - this.label34.Location = new System.Drawing.Point(6, 323); + this.label34.Location = new System.Drawing.Point(6, 344); this.label34.Name = "label34"; this.label34.Size = new System.Drawing.Size(37, 13); this.label34.TabIndex = 18; @@ -792,7 +805,7 @@ private void InitializeComponent() // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(6, 299); + this.label10.Location = new System.Drawing.Point(6, 320); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(100, 13); this.label10.TabIndex = 16; @@ -801,7 +814,7 @@ private void InitializeComponent() // cbLookForAirdate // this.cbLookForAirdate.AutoSize = true; - this.cbLookForAirdate.Location = new System.Drawing.Point(9, 275); + this.cbLookForAirdate.Location = new System.Drawing.Point(9, 296); this.cbLookForAirdate.Name = "cbLookForAirdate"; this.cbLookForAirdate.Size = new System.Drawing.Size(158, 17); this.cbLookForAirdate.TabIndex = 15; @@ -816,7 +829,7 @@ private void InitializeComponent() "My Shows", "Scan", "When to Watch"}); - this.cbLanguages.Location = new System.Drawing.Point(112, 296); + this.cbLanguages.Location = new System.Drawing.Point(112, 317); this.cbLanguages.Name = "cbLanguages"; this.cbLanguages.Size = new System.Drawing.Size(146, 21); this.cbLanguages.Sorted = true; @@ -825,7 +838,7 @@ private void InitializeComponent() // label21 // this.label21.AutoSize = true; - this.label21.Location = new System.Drawing.Point(6, 205); + this.label21.Location = new System.Drawing.Point(6, 226); this.label21.Name = "label21"; this.label21.Size = new System.Drawing.Size(82, 13); this.label21.TabIndex = 11; @@ -834,7 +847,7 @@ private void InitializeComponent() // cbAutoSelInMyShows // this.cbAutoSelInMyShows.AutoSize = true; - this.cbAutoSelInMyShows.Location = new System.Drawing.Point(9, 252); + this.cbAutoSelInMyShows.Location = new System.Drawing.Point(9, 273); this.cbAutoSelInMyShows.Name = "cbAutoSelInMyShows"; this.cbAutoSelInMyShows.Size = new System.Drawing.Size(268, 17); this.cbAutoSelInMyShows.TabIndex = 14; @@ -853,7 +866,7 @@ private void InitializeComponent() // label20 // this.label20.AutoSize = true; - this.label20.Location = new System.Drawing.Point(126, 205); + this.label20.Location = new System.Drawing.Point(126, 226); this.label20.Name = "label20"; this.label20.Size = new System.Drawing.Size(170, 13); this.label20.TabIndex = 13; @@ -861,7 +874,7 @@ private void InitializeComponent() // // txtParallelDownloads // - this.txtParallelDownloads.Location = new System.Drawing.Point(92, 202); + this.txtParallelDownloads.Location = new System.Drawing.Point(92, 223); this.txtParallelDownloads.Name = "txtParallelDownloads"; this.txtParallelDownloads.Size = new System.Drawing.Size(28, 20); this.txtParallelDownloads.TabIndex = 12; @@ -1543,6 +1556,7 @@ private void InitializeComponent() // // tbFolderDeleting // + this.tbFolderDeleting.Controls.Add(this.cbDeleteShowFromDisk); this.tbFolderDeleting.Controls.Add(this.cbCleanUpDownloadDir); this.tbFolderDeleting.Controls.Add(this.label32); this.tbFolderDeleting.Controls.Add(this.label30); @@ -1558,7 +1572,7 @@ private void InitializeComponent() this.tbFolderDeleting.Location = new System.Drawing.Point(4, 40); this.tbFolderDeleting.Name = "tbFolderDeleting"; this.tbFolderDeleting.Padding = new System.Windows.Forms.Padding(3); - this.tbFolderDeleting.Size = new System.Drawing.Size(509, 489); + this.tbFolderDeleting.Size = new System.Drawing.Size(509, 492); this.tbFolderDeleting.TabIndex = 9; this.tbFolderDeleting.Text = "Folder Deleting"; this.tbFolderDeleting.UseVisualStyleBackColor = true; @@ -2733,13 +2747,23 @@ private void InitializeComponent() this.noneToolStripMenuItem.Tag = "4"; this.noneToolStripMenuItem.Text = "&None"; // + // cbDeleteShowFromDisk + // + this.cbDeleteShowFromDisk.AutoSize = true; + this.cbDeleteShowFromDisk.Location = new System.Drawing.Point(16, 267); + this.cbDeleteShowFromDisk.Name = "cbDeleteShowFromDisk"; + this.cbDeleteShowFromDisk.Size = new System.Drawing.Size(269, 17); + this.cbDeleteShowFromDisk.TabIndex = 11; + this.cbDeleteShowFromDisk.Text = "Delete from disk when deleting show from database"; + this.cbDeleteShowFromDisk.UseVisualStyleBackColor = true; + // // Preferences // this.AcceptButton = this.OKButton; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.bnCancel; - this.ClientSize = new System.Drawing.Size(541, 576); + this.ClientSize = new System.Drawing.Size(541, 579); this.ControlBox = false; this.Controls.Add(this.tabControl1); this.Controls.Add(this.bnCancel); @@ -3043,5 +3067,7 @@ private void InitializeComponent() private System.Windows.Forms.TextBox txtSeasonFormat; private System.Windows.Forms.Label label47; private System.Windows.Forms.CheckBox cbWDLiveEpisodeFiles; + private System.Windows.Forms.CheckBox cbShowCollections; + private System.Windows.Forms.CheckBox cbDeleteShowFromDisk; } } diff --git a/TVRename/Forms/Preferences/Preferences.cs b/TVRename/Forms/Preferences/Preferences.cs index 5e696d197..55af2b635 100644 --- a/TVRename/Forms/Preferences/Preferences.cs +++ b/TVRename/Forms/Preferences/Preferences.cs @@ -147,6 +147,8 @@ private void OKButton_Click(object sender, EventArgs e) s.ShowInTaskbar = chkShowInTaskbar.Checked; s.RenameTxtToSub = cbTxtToSub.Checked; s.ShowEpisodePictures = cbShowEpisodePictures.Checked; + s.ShowCollections = cbShowCollections.Checked; + s.DeleteShowFromDisk = cbDeleteShowFromDisk.Checked; s.HideMyShowsSpoilers = chkHideMyShowsSpoilers.Checked; s.HideWtWSpoilers = chkHideWtWSpoilers.Checked; s.AutoSelectShowInMyShows = cbAutoSelInMyShows.Checked; @@ -381,6 +383,8 @@ private void Preferences_Load(object sender, EventArgs e) chkHideWtWSpoilers.Checked = s.HideWtWSpoilers; cbAutoCreateFolders.Checked = s.AutoCreateFolders; cbAutoSelInMyShows.Checked = s.AutoSelectShowInMyShows; + cbShowCollections.Checked = s.ShowCollections; + cbDeleteShowFromDisk.Checked = s.DeleteShowFromDisk; txtSpecialsFolderName.Text = s.SpecialsFolderName; txtSeasonFormat.Text= s.SeasonFolderFormat ; cbForceLower.Checked = s.ForceLowercaseFilenames; diff --git a/TVRename/Forms/Supporting/CopyMoveProgress.cs b/TVRename/Forms/Supporting/CopyMoveProgress.cs index 8b8a705d9..791d936c9 100644 --- a/TVRename/Forms/Supporting/CopyMoveProgress.cs +++ b/TVRename/Forms/Supporting/CopyMoveProgress.cs @@ -153,10 +153,13 @@ private void UpdateDiskSpace() int diskValue = 0; string diskText = "--- GB free"; - ActionCopyMoveRename activeCMAction = GetActiveCmAction(); + ActionCopyMoveRename activeCMAction = null; + + activeCMAction = GetActiveCmAction(); if (activeCMAction is null) return; + string folder = activeCMAction.TargetFolder; DirectoryInfo toRoot = (!string.IsNullOrEmpty(folder) && !folder.StartsWith("\\\\")) ? new DirectoryInfo(folder).Root : null; @@ -182,10 +185,10 @@ private void UpdateDiskSpace() } } - DirectoryInfo toUncRoot = (!string.IsNullOrEmpty(folder) && folder.StartsWith("\\\\")) ? new DirectoryInfo(folder).Root : null; - if (toUncRoot != null) + DirectoryInfo toUNCRoot = (!string.IsNullOrEmpty(folder) && folder.StartsWith("\\\\")) ? new DirectoryInfo(folder).Root : null; + if (toUNCRoot != null) { - FileSystemProperties driveStats = FileHelper.GetProperties(toUncRoot.ToString()); + FileSystemProperties driveStats = FileHelper.GetProperties(toUNCRoot.ToString()); if (driveStats != null) { int pct = (int)((1000 * driveStats.AvailableBytes) / driveStats.TotalBytes); diff --git a/TVRename/Forms/Supporting/UpdateNotification.Designer.cs b/TVRename/Forms/Supporting/UpdateNotification.Designer.cs index 8164fde91..54a5250b7 100644 --- a/TVRename/Forms/Supporting/UpdateNotification.Designer.cs +++ b/TVRename/Forms/Supporting/UpdateNotification.Designer.cs @@ -124,7 +124,6 @@ private void InitializeComponent() this.webReleaseNotes.Size = new System.Drawing.Size(382, 333); this.webReleaseNotes.TabIndex = 7; this.webReleaseNotes.Visible = false; - this.webReleaseNotes.Navigating += new System.Windows.Forms.WebBrowserNavigatingEventHandler(this.NavigateTo); // // UpdateNotification // @@ -165,5 +164,5 @@ private void InitializeComponent() private System.Windows.Forms.TextBox tbReleaseNotes; private System.Windows.Forms.Label lblStatus; private System.Windows.Forms.WebBrowser webReleaseNotes; - } + } } diff --git a/TVRename/Forms/Supporting/UpdateNotification.cs b/TVRename/Forms/Supporting/UpdateNotification.cs index d7158ab2a..a0125b189 100644 --- a/TVRename/Forms/Supporting/UpdateNotification.cs +++ b/TVRename/Forms/Supporting/UpdateNotification.cs @@ -10,6 +10,7 @@ public partial class UpdateNotification : Form { private readonly UpdateVersion newVersion; + public UpdateNotification(UpdateVersion update) { newVersion = update; @@ -25,44 +26,38 @@ private void UpdateWithMarkdown() { const string GITHUB_CONVERSION_URL = "https://api.github.com/markdown"; - if (WebRequest.Create(new Uri(GITHUB_CONVERSION_URL)) is HttpWebRequest req) + //string responsebody; + + HttpWebRequest req = WebRequest.Create(new Uri(GITHUB_CONVERSION_URL)) as HttpWebRequest; + req.Method = "POST"; + req.ContentType = "application/json"; + req.UserAgent= + "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"; + + JObject request = new JObject + { + {"text", newVersion.ReleaseNotesText}, + {"mode", "gfm"}, + {"context", "TV-Rename/tvrename"} + }; + + using (StreamWriter writer = new StreamWriter(req.GetRequestStream())) { - req.Method = "POST"; - req.ContentType = "application/json"; - req.UserAgent = - "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"; - - JObject request = new JObject - { - {"text", newVersion.ReleaseNotesText}, - {"mode", "gfm"}, - {"context", "TV-Rename/tvrename"} - }; - - using (StreamWriter writer = new StreamWriter(req.GetRequestStream())) - { - writer.Write(request.ToString()); - } - - string result = null; - using (HttpWebResponse resp = req.GetResponse() as HttpWebResponse) - { - if (resp != null) - { - StreamReader reader = - new StreamReader(resp.GetResponseStream() ?? throw new InvalidOperationException()); - - result = reader.ReadToEnd(); - } - } - - string HTML_HEAD = - ""; - - string HTML_FOOTER = ""; - - webReleaseNotes.DocumentText = HTML_HEAD + result + HTML_FOOTER; + writer.Write(request.ToString()); } + + string result = null; + using (HttpWebResponse resp = req.GetResponse() as HttpWebResponse) + { + StreamReader reader = + new StreamReader(resp.GetResponseStream()); + result = reader.ReadToEnd(); + } + + string HTML_HEAD = ""; + string HTML_FOOTER = ""; + + webReleaseNotes.DocumentText= HTML_HEAD+result+HTML_FOOTER; webReleaseNotes.Visible = true; tbReleaseNotes.Visible = false; diff --git a/TVRename/Forms/Tools/ActorsGrid.cs b/TVRename/Forms/Tools/ActorsGrid.cs index fe1aa1e56..194fdfe81 100644 --- a/TVRename/Forms/Tools/ActorsGrid.cs +++ b/TVRename/Forms/Tools/ActorsGrid.cs @@ -276,7 +276,7 @@ private void FillGrid() { View = theData.Data[r][c].Value ? isActorModel : isGuestModel }; - grid1[r + 1, c + 1].AddController(new CellClickEvent(theData.Cols[c])); + grid1[r + 1, c + 1].AddController(new CellClickEvent(theData.Cols[c], theData.Rows[r])); } else grid1[r + 1, c + 1] = new Cell(""); @@ -344,11 +344,13 @@ private void rbTotals_CheckedChanged(object sender, EventArgs e) private class CellClickEvent : SourceGrid.Cells.Controllers.ControllerBase { + private readonly string show; private readonly string who; - public CellClickEvent(string who) + public CellClickEvent(string who, string show) { this.who = who; + this.show = show; } public override void OnClick(SourceGrid.CellContext sender, EventArgs e) diff --git a/TVRename/Forms/Tools/ShowSummary.cs b/TVRename/Forms/Tools/ShowSummary.cs index e3e5201e1..47ffbbadd 100644 --- a/TVRename/Forms/Tools/ShowSummary.cs +++ b/TVRename/Forms/Tools/ShowSummary.cs @@ -490,7 +490,7 @@ public ShowSummarySeasonData(int seasonNumber, int episodeCount, int episodeAire this.episodeAiredCount = episodeAiredCount; this.episodeGotCount = episodeGotCount; Season = season; - Ignored = ignored; + this.Ignored = ignored; } public SummaryOutput GetOuput() diff --git a/TVRename/Forms/UI.Designer.cs b/TVRename/Forms/UI.Designer.cs index beae5951b..a2b8c08d4 100644 --- a/TVRename/Forms/UI.Designer.cs +++ b/TVRename/Forms/UI.Designer.cs @@ -63,6 +63,10 @@ public void InitializeComponent() System.Windows.Forms.ListViewGroup listViewGroup14 = new System.Windows.Forms.ListViewGroup("Later", System.Windows.Forms.HorizontalAlignment.Left); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.collToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.aeCollToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripSeparator0 = new System.Windows.Forms.ToolStripSeparator(); this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); @@ -134,15 +138,6 @@ public void InitializeComponent() this.bnActionOptions = new System.Windows.Forms.Button(); this.bnActionWhichSearch = new System.Windows.Forms.Button(); this.bnActionBTSearch = new System.Windows.Forms.Button(); - this.lvAction = new TVRename.MyListView(); - this.columnHeader48 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader49 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader51 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader52 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader53 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader54 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader55 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader58 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.ilIcons = new System.Windows.Forms.ImageList(this.components); this.bnActionAction = new System.Windows.Forms.Button(); this.bnActionRecentCheck = new System.Windows.Forms.Button(); @@ -153,15 +148,6 @@ public void InitializeComponent() this.bnWhenToWatchCheck = new System.Windows.Forms.Button(); this.txtWhenToWatchSynopsis = new System.Windows.Forms.TextBox(); this.calCalendar = new System.Windows.Forms.MonthCalendar(); - this.lvWhenToWatch = new TVRename.ListViewFlickerFree(); - this.columnHeader29 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader30 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader31 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader32 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader36 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader33 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader34 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader35 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.pbProgressBarx = new System.Windows.Forms.ProgressBar(); this.txtDLStatusLabel = new System.Windows.Forms.Label(); @@ -190,8 +176,25 @@ public void InitializeComponent() this.tmrPeriodicScan = new System.Windows.Forms.Timer(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.btnUpdateAvailable = new System.Windows.Forms.Button(); - this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); - this.logToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.lvAction = new TVRename.MyListView(); + this.columnHeader48 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader49 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader51 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader52 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader53 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader54 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader55 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader56 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader58 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.lvWhenToWatch = new TVRename.ListViewFlickerFree(); + this.columnHeader29 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader30 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader31 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader32 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader36 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader33 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader34 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader35 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.menuStrip1.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tbMyShows.SuspendLayout(); @@ -225,6 +228,8 @@ public void InitializeComponent() // fileToolStripMenuItem // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.collToolStripMenuItem, + this.toolStripSeparator0, this.exportToolStripMenuItem, this.saveToolStripMenuItem, this.toolStripSeparator1, @@ -234,11 +239,38 @@ public void InitializeComponent() this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "&File"; // + // collToolStripMenuItem + // + this.collToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.aeCollToolStripMenuItem, + this.toolStripSeparator8}); + this.collToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("collToolStripMenuItem.Image"))); + this.collToolStripMenuItem.Name = "collToolStripMenuItem"; + this.collToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.collToolStripMenuItem.Text = "&Collection"; + // + // aeCollToolStripMenuItem + // + this.aeCollToolStripMenuItem.Name = "aeCollToolStripMenuItem"; + this.aeCollToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.aeCollToolStripMenuItem.Text = "Add / Edit"; + this.aeCollToolStripMenuItem.Click += new System.EventHandler(this.aeCollToolStripMenuItem_Click); + // + // toolStripSeparator8 + // + this.toolStripSeparator8.Name = "toolStripSeparator8"; + this.toolStripSeparator8.Size = new System.Drawing.Size(177, 6); + // + // toolStripSeparator0 + // + this.toolStripSeparator0.Name = "toolStripSeparator0"; + this.toolStripSeparator0.Size = new System.Drawing.Size(177, 6); + // // exportToolStripMenuItem // this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; this.exportToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); - this.exportToolStripMenuItem.Size = new System.Drawing.Size(147, 22); + this.exportToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.exportToolStripMenuItem.Text = "&Export"; this.exportToolStripMenuItem.Click += new System.EventHandler(this.exportToolStripMenuItem_Click); // @@ -247,20 +279,20 @@ public void InitializeComponent() this.saveToolStripMenuItem.Image = global::TVRename.Properties.Resources.saveHS; this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.saveToolStripMenuItem.Size = new System.Drawing.Size(147, 22); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.saveToolStripMenuItem.Text = "&Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(144, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); - this.exitToolStripMenuItem.Size = new System.Drawing.Size(147, 22); + this.exitToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.exitToolStripMenuItem.Text = "E&xit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); // @@ -354,7 +386,7 @@ public void InitializeComponent() this.folderMonitorToolStripMenuItem, this.duplicateFinderLOGToolStripMenuItem}); this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; - this.toolsToolStripMenuItem.Size = new System.Drawing.Size(47, 20); + this.toolsToolStripMenuItem.Size = new System.Drawing.Size(48, 20); this.toolsToolStripMenuItem.Text = "&Tools"; // // flushCacheToolStripMenuItem @@ -408,19 +440,19 @@ public void InitializeComponent() // this.statisticsToolStripMenuItem.Image = global::TVRename.Properties.Resources.graphhs; this.statisticsToolStripMenuItem.Name = "statisticsToolStripMenuItem"; - this.statisticsToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.statisticsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.statisticsToolStripMenuItem.Text = "&Statistics..."; this.statisticsToolStripMenuItem.Click += new System.EventHandler(this.statisticsToolStripMenuItem_Click); // // toolStripSeparator5 // this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(163, 6); + this.toolStripSeparator5.Size = new System.Drawing.Size(177, 6); // // showSummaryToolStripMenuItem // this.showSummaryToolStripMenuItem.Name = "showSummaryToolStripMenuItem"; - this.showSummaryToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.showSummaryToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.showSummaryToolStripMenuItem.Text = "Show Summary..."; this.showSummaryToolStripMenuItem.Click += new System.EventHandler(this.showSummaryToolStripMenuItem_Click); // @@ -428,7 +460,7 @@ public void InitializeComponent() // this.actorsToolStripMenuItem.Image = global::TVRename.Properties.Resources.TableHS; this.actorsToolStripMenuItem.Name = "actorsToolStripMenuItem"; - this.actorsToolStripMenuItem.Size = new System.Drawing.Size(166, 22); + this.actorsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.actorsToolStripMenuItem.Text = "&Actors Grid..."; this.actorsToolStripMenuItem.Click += new System.EventHandler(this.actorsToolStripMenuItem_Click); // @@ -479,9 +511,7 @@ public void InitializeComponent() this.toolStripSeparator7, this.buyMeADrinkToolStripMenuItem, this.toolStripSeparator6, - this.checkForNewVersionToolStripMenuItem, - this.toolStripSeparator8, - this.logToolStripMenuItem}); + this.checkForNewVersionToolStripMenuItem}); this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); this.helpToolStripMenuItem.Text = "&Help"; @@ -490,7 +520,7 @@ public void InitializeComponent() // this.quickstartGuideToolStripMenuItem.Image = global::TVRename.Properties.Resources.Help; this.quickstartGuideToolStripMenuItem.Name = "quickstartGuideToolStripMenuItem"; - this.quickstartGuideToolStripMenuItem.Size = new System.Drawing.Size(195, 22); + this.quickstartGuideToolStripMenuItem.Size = new System.Drawing.Size(196, 22); this.quickstartGuideToolStripMenuItem.Text = "&Quickstart Guide"; this.quickstartGuideToolStripMenuItem.Click += new System.EventHandler(this.quickstartGuideToolStripMenuItem_Click); // @@ -498,45 +528,45 @@ public void InitializeComponent() // this.visitWebsiteToolStripMenuItem.Image = global::TVRename.Properties.Resources.Web; this.visitWebsiteToolStripMenuItem.Name = "visitWebsiteToolStripMenuItem"; - this.visitWebsiteToolStripMenuItem.Size = new System.Drawing.Size(195, 22); + this.visitWebsiteToolStripMenuItem.Size = new System.Drawing.Size(196, 22); this.visitWebsiteToolStripMenuItem.Text = "&Visit Website"; this.visitWebsiteToolStripMenuItem.Click += new System.EventHandler(this.visitWebsiteToolStripMenuItem_Click); // // visitSupportForumToolStripMenuItem // this.visitSupportForumToolStripMenuItem.Name = "visitSupportForumToolStripMenuItem"; - this.visitSupportForumToolStripMenuItem.Size = new System.Drawing.Size(195, 22); + this.visitSupportForumToolStripMenuItem.Size = new System.Drawing.Size(196, 22); this.visitSupportForumToolStripMenuItem.Text = "Visit Support Forum"; this.visitSupportForumToolStripMenuItem.Click += new System.EventHandler(this.visitSupportForumToolStripMenuItem_Click); // // bugReportToolStripMenuItem // this.bugReportToolStripMenuItem.Name = "bugReportToolStripMenuItem"; - this.bugReportToolStripMenuItem.Size = new System.Drawing.Size(195, 22); + this.bugReportToolStripMenuItem.Size = new System.Drawing.Size(196, 22); this.bugReportToolStripMenuItem.Text = "Bug &Report"; this.bugReportToolStripMenuItem.Click += new System.EventHandler(this.bugReportToolStripMenuItem_Click); // // toolStripSeparator7 // this.toolStripSeparator7.Name = "toolStripSeparator7"; - this.toolStripSeparator7.Size = new System.Drawing.Size(192, 6); + this.toolStripSeparator7.Size = new System.Drawing.Size(193, 6); // // buyMeADrinkToolStripMenuItem // this.buyMeADrinkToolStripMenuItem.Name = "buyMeADrinkToolStripMenuItem"; - this.buyMeADrinkToolStripMenuItem.Size = new System.Drawing.Size(195, 22); + this.buyMeADrinkToolStripMenuItem.Size = new System.Drawing.Size(196, 22); this.buyMeADrinkToolStripMenuItem.Text = "&Buy Me A Drink"; this.buyMeADrinkToolStripMenuItem.Click += new System.EventHandler(this.buyMeADrinkToolStripMenuItem_Click); // // toolStripSeparator6 // this.toolStripSeparator6.Name = "toolStripSeparator6"; - this.toolStripSeparator6.Size = new System.Drawing.Size(192, 6); + this.toolStripSeparator6.Size = new System.Drawing.Size(193, 6); // // checkForNewVersionToolStripMenuItem // this.checkForNewVersionToolStripMenuItem.Name = "checkForNewVersionToolStripMenuItem"; - this.checkForNewVersionToolStripMenuItem.Size = new System.Drawing.Size(195, 22); + this.checkForNewVersionToolStripMenuItem.Size = new System.Drawing.Size(196, 22); this.checkForNewVersionToolStripMenuItem.Text = "Check For New Version"; this.checkForNewVersionToolStripMenuItem.Click += new System.EventHandler(this.checkForNewVersionToolStripMenuItem_Click); // @@ -1002,115 +1032,6 @@ public void InitializeComponent() this.bnActionBTSearch.UseVisualStyleBackColor = true; this.bnActionBTSearch.Click += new System.EventHandler(this.bnActionBTSearch_Click); // - // lvAction - // - this.lvAction.AllowDrop = true; - this.lvAction.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvAction.CheckBoxes = true; - this.lvAction.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader48, - this.columnHeader49, - this.columnHeader51, - this.columnHeader52, - this.columnHeader53, - this.columnHeader54, - this.columnHeader55, - this.columnHeader58}); - this.lvAction.FullRowSelect = true; - listViewGroup1.Header = "Missing"; - listViewGroup1.Name = "lvgActionMissing"; - listViewGroup2.Header = "Rename"; - listViewGroup2.Name = "lvgActionRename"; - listViewGroup3.Header = "Copy"; - listViewGroup3.Name = "lvgActionCopy"; - listViewGroup4.Header = "Move"; - listViewGroup4.Name = "lvgActionMove"; - listViewGroup5.Header = "Remove"; - listViewGroup5.Name = "lvgActionDelete"; - listViewGroup6.Header = "Download RSS"; - listViewGroup6.Name = "lvgActionDownloadRSS"; - listViewGroup7.Header = "Download"; - listViewGroup7.Name = "lvgActionDownload"; - listViewGroup8.Header = "Media Center Metadata"; - listViewGroup8.Name = "lvgActionMeta"; - listViewGroup9.Header = "Update File Metadata"; - listViewGroup9.Name = "lvgUpdateFileDates"; - listViewGroup10.Header = "Downloading"; - listViewGroup10.Name = "lvgDownloading"; - this.lvAction.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { - listViewGroup1, - listViewGroup2, - listViewGroup3, - listViewGroup4, - listViewGroup5, - listViewGroup6, - listViewGroup7, - listViewGroup8, - listViewGroup9, - listViewGroup10}); - this.lvAction.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.lvAction.HideSelection = false; - this.lvAction.Location = new System.Drawing.Point(0, 35); - this.lvAction.Name = "lvAction"; - this.lvAction.ShowItemToolTips = true; - this.lvAction.Size = new System.Drawing.Size(920, 435); - this.lvAction.SmallImageList = this.ilIcons; - this.lvAction.TabIndex = 2; - this.lvAction.UseCompatibleStateImageBehavior = false; - this.lvAction.View = System.Windows.Forms.View.Details; - this.lvAction.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.lvAction_ItemCheck); - this.lvAction.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lvAction_ItemChecked); - this.lvAction.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.lvAction_RetrieveVirtualItem); - this.lvAction.SelectedIndexChanged += new System.EventHandler(this.lvAction_SelectedIndexChanged); - this.lvAction.DragDrop += new System.Windows.Forms.DragEventHandler(this.lvAction_DragDrop); - this.lvAction.DragEnter += new System.Windows.Forms.DragEventHandler(this.lvAction_DragEnter); - this.lvAction.DragOver += new System.Windows.Forms.DragEventHandler(this.lvAction_DragEnter); - this.lvAction.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvAction_KeyDown); - this.lvAction.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvAction_MouseClick); - this.lvAction.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvAction_MouseDoubleClick); - // - // columnHeader48 - // - this.columnHeader48.Text = "Show"; - this.columnHeader48.Width = 155; - // - // columnHeader49 - // - this.columnHeader49.Text = "Season"; - this.columnHeader49.Width = 50; - // - // columnHeader51 - // - this.columnHeader51.Text = "Episode"; - this.columnHeader51.Width = 50; - // - // columnHeader52 - // - this.columnHeader52.Text = "Date"; - this.columnHeader52.Width = 70; - // - // columnHeader53 - // - this.columnHeader53.Text = "Folder"; - this.columnHeader53.Width = 180; - // - // columnHeader54 - // - this.columnHeader54.Text = "Filename"; - this.columnHeader54.Width = 180; - // - // columnHeader55 - // - this.columnHeader55.Text = "Source"; - this.columnHeader55.Width = 180; - // - // columnHeader58 - // - this.columnHeader58.Text = "Errors"; - this.columnHeader58.Width = 180; - // // ilIcons // this.ilIcons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ilIcons.ImageStream"))); @@ -1240,89 +1161,6 @@ public void InitializeComponent() this.calCalendar.TabIndex = 5; this.calCalendar.DateSelected += new System.Windows.Forms.DateRangeEventHandler(this.calCalendar_DateSelected); // - // lvWhenToWatch - // - this.lvWhenToWatch.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvWhenToWatch.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader29, - this.columnHeader30, - this.columnHeader31, - this.columnHeader32, - this.columnHeader36, - this.columnHeader33, - this.columnHeader34, - this.columnHeader35}); - this.lvWhenToWatch.FullRowSelect = true; - listViewGroup11.Header = "Recently Aired"; - listViewGroup11.Name = "justPassed"; - listViewGroup12.Header = "Next 7 Days"; - listViewGroup12.Name = "next7days"; - listViewGroup12.Tag = "1"; - listViewGroup13.Header = "Future Episodes"; - listViewGroup13.Name = "futureEps"; - listViewGroup14.Header = "Later"; - listViewGroup14.Name = "later"; - listViewGroup14.Tag = "2"; - this.lvWhenToWatch.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { - listViewGroup11, - listViewGroup12, - listViewGroup13, - listViewGroup14}); - this.lvWhenToWatch.HideSelection = false; - this.lvWhenToWatch.Location = new System.Drawing.Point(0, 35); - this.lvWhenToWatch.Name = "lvWhenToWatch"; - this.lvWhenToWatch.ShowItemToolTips = true; - this.lvWhenToWatch.Size = new System.Drawing.Size(923, 297); - this.lvWhenToWatch.SmallImageList = this.ilIcons; - this.lvWhenToWatch.TabIndex = 3; - this.lvWhenToWatch.UseCompatibleStateImageBehavior = false; - this.lvWhenToWatch.View = System.Windows.Forms.View.Details; - this.lvWhenToWatch.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lvWhenToWatch_ColumnClick); - this.lvWhenToWatch.SelectedIndexChanged += new System.EventHandler(this.lvWhenToWatch_Click); - this.lvWhenToWatch.DoubleClick += new System.EventHandler(this.lvWhenToWatch_DoubleClick); - this.lvWhenToWatch.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvWhenToWatch_MouseClick); - // - // columnHeader29 - // - this.columnHeader29.Text = "Show"; - this.columnHeader29.Width = 187; - // - // columnHeader30 - // - this.columnHeader30.Text = "Season"; - this.columnHeader30.Width = 51; - // - // columnHeader31 - // - this.columnHeader31.Text = "Episode"; - this.columnHeader31.Width = 55; - // - // columnHeader32 - // - this.columnHeader32.Text = "Air Date"; - this.columnHeader32.Width = 81; - // - // columnHeader36 - // - this.columnHeader36.Text = "Time"; - // - // columnHeader33 - // - this.columnHeader33.Text = "Day"; - this.columnHeader33.Width = 42; - // - // columnHeader34 - // - this.columnHeader34.Text = "How Long"; - this.columnHeader34.Width = 69; - // - // columnHeader35 - // - this.columnHeader35.Text = "Episode Name"; - this.columnHeader35.Width = 360; - // // tableLayoutPanel2 // this.tableLayoutPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) @@ -1505,17 +1343,203 @@ public void InitializeComponent() this.btnUpdateAvailable.Visible = false; this.btnUpdateAvailable.Click += new System.EventHandler(this.btnUpdateAvailable_Click); // - // toolStripSeparator8 + // lvAction // - this.toolStripSeparator8.Name = "toolStripSeparator8"; - this.toolStripSeparator8.Size = new System.Drawing.Size(192, 6); + this.lvAction.AllowDrop = true; + this.lvAction.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvAction.CheckBoxes = true; + this.lvAction.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader48, + this.columnHeader49, + this.columnHeader51, + this.columnHeader52, + this.columnHeader53, + this.columnHeader54, + this.columnHeader55, + this.columnHeader56, + this.columnHeader58}); + this.lvAction.FullRowSelect = true; + listViewGroup1.Header = "Missing"; + listViewGroup1.Name = "lvgActionMissing"; + listViewGroup2.Header = "Rename"; + listViewGroup2.Name = "lvgActionRename"; + listViewGroup3.Header = "Copy"; + listViewGroup3.Name = "lvgActionCopy"; + listViewGroup4.Header = "Move"; + listViewGroup4.Name = "lvgActionMove"; + listViewGroup5.Header = "Remove"; + listViewGroup5.Name = "lvgActionDelete"; + listViewGroup6.Header = "Download RSS"; + listViewGroup6.Name = "lvgActionDownloadRSS"; + listViewGroup7.Header = "Download"; + listViewGroup7.Name = "lvgActionDownload"; + listViewGroup8.Header = "Media Center Metadata"; + listViewGroup8.Name = "lvgActionMeta"; + listViewGroup9.Header = "Update File Metadata"; + listViewGroup9.Name = "lvgUpdateFileDates"; + listViewGroup10.Header = "Downloading"; + listViewGroup10.Name = "lvgDownloading"; + this.lvAction.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { + listViewGroup1, + listViewGroup2, + listViewGroup3, + listViewGroup4, + listViewGroup5, + listViewGroup6, + listViewGroup7, + listViewGroup8, + listViewGroup9, + listViewGroup10}); + this.lvAction.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.lvAction.HideSelection = false; + this.lvAction.Location = new System.Drawing.Point(0, 35); + this.lvAction.Name = "lvAction"; + this.lvAction.ShowItemToolTips = true; + this.lvAction.Size = new System.Drawing.Size(920, 435); + this.lvAction.SmallImageList = this.ilIcons; + this.lvAction.TabIndex = 2; + this.lvAction.UseCompatibleStateImageBehavior = false; + this.lvAction.View = System.Windows.Forms.View.Details; + this.lvAction.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.lvAction_ItemCheck); + this.lvAction.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lvAction_ItemChecked); + this.lvAction.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.lvAction_RetrieveVirtualItem); + this.lvAction.SelectedIndexChanged += new System.EventHandler(this.lvAction_SelectedIndexChanged); + this.lvAction.DragDrop += new System.Windows.Forms.DragEventHandler(this.lvAction_DragDrop); + this.lvAction.DragEnter += new System.Windows.Forms.DragEventHandler(this.lvAction_DragEnter); + this.lvAction.DragOver += new System.Windows.Forms.DragEventHandler(this.lvAction_DragEnter); + this.lvAction.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvAction_KeyDown); + this.lvAction.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvAction_MouseClick); + this.lvAction.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvAction_MouseDoubleClick); + // + // columnHeader48 + // + this.columnHeader48.Text = "Show"; + this.columnHeader48.Width = 155; + // + // columnHeader49 + // + this.columnHeader49.Text = "Season"; + this.columnHeader49.Width = 50; + // + // columnHeader51 + // + this.columnHeader51.Text = "Episode"; + this.columnHeader51.Width = 50; + // + // columnHeader52 + // + this.columnHeader52.Text = "Date"; + this.columnHeader52.Width = 70; + // + // columnHeader53 + // + this.columnHeader53.Text = "Folder"; + this.columnHeader53.Width = 180; // - // logToolStripMenuItem + // columnHeader54 + // + this.columnHeader54.Text = "Episode/Filename"; + this.columnHeader54.Width = 180; + // + // columnHeader55 + // + this.columnHeader55.Text = "Folder/Filename"; + this.columnHeader55.Width = 180; + // + // columnHeader56 + // + this.columnHeader56.Text = "Filename"; + this.columnHeader56.Width = 180; + // + // columnHeader58 + // + this.columnHeader58.Text = "Errors"; + this.columnHeader58.Width = 180; + // + // lvWhenToWatch // - this.logToolStripMenuItem.Name = "logToolStripMenuItem"; - this.logToolStripMenuItem.Size = new System.Drawing.Size(195, 22); - this.logToolStripMenuItem.Text = "Log"; - this.logToolStripMenuItem.Click += new System.EventHandler(this.logToolStripMenuItem_Click); + this.lvWhenToWatch.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvWhenToWatch.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader29, + this.columnHeader30, + this.columnHeader31, + this.columnHeader32, + this.columnHeader36, + this.columnHeader33, + this.columnHeader34, + this.columnHeader35}); + this.lvWhenToWatch.FullRowSelect = true; + listViewGroup11.Header = "Recently Aired"; + listViewGroup11.Name = "justPassed"; + listViewGroup12.Header = "Next 7 Days"; + listViewGroup12.Name = "next7days"; + listViewGroup12.Tag = "1"; + listViewGroup13.Header = "Future Episodes"; + listViewGroup13.Name = "futureEps"; + listViewGroup14.Header = "Later"; + listViewGroup14.Name = "later"; + listViewGroup14.Tag = "2"; + this.lvWhenToWatch.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { + listViewGroup11, + listViewGroup12, + listViewGroup13, + listViewGroup14}); + this.lvWhenToWatch.HideSelection = false; + this.lvWhenToWatch.Location = new System.Drawing.Point(0, 35); + this.lvWhenToWatch.Name = "lvWhenToWatch"; + this.lvWhenToWatch.ShowItemToolTips = true; + this.lvWhenToWatch.Size = new System.Drawing.Size(923, 297); + this.lvWhenToWatch.SmallImageList = this.ilIcons; + this.lvWhenToWatch.TabIndex = 3; + this.lvWhenToWatch.UseCompatibleStateImageBehavior = false; + this.lvWhenToWatch.View = System.Windows.Forms.View.Details; + this.lvWhenToWatch.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lvWhenToWatch_ColumnClick); + this.lvWhenToWatch.SelectedIndexChanged += new System.EventHandler(this.lvWhenToWatch_Click); + this.lvWhenToWatch.DoubleClick += new System.EventHandler(this.lvWhenToWatch_DoubleClick); + this.lvWhenToWatch.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvWhenToWatch_MouseClick); + // + // columnHeader29 + // + this.columnHeader29.Text = "Show"; + this.columnHeader29.Width = 187; + // + // columnHeader30 + // + this.columnHeader30.Text = "Season"; + this.columnHeader30.Width = 51; + // + // columnHeader31 + // + this.columnHeader31.Text = "Episode"; + this.columnHeader31.Width = 55; + // + // columnHeader32 + // + this.columnHeader32.Text = "Air Date"; + this.columnHeader32.Width = 81; + // + // columnHeader36 + // + this.columnHeader36.Text = "Time"; + // + // columnHeader33 + // + this.columnHeader33.Text = "Day"; + this.columnHeader33.Width = 42; + // + // columnHeader34 + // + this.columnHeader34.Text = "How Long"; + this.columnHeader34.Width = 69; + // + // columnHeader35 + // + this.columnHeader35.Text = "Episode Name"; + this.columnHeader35.Width = 360; // // UI // @@ -1574,6 +1598,7 @@ public void InitializeComponent() private System.Windows.Forms.ColumnHeader columnHeader53; private System.Windows.Forms.ColumnHeader columnHeader54; private System.Windows.Forms.ColumnHeader columnHeader55; + private System.Windows.Forms.ColumnHeader columnHeader56; private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; private System.Windows.Forms.ToolStripMenuItem folderMonitorToolStripMenuItem; @@ -1695,7 +1720,9 @@ public void InitializeComponent() private ToolStripSeparator toolStripSeparator5; private ToolStripSeparator toolStripSeparator7; private ToolStripSeparator toolStripSeparator6; + private ToolStripMenuItem collToolStripMenuItem; + private ToolStripSeparator toolStripSeparator0; + private ToolStripMenuItem aeCollToolStripMenuItem; private ToolStripSeparator toolStripSeparator8; - private ToolStripMenuItem logToolStripMenuItem; } } diff --git a/TVRename/Forms/UI.cs b/TVRename/Forms/UI.cs index c0fafb9b7..ab5c43138 100644 --- a/TVRename/Forms/UI.cs +++ b/TVRename/Forms/UI.cs @@ -148,6 +148,13 @@ public UI(TVDoc doc, TVRenameSplash splash, bool showUi) } UpdateSplashStatus(splash, "Filling Shows"); + + if (!TVSettings.Instance.ShowCollections) + { + collToolStripMenuItem.Visible = false; + toolStripSeparator0.Visible = false; + } + FillMyShows(); UpdateSearchButtons(); ClearInfoWindows(); @@ -162,6 +169,8 @@ public UI(TVDoc doc, TVRenameSplash splash, bool showUi) UpdateSplashStatus(splash, "Setting Notifications"); ShowHideNotificationIcon(); + BuildCollectionsMenu(); + int t = TVSettings.Instance.StartupTab; if (t < tabControl1.TabCount) tabControl1.SelectedIndex = TVSettings.Instance.StartupTab; @@ -555,7 +564,9 @@ private void UI_FormClosing(object sender, FormClosingEventArgs e) MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning); if (res == DialogResult.Yes) - mDoc.WriteXMLSettings(); + { + mDoc.WriteXMLFile(FileToHandle.Settings | FileToHandle.Shows | FileToHandle.TvDB); + } else if (res == DialogResult.Cancel) e.Cancel = true; else if (res == DialogResult.No) @@ -1457,6 +1468,106 @@ private void MenuFolders(LVResults lvr) } } + private void BuildCollectionsMenu () + { + // ActualCollMenuItem + if (mDoc.ShowCollections.Count == 0) + { + // Setup a default collection when we come's from 2.4.x RCy + ShowCollection Sc = new ShowCollection("2.1"); + Sc.Name = "Default"; + Sc.Description = "Default collection in mono collection use"; + mDoc.ShowCollections.Add(Sc); + mDoc.WriteXMLFile(FileToHandle.Collections); + } + + ToolStripMenuItem[] CollMenu = new ToolStripMenuItem[mDoc.ShowCollections.Count]; + int i = 0; + foreach (ShowCollection ShowColl in mDoc.ShowCollections) + { + CollMenu[i] = new ToolStripMenuItem(); + CollMenu[i].Name = "CollectionMenuItem" + i.ToString(); + CollMenu[i].Tag = ShowColl; + CollMenu[i].Text = ShowColl.Name; + CollMenu[i].ToolTipText = ShowColl.Description; + if (ShowColl.Path == PathManager.ShowCollection) + { + CollMenu[i].Checked = true; + } + CollMenu[i].Click += new EventHandler(SelCollMenuItemClickHandler); + i++; + } + + collToolStripMenuItem.DropDownItems.AddRange(CollMenu); + } + + private void RemoveCollectionsMenu () + { + int iCount = collToolStripMenuItem.DropDownItems.Count -2; + string MenuItemName = ""; + for (int iCurr = 0; iCurr < iCount; iCurr++) + { + MenuItemName = "CollectionMenuItem" + iCurr.ToString(); + collToolStripMenuItem.DropDownItems.RemoveAt(2); + } + } + + private void SelCollMenuItemClickHandler(object sender, EventArgs e) + { + bool bNeedCancel = false; + ToolStripMenuItem clickedItem = (ToolStripMenuItem)sender; + ShowCollection SelectedCollection = (ShowCollection)clickedItem.Tag; + + try + { + if (mDoc.Dirty()) + { + DialogResult res = MessageBox.Show( + "Your changes have not been saved. Do you wish to save before changing show collection?", "Unsaved data", + MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning); + + if (res == DialogResult.Yes) + { + mDoc.WriteXMLFile(FileToHandle.Settings | FileToHandle.Shows | FileToHandle.TvDB); + } + else if (res == DialogResult.Cancel) + bNeedCancel = true; + else if (res == DialogResult.No) + { + bNeedCancel = false; + } + } + + if (!bNeedCancel) + { + ToolStripItemCollection TSMIC = collToolStripMenuItem.DropDownItems; + ToolStripMenuItem TsM; + foreach (ToolStripItem TsI in TSMIC) + { + try + { + TsM = (ToolStripMenuItem)TsI; + TsM.Checked = false; + } + catch (Exception) + { + // Just a pass thru for MenuSeparators + } + } + clickedItem.Checked = true; + + mDoc.SwitchToCollection(SelectedCollection.Path); + mDoc.WriteXMLFile(FileToHandle.Collections); + FillMyShows(); + } + } + catch (Exception ex) + { + MessageBox.Show(this, ex.Message + "\r\n\r\n" + ex.StackTrace, "Switch Show Collection", + MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + private void BuildRightClickMenu(Point pt) { showRightClickMenu.Items.Clear(); @@ -1776,6 +1887,8 @@ private void DoPrefs(bool scanOptions) ShowHideNotificationIcon(); FillWhenToWatchList(); ShowInTaskbar = TVSettings.Instance.ShowInTaskbar; + collToolStripMenuItem.Visible = (TVSettings.Instance.ShowCollections) ? true : false; + toolStripSeparator0.Visible = (TVSettings.Instance.ShowCollections) ? true : false; FillEpGuideHtml(); mAutoFolderMonitor.SettingsChanged(TVSettings.Instance.MonitorFolders); betaToolsToolStripMenuItem.Visible = TVSettings.Instance.IncludeBetaUpdates(); @@ -1790,8 +1903,7 @@ private void saveToolStripMenuItem_Click(object sender, EventArgs e) { try { - mDoc.WriteXMLSettings(); - TheTVDB.Instance.SaveCache(); + mDoc.WriteXMLFile(FileToHandle.Collections | FileToHandle.Settings | FileToHandle.Shows | FileToHandle.TvDB); if (!SaveLayoutXml()) { Logger.Error("Failed to Save Layout Configuration Files"); @@ -1848,7 +1960,7 @@ private void statusTimer_Tick(object sender, EventArgs e) if (n == 0 && lastDlRemaining > 0) { // we've just finished a bunch of background downloads - TheTVDB.Instance.SaveCache(); + mDoc.WriteXMLFile(FileToHandle.TvDB); RefreshWTW(false); backgroundDownloadNowToolStripMenuItem.Enabled = true; @@ -2190,7 +2302,7 @@ private void DeleteShow(ShowItem si) if (res != DialogResult.Yes) return; - if (Directory.Exists(si.AutoAddFolderBase)) + if ((Directory.Exists(si.AutoAddFolderBase)) && TVSettings.Instance.DeleteShowFromDisk) { DialogResult res3 = MessageBox.Show( $"Remove folder \"{si.AutoAddFolderBase}\" from disk?", @@ -2406,7 +2518,7 @@ private List CurrentlySelectedPel() private void filenameTemplateEditorToolStripMenuItem_Click(object sender, EventArgs e) { CustomEpisodeName cn = new CustomEpisodeName(TVSettings.Instance.NamingStyle.StyleString); - CustomNameDesigner cne = new CustomNameDesigner(CurrentlySelectedPel(), cn); + CustomNameDesigner cne = new CustomNameDesigner(CurrentlySelectedPel(), cn, mDoc); DialogResult dr = cne.ShowDialog(); if (dr == DialogResult.OK) { @@ -3587,10 +3699,14 @@ private void exportToolStripMenuItem_Click(object sender, EventArgs e) } - private void logToolStripMenuItem_Click(object sender, EventArgs e) + private void aeCollToolStripMenuItem_Click(object sender, EventArgs e) { - LogViewer form = new LogViewer(); - form.Show(); + AddEditCollection AEC = new AddEditCollection(mDoc); + if (AEC.ShowDialog() == DialogResult.OK) + { + RemoveCollectionsMenu(); + BuildCollectionsMenu(); + } } } } diff --git a/TVRename/Forms/UI.resx b/TVRename/Forms/UI.resx index 39821f653..b4bfa1d05 100644 --- a/TVRename/Forms/UI.resx +++ b/TVRename/Forms/UI.resx @@ -120,6 +120,19 @@ 139, 17 + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1 + MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAACwwAAAsMAT9AIsgAAAE7SURBVDhPlZIhc4QwEIX5S5W1 + lUjkWWQlEotERmKRyJOxkZErYyMjI7dvEzg4kk6nmfnmuMm+717CNcxcZTGBlfYvhpUyi+V5NRjJc0Xw + QEKyfDhxIabPWQceIZK5algQgQwbd/KkyHCkZ4WGE5pUw4IIZNhiWJCQhuBoIXvdZOth4SXASRIXybaL + HiJwumVv+oJCcJNIi9TAPT/xg+WqCi6SmyBydDNQHP0CtrQpAkLo4CqRvSzYDgHCIOienfr4k7OBCGJg + rwf2W8d+bTlYlQZ+WyIIyGTBer0D9NrJRylBzVuDJJCAnP/EU8YBQiNrZzZmYiKbBN1o9te4VATpQicw + ggF8gwdHajGaBVjp/9I4le/gDN7DPcjhSF8VwYwvOFc64/4m3kWAICPIAAfzLiDVskj+g2SygJsf4FxG + MwKGJzMAAAAASUVORK5CYII= + + 17, 95 @@ -128,7 +141,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADk - HQAAAk1TRnQBSQFMAgEBEwEAAcgBAwHIAQMBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + HQAAAk1TRnQBSQFMAgEBEwEAARABBAEQAQQBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAAVADAAEBAQABCAYAARQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -258,7 +271,6 @@ AgABgAEBAgABgAEBAgABwAEDAgABgAEBAgAB8AEPAgAC/wIACw== - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6 @@ -274,7 +286,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC0 - HQAAAk1TRnQBSQFMAgEBCwEAAeQBAwHkAQMBEgEAAQ0BAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFI + HQAAAk1TRnQBSQFMAgEBCwEAASwBBAEsAQQBEgEAAQ0BAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFI AwABJwMAAQEBAAEYBQAB6AEgGAAD7wMSBjADCQYwAw8DKgMwAxsD0Q8AASEB1gEIASEB1gEIASEB1gEI ASEB1gEIMAAC+AH3AfMB6AHaAfEB0wG2AeEBswGMAdYBnAFxAdIBlAFoAdIBlAFnAdQBmgFvAd8BrQGG AfAB0QGzAfMB5gHVAfcB9gH1RQAD7wM8A58D5gMwA+ADzgNPA9gDtwOPA9EMAAEhAdYBCAEhAdYBCAEh @@ -712,7 +724,7 @@ 829, 56 - 112 + 81 diff --git a/TVRename/Forms/Utilities/RecoverXML.cs b/TVRename/Forms/Utilities/RecoverXML.cs index 7c9514d03..724f2d3a7 100644 --- a/TVRename/Forms/Utilities/RecoverXML.cs +++ b/TVRename/Forms/Utilities/RecoverXML.cs @@ -7,7 +7,7 @@ // using System.Windows.Forms; using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; - +using DirectoryInfo = Alphaleonis.Win32.Filesystem.DirectoryInfo ; namespace TVRename { /// diff --git a/TVRename/Forms/Utilities/RecoverXML.resx b/TVRename/Forms/Utilities/RecoverXML.resx index bcc03471a..bacb4057a 100644 --- a/TVRename/Forms/Utilities/RecoverXML.resx +++ b/TVRename/Forms/Utilities/RecoverXML.resx @@ -112,12 +112,12 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + AAABAAIAICAQAAAABADoAgAAJgAAABAQEAAAAAQAKAEAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAAAAAC diff --git a/TVRename/ItemsAndActions/ActionCopyMoveRename.cs b/TVRename/ItemsAndActions/ActionCopyMoveRename.cs index 812712347..c50f15e43 100644 --- a/TVRename/ItemsAndActions/ActionCopyMoveRename.cs +++ b/TVRename/ItemsAndActions/ActionCopyMoveRename.cs @@ -237,8 +237,9 @@ private long SourceFileSize() } } - protected override string DestinationFolder => To.DirectoryName; - protected override string DestinationFile => To.Name; - protected override string SourceDetails => From.FullName; + protected override string FileInfo1 => From.DirectoryName; + protected override string FileInfo2 => From.Name; + protected override string FileInfo3 => To.DirectoryName; + protected override string FileInfo4 => To.Name; } } diff --git a/TVRename/ItemsAndActions/ActionDateTouch.cs b/TVRename/ItemsAndActions/ActionDateTouch.cs index cf3f28c68..c7e72eca3 100644 --- a/TVRename/ItemsAndActions/ActionDateTouch.cs +++ b/TVRename/ItemsAndActions/ActionDateTouch.cs @@ -8,6 +8,7 @@ namespace TVRename { using System; + using System.Windows.Forms; using DirectoryInfo = Alphaleonis.Win32.Filesystem.DirectoryInfo; using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; @@ -106,18 +107,50 @@ public override int Compare(Item o) public override IgnoreItem Ignore => whereFile == null ? null : new IgnoreItem(whereFile.FullName); - protected override string SeriesName => (Episode != null) ? Episode.Show.ShowName : - (season != null) ? season.TheSeries.Name : show.ShowName; - protected override string SeasonNumber => (Episode != null) ? Episode.AppropriateSeasonNumber.ToString() : - (season != null) ? season.SeasonNumber.ToString() : string.Empty; - protected override string EpisodeNumber => (Episode != null) ? Episode.NumsAsString() : string.Empty; - protected override string AirDate => - (updateTime.CompareTo(DateTime.MaxValue)) != 0 ? updateTime.ToShortDateString() : ""; - protected override string DestinationFolder => whereFile?.DirectoryName ?? whereDirectory?.FullName; - protected override string DestinationFile => whereFile?.Name ?? whereDirectory?.Name; - protected override string SourceDetails => string.Empty; + public override ListViewItem ScanListViewItem + { + get + { + ListViewItem lvi = new ListViewItem(); + + if (Episode != null) + { + lvi.Text = Episode.Show.ShowName; + lvi.SubItems.Add(Episode.AppropriateSeasonNumber.ToString()); + lvi.SubItems.Add(Episode.NumsAsString()); + + } + else if (season != null) + { + lvi.Text = season.TheSeries.Name; + lvi.SubItems.Add(season.SeasonNumber.ToString()); + lvi.SubItems.Add(""); + + } + else if (show != null) + { + lvi.Text = show.ShowName; + lvi.SubItems.Add(""); + lvi.SubItems.Add(""); + } + + DateTime dt = updateTime; + + lvi.SubItems.Add((dt.CompareTo(DateTime.MaxValue)) != 0 ? dt.ToShortDateString() : ""); + + lvi.SubItems.Add(whereFile?.DirectoryName??whereDirectory?.FullName); + lvi.SubItems.Add(whereFile?.Name??whereDirectory?.Name); + + lvi.Tag = this; + + return lvi; + } + } + public override string TargetFolder => whereFile?.DirectoryName??whereDirectory?.Name; + public override string ScanListViewGroup => "lvgUpdateFileDates"; + public override int IconNumber => 7; #endregion diff --git a/TVRename/ItemsAndActions/ActionDelete.cs b/TVRename/ItemsAndActions/ActionDelete.cs index b29de387b..6d124b73b 100644 --- a/TVRename/ItemsAndActions/ActionDelete.cs +++ b/TVRename/ItemsAndActions/ActionDelete.cs @@ -12,10 +12,10 @@ public abstract class ActionDelete : ActionFileOperation public override long SizeOfWork => 100; public override int IconNumber => 9; public override string ScanListViewGroup => "lvgActionDelete"; - - protected override string DestinationFolder => TargetFolder; - protected override string DestinationFile => ProgressText; - protected override string SourceDetails => string.Empty; + protected override string FileInfo1 => TargetFolder; + protected override string FileInfo2 => ProgressText; + protected override string FileInfo3 => string.Empty; + protected override string FileInfo4 => string.Empty; } public class ActionDeleteFile : ActionDelete { @@ -28,7 +28,7 @@ public ActionDeleteFile(FileInfo remove, ProcessedEpisode ep, TidySettings tidyu Episode = ep; toRemove = remove; } - + public override string ProgressText => toRemove.Name; public override string Produces => toRemove.FullName; public override IgnoreItem Ignore => toRemove == null ? null : new IgnoreItem(toRemove.FullName); diff --git a/TVRename/ItemsAndActions/ActionDownloadImage.cs b/TVRename/ItemsAndActions/ActionDownloadImage.cs index 662825f54..cb2e0a29f 100644 --- a/TVRename/ItemsAndActions/ActionDownloadImage.cs +++ b/TVRename/ItemsAndActions/ActionDownloadImage.cs @@ -13,6 +13,7 @@ namespace TVRename { using System; + using System.Windows.Forms; using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; using System.IO; @@ -166,19 +167,44 @@ public override int Compare(Item o) public override int IconNumber => 5; public override IgnoreItem Ignore => GenerateIgnore(Destination?.FullName); + + public override ListViewItem ScanListViewItem + { + get + { + ListViewItem lvi = new ListViewItem { + Text = (Episode != null) ? Episode.Show.ShowName : ((SI != null) ? SI.ShowName : "") + }; + + lvi.SubItems.Add(Episode?.AppropriateSeasonNumber.ToString() ?? ""); + lvi.SubItems.Add(Episode?.NumsAsString() ?? ""); + lvi.SubItems.Add(Episode != null ? Episode.GetAirDateDT(true).PrettyPrint() : ""); + lvi.SubItems.Add(Destination.DirectoryName); + lvi.SubItems.Add(Path); + + if (string.IsNullOrEmpty(Path)) + lvi.BackColor = Helpers.WarningColor(); - protected override string SeriesName => - (Episode != null) ? Episode.Show.ShowName : ((SI != null) ? SI.ShowName : ""); + lvi.SubItems.Add(Destination.Name); + + lvi.Tag = this; + + return lvi; + } + } - protected override string SeasonNumber => Episode?.AppropriateSeasonNumber.ToString() ?? ""; - protected override string EpisodeNumber => Episode?.NumsAsString() ?? ""; - protected override string AirDate => Episode != null ? Episode.GetAirDateDT(true).PrettyPrint() : ""; - protected override string DestinationFolder => TargetFolder; - protected override string DestinationFile => Destination.Name; - protected override string SourceDetails => Path; - protected override bool InError => string.IsNullOrEmpty(Path); public override string ScanListViewGroup => "lvgActionDownload"; - public override string TargetFolder => Destination == null ? null : Destination.DirectoryName; + + public override string TargetFolder + { + get + { + if (Destination == null) + return null; + return Destination.DirectoryName; + } + } + #endregion } } diff --git a/TVRename/ItemsAndActions/ActionItem.cs b/TVRename/ItemsAndActions/ActionItem.cs index b0d0fc0a5..75e1f278f 100644 --- a/TVRename/ItemsAndActions/ActionItem.cs +++ b/TVRename/ItemsAndActions/ActionItem.cs @@ -19,6 +19,7 @@ namespace TVRename public abstract class Item // something shown in the list on the Scan tab (not always an Action) { + public abstract ListViewItem ScanListViewItem { get; } // to add to Scan ListView public abstract string TargetFolder { get; } // return a list of folders for right-click menu public abstract string ScanListViewGroup { get; } // which group name for the listview public abstract int IconNumber { get; } // which icon number to use in "ilIcons" (UI.cs). -1 for none @@ -31,37 +32,6 @@ protected static IgnoreItem GenerateIgnore(string file) { return string.IsNullOrEmpty(file) ? null : new IgnoreItem(file); } - - public ListViewItem ScanListViewItem // to add to Scan ListView - { - get - { - ListViewItem lvi = new ListViewItem {Text = SeriesName}; - - lvi.SubItems.Add(SeasonNumber); - lvi.SubItems.Add(EpisodeNumber); - lvi.SubItems.Add(AirDate); - lvi.SubItems.Add(DestinationFolder); - lvi.SubItems.Add(DestinationFile); - lvi.SubItems.Add(SourceDetails); - - if (InError) - lvi.BackColor = Helpers.WarningColor(); - - lvi.Tag = this; - - return lvi; - } - } - - protected abstract string SeriesName { get; } - protected abstract string SeasonNumber { get; } - protected abstract string EpisodeNumber { get; } - protected abstract string AirDate { get; } - protected abstract string DestinationFolder { get; } - protected abstract string DestinationFile { get; } - protected abstract string SourceDetails { get; } - protected virtual bool InError => false; } public abstract class Action : Item // Something we can do @@ -220,10 +190,41 @@ protected void DoTidyup(DirectoryInfo di) DeleteOrRecycleFolder(di); } - protected override string SeriesName => Episode?.TheSeries?.Name ?? string.Empty; - protected override string SeasonNumber => Episode?.AppropriateSeasonNumber.ToString() ?? string.Empty; - protected override string EpisodeNumber => Episode?.NumsAsString() ?? string.Empty; - protected override string AirDate => Episode?.GetAirDateDT(true).PrettyPrint()??string.Empty; + public override ListViewItem ScanListViewItem + { + get + { + ListViewItem lvi = new ListViewItem(); + + if (Episode == null) + { + lvi.Text = ""; + lvi.SubItems.Add(""); + lvi.SubItems.Add(""); + lvi.SubItems.Add(""); + lvi.SubItems.Add(""); + } + else + { + lvi.Text = Episode.TheSeries.Name; + lvi.SubItems.Add(Episode.AppropriateSeasonNumber.ToString()); + lvi.SubItems.Add(Episode.NumsAsString()); + lvi.SubItems.Add(Episode.GetAirDateDT(true).PrettyPrint()); + } + + lvi.SubItems.Add(FileInfo1); + lvi.SubItems.Add(FileInfo2); + lvi.SubItems.Add(FileInfo3); + lvi.SubItems.Add(FileInfo4); + + return lvi; + } + } + + protected abstract string FileInfo1 { get; } + protected abstract string FileInfo2 { get; } + protected abstract string FileInfo3 { get; } + protected abstract string FileInfo4 { get; } } public abstract class ActionWriteMetadata : ActionDownload @@ -251,22 +252,38 @@ protected ActionWriteMetadata(FileInfo where, ShowItem sI) public override int IconNumber => 7; - protected override string SeriesName => Episode?.Show?.ShowName ?? SelectedShow.ShowName; - - protected override string SeasonNumber => Episode?.AppropriateSeasonNumber.ToString() ?? string.Empty; - - protected override string EpisodeNumber => Episode?.NumsAsString() ?? string.Empty; - - protected override string AirDate => Episode?.GetAirDateDT(true).PrettyPrint() ?? string.Empty; - - protected override string DestinationFolder => Where.DirectoryName; + public override ListViewItem ScanListViewItem + { + get + { + ListViewItem lvi = new ListViewItem(); + + if (Episode != null) + { + lvi.Text = Episode.Show.ShowName; + lvi.SubItems.Add(Episode.AppropriateSeasonNumber.ToString()); + lvi.SubItems.Add(Episode.NumsAsString()); + lvi.SubItems.Add(Episode.GetAirDateDT(true).PrettyPrint()); + } + else + { + lvi.Text = SelectedShow.ShowName; + lvi.SubItems.Add(""); + lvi.SubItems.Add(""); + lvi.SubItems.Add(""); + } + + lvi.SubItems.Add(Where.DirectoryName); + lvi.SubItems.Add(Where.Name); - protected override string DestinationFile => Where.Name; + lvi.Tag = this; - protected override string SourceDetails => string.Empty; + return lvi; + } + } } - public class ItemList : List + public class ItemList : System.Collections.Generic.List { public void Add(ItemList slil) { @@ -282,7 +299,7 @@ public void Add(ItemList slil) public class ActionQueue { - public readonly List Actions; // The contents of this queue + public readonly System.Collections.Generic.List Actions; // The contents of this queue public readonly int ParallelLimit; // Number of tasks in the queue than can be run at once public readonly string Name; // Name of this queue public int ActionPosition; // Position in the queue list of the next item to process @@ -291,7 +308,7 @@ public ActionQueue(string name, int parallelLimit) { Name = name; ParallelLimit = parallelLimit; - Actions = new List(); + Actions = new System.Collections.Generic.List(); ActionPosition = 0; } } diff --git a/TVRename/ItemsAndActions/ActionItemSorter.cs b/TVRename/ItemsAndActions/ActionItemSorter.cs index c851afa50..21ce9bb56 100644 --- a/TVRename/ItemsAndActions/ActionItemSorter.cs +++ b/TVRename/ItemsAndActions/ActionItemSorter.cs @@ -11,10 +11,8 @@ public class ActionItemSorter : System.Collections.Generic.IComparer { #region IComparer Members - public int Compare(Item x, Item y) + public virtual int Compare(Item x, Item y) { - if (x is null) return -1; - if (y is null) return 1; return (x.GetType() == y.GetType()) ? x.Compare(y) : (TypeNumber(x) - TypeNumber(y)); } diff --git a/TVRename/ItemsAndActions/ActionMede8erViewXML.cs b/TVRename/ItemsAndActions/ActionMede8erViewXML.cs index ce14344ed..80683252a 100644 --- a/TVRename/ItemsAndActions/ActionMede8erViewXML.cs +++ b/TVRename/ItemsAndActions/ActionMede8erViewXML.cs @@ -10,6 +10,7 @@ namespace TVRename { using System; using Alphaleonis.Win32.Filesystem; + using System.Windows.Forms; using System.Xml; public class ActionMede8erViewXML : ActionWriteMetadata @@ -81,13 +82,23 @@ public override int Compare(Item o) #region Item Members - protected override string SeriesName => SelectedShow.ShowName; - protected override string SeasonNumber => snum > 0 ? snum.ToString() : ""; - protected override string EpisodeNumber => string.Empty; - protected override string AirDate => string.Empty; - protected override string DestinationFolder => Where.DirectoryName; - protected override string DestinationFile => Where.Name; - protected override string SourceDetails => string.Empty; + public override ListViewItem ScanListViewItem + { + get + { + ListViewItem lvi = new ListViewItem {Text = SelectedShow.ShowName}; + + lvi.SubItems.Add(snum > 0 ? snum.ToString() : ""); + lvi.SubItems.Add(""); + lvi.SubItems.Add(""); + lvi.SubItems.Add(Where.DirectoryName); + lvi.SubItems.Add(Where.Name); + + lvi.Tag = this; + + return lvi; + } + } #endregion } diff --git a/TVRename/ItemsAndActions/ActionPyTivoMeta.cs b/TVRename/ItemsAndActions/ActionPyTivoMeta.cs index 0065ac968..935949044 100644 --- a/TVRename/ItemsAndActions/ActionPyTivoMeta.cs +++ b/TVRename/ItemsAndActions/ActionPyTivoMeta.cs @@ -8,6 +8,7 @@ namespace TVRename { using System; + using System.Windows.Forms; using System.IO; using Directory = Alphaleonis.Win32.Filesystem.Directory; using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; diff --git a/TVRename/ItemsAndActions/ActionRSS.cs b/TVRename/ItemsAndActions/ActionRSS.cs index fed0a5503..d1ca4b40c 100644 --- a/TVRename/ItemsAndActions/ActionRSS.cs +++ b/TVRename/ItemsAndActions/ActionRSS.cs @@ -1,3 +1,4 @@ +// public override IgnoreItem Ignore // Main website for TVRename is http://tvrename.com // // Source code available at https://github.com/TV-Rename/tvrename @@ -8,6 +9,7 @@ namespace TVRename { using System; using Alphaleonis.Win32.Filesystem; + using System.Windows.Forms; // ReSharper disable once InconsistentNaming public class ActionRSS : ActionDownload @@ -102,13 +104,23 @@ public override int Compare(Item o) public override IgnoreItem Ignore => GenerateIgnore(theFileNoExt); - protected override string SeriesName => Episode.Show.ShowName; - protected override string SeasonNumber => Episode.AppropriateSeasonNumber.ToString(); - protected override string EpisodeNumber => Episode.NumsAsString(); - protected override string AirDate => Episode.GetAirDateDT(true).PrettyPrint(); - protected override string DestinationFolder => TargetFolder; - protected override string DestinationFile => theFileNoExt; - protected override string SourceDetails => RSS.Title; + public override ListViewItem ScanListViewItem + { + get + { + ListViewItem lvi = new ListViewItem {Text = Episode.Show.ShowName}; + + lvi.SubItems.Add(Episode.AppropriateSeasonNumber.ToString()); + lvi.SubItems.Add(Episode.NumsAsString()); + lvi.SubItems.Add(Episode.GetAirDateDT(true).PrettyPrint()); + lvi.SubItems.Add(theFileNoExt); + lvi.SubItems.Add(RSS.Title); + + lvi.Tag = this; + + return lvi; + } + } public override string TargetFolder { @@ -120,7 +132,7 @@ public override string TargetFolder } } - public override string ScanListViewGroup => "lvgActionDownloadRSS"; +public override string ScanListViewGroup => "lvgActionDownloadRSS"; public override int IconNumber => 6; diff --git a/TVRename/ItemsAndActions/ItemDownloading.cs b/TVRename/ItemsAndActions/ItemDownloading.cs index 1efc33083..2b4d046d9 100644 --- a/TVRename/ItemsAndActions/ItemDownloading.cs +++ b/TVRename/ItemsAndActions/ItemDownloading.cs @@ -8,36 +8,55 @@ using Alphaleonis.Win32.Filesystem; using System; +using System.Windows.Forms; namespace TVRename { public class ItemDownloading : Item { - private readonly IDownloadInformation Entry; - public readonly string DesiredLocationNoExt; - public override IgnoreItem Ignore => GenerateIgnore(DesiredLocationNoExt); - public override string ScanListViewGroup => "lvgDownloading"; - protected override string SeriesName => Episode.Show.ShowName; - protected override string SeasonNumber => Episode.AppropriateSeasonNumber.ToString(); - protected override string EpisodeNumber => Episode.NumsAsString(); - protected override string AirDate => Episode.GetAirDateDT(true).PrettyPrint(); - protected override string DestinationFolder => FileIdentifier; - protected override string DestinationFile => Destination; - protected override string SourceDetails => Remaining; - private string FileIdentifier => Entry.FileIdentifier; - private string Destination => Entry.Destination; - private string Remaining => Entry.RemainingText; - public override int IconNumber { get; } - public override string TargetFolder => string.IsNullOrEmpty(Destination) ? null : new FileInfo(Destination).DirectoryName; + public DownloadInformation Entry; + public string DesiredLocationNoExt; - public ItemDownloading(IDownloadInformation dl, ProcessedEpisode pe, string desiredLocationNoExt, Finder.DownloadApp tApp) + + public ItemDownloading(DownloadInformation dl, ProcessedEpisode pe, string desiredLocationNoExt, TVRename.Finder.DownloadApp tApp) { Episode = pe; DesiredLocationNoExt = desiredLocationNoExt; Entry = dl; - IconNumber = (tApp == Finder.DownloadApp.uTorrent) ? 2 : - (tApp == Finder.DownloadApp.SABnzbd) ? 8 : - (tApp == Finder.DownloadApp.qBitTorrent) ? 10 : 0; + IconNumber = (tApp == TVRename.Finder.DownloadApp.uTorrent) ? 2 : + (tApp == TVRename.Finder.DownloadApp.SABnzbd) ? 8 : + (tApp == TVRename.Finder.DownloadApp.qBitTorrent) ? 10 : 0; + } + + public override IgnoreItem Ignore => GenerateIgnore(DesiredLocationNoExt); + + public override string ScanListViewGroup => "lvgDownloading"; + + public override ListViewItem ScanListViewItem + { + get + { + ListViewItem lvi = new ListViewItem { Text = Episode.Show.ShowName }; + lvi.SubItems.Add(Episode.AppropriateSeasonNumber.ToString()); + lvi.SubItems.Add(Episode.NumsAsString()); + lvi.SubItems.Add(Episode.GetAirDateDT(true).PrettyPrint()); + lvi.SubItems.Add(FileIdentifier); + lvi.SubItems.Add(Destination); + lvi.SubItems.Add(Remaining); + lvi.Tag = this; + return lvi; + } + } + + public override string TargetFolder + { + get + { + if (string.IsNullOrEmpty(Destination)) + return null; + + return new FileInfo(Destination).DirectoryName; + } } #region Item Members @@ -59,5 +78,13 @@ public override int Compare(Item o) return string.Compare((DesiredLocationNoExt), ut.DesiredLocationNoExt, StringComparison.Ordinal); } #endregion + + #region Item Members + public override int IconNumber { get; } + #endregion + + protected string FileIdentifier => Entry.FileIdentifier; + protected string Destination => Entry.Destination; + protected string Remaining => Entry.RemainingText; } } diff --git a/TVRename/ItemsAndActions/ItemMissing.cs b/TVRename/ItemsAndActions/ItemMissing.cs index 5c4ad12b8..0890a0ae6 100644 --- a/TVRename/ItemsAndActions/ItemMissing.cs +++ b/TVRename/ItemsAndActions/ItemMissing.cs @@ -9,6 +9,7 @@ namespace TVRename { using System; using Alphaleonis.Win32.Filesystem; + using System.Windows.Forms; public class ItemMissing : Item { @@ -33,8 +34,9 @@ public override bool SameAs(Item o) public override int Compare(Item o) { + ItemMissing miss = o as ItemMissing; //return (o == null || miss == null) ? 0 : (this.TheFileNoExt + this.Episode.Name).CompareTo(miss.TheFileNoExt + miss.Episode.Name); - if (o == null || !(o is ItemMissing miss)) + if (o == null || miss == null) { return 0; } @@ -58,16 +60,32 @@ public override int Compare(Item o) public override IgnoreItem Ignore => GenerateIgnore(TheFileNoExt); - protected override string SeriesName => Episode.Show.ShowName; - protected override string SeasonNumber => Episode.AppropriateSeasonNumber.ToString(); - protected override string EpisodeNumber => Episode.NumsAsString(); - protected override string AirDate => Episode.GetAirDateDT(true).PrettyPrint(); - protected override string DestinationFolder => folder; - protected override string DestinationFile => Filename; - protected override string SourceDetails => string.Empty; + public override ListViewItem ScanListViewItem + { + get + { + ListViewItem lvi = new ListViewItem {Text = Episode.Show.ShowName}; + lvi.SubItems.Add(Episode.AppropriateSeasonNumber.ToString()); + lvi.SubItems.Add(Episode.NumsAsString()); + lvi.SubItems.Add(Episode.GetAirDateDT(true).PrettyPrint()); + lvi.SubItems.Add(folder); + lvi.SubItems.Add(Filename); + lvi.Tag = this; + return lvi; + } + } + public override string ScanListViewGroup => "lvgActionMissing"; - public override string TargetFolder => string.IsNullOrEmpty(TheFileNoExt) ? null : new FileInfo(TheFileNoExt).DirectoryName; + public override string TargetFolder + { + get + { + if (string.IsNullOrEmpty(TheFileNoExt)) + return null; + return new FileInfo(TheFileNoExt).DirectoryName; + } + } public override int IconNumber => 1; diff --git a/TVRename/Properties/AssemblyInfo.cs b/TVRename/Properties/AssemblyInfo.cs index d23a4905d..f9954e926 100644 --- a/TVRename/Properties/AssemblyInfo.cs +++ b/TVRename/Properties/AssemblyInfo.cs @@ -14,6 +14,8 @@ [assembly: Guid("3b5746c1-a5f7-48c2-a8de-95619489049b")] [assembly: NeutralResourcesLanguageAttribute("")] + [assembly: AssemblyVersion("2.5.3.0")] [assembly: AssemblyFileVersion("2.5.3")] -[assembly: AssemblyInformationalVersion("2.5.3")] // Display version +[assembly: AssemblyInformationalVersion("2.5.5")] // Display version + diff --git a/TVRename/Resources/openFile.png b/TVRename/Resources/openFile.png new file mode 100644 index 0000000000000000000000000000000000000000..e2dcf54594ad9d5c0996a57a4f3da87c36dde5cb GIT binary patch literal 495 zcmV(_`g8%^e{{R4h=>PzAFaQARU;qF*m;eA5Z<1fd zMgRZ-bxA})RCwBqlc96lFc`&u-5JPCVF~n~(6I#uuCT0ug@uKq9SdC8LdOON8){~_ zu?ogaVt(u!kR8XXFSqYbC&}mc^ZTCU8#80B4s|khI`2ap^P&^0QanF=x&gqUg9qFx_}Ifg7Z=5C;D9z|1|78!~+w+1h#E197v=PAO(fn|ApLwbQX?zcm165T4~bac#P`llZ=PV1uQ__DAp8G l$gK$bd;Y(U$c;Dm?*LdL$i<^CZu9^E002ovPDHLkV1kSu+(iHY literal 0 HcmV?d00001 diff --git a/TVRename/Settings/Searchers.cs b/TVRename/Settings/Searchers.cs index 6f63409d2..3542f86ed 100644 --- a/TVRename/Settings/Searchers.cs +++ b/TVRename/Settings/Searchers.cs @@ -16,14 +16,14 @@ namespace TVRename { public class Searchers { - private class Choice + public class Choice { public string Name; - public string Url2; + public string URL2; } public string CurrentSearch; - private readonly List choices = new List(); + private readonly List Choices = new List(); public Searchers() { @@ -38,7 +38,7 @@ public Searchers() public Searchers(XmlReader reader) { - choices = new List(); + Choices = new List(); CurrentSearch = ""; reader.Read(); @@ -73,7 +73,7 @@ public Searchers(XmlReader reader) public void SetToNumber(int n) { - CurrentSearch = choices[n].Name; + CurrentSearch = Choices[n].Name; } public int CurrentSearchNum() @@ -81,24 +81,23 @@ public int CurrentSearchNum() return NumForName(CurrentSearch); } - private int NumForName(string srch) + public int NumForName(string srch) { - for (int i = 0; i < choices.Count; i++) + for (int i = 0; i < Choices.Count; i++) { - if (choices[i].Name == srch) + if (Choices[i].Name == srch) return i; } return 0; } - public string CurrentSearchUrl() + public string CurrentSearchURL() { - if (choices.Count == 0) + if (Choices.Count == 0) return ""; - return choices[CurrentSearchNum()].Url2; + return Choices[CurrentSearchNum()].URL2; } - - public void WriteXml(XmlWriter writer) + public void WriteXML(XmlWriter writer) { writer.WriteStartElement("TheSearchers"); XmlHelper.WriteElementToXml(writer,"Current",CurrentSearch); @@ -106,44 +105,44 @@ public void WriteXml(XmlWriter writer) for (int i = 0; i < Count(); i++) { writer.WriteStartElement("Choice"); - XmlHelper.WriteAttributeToXml(writer,"Name",choices[i].Name); - XmlHelper.WriteAttributeToXml(writer,"URL2",choices[i].Url2); + XmlHelper.WriteAttributeToXml(writer,"Name",Choices[i].Name); + XmlHelper.WriteAttributeToXml(writer,"URL2",Choices[i].URL2); writer.WriteEndElement(); } writer.WriteEndElement(); // TheSearchers } public void Clear() { - choices.Clear(); + Choices.Clear(); } public void Add(string name, string url) { - choices.Add(new Choice { Name = name, Url2 = url }); + Choices.Add(new Choice { Name = name, URL2 = url }); } public int Count() { - return choices.Count; + return Choices.Count; } public string Name(int n) { - if (n >= choices.Count) - n = choices.Count - 1; + if (n >= Choices.Count) + n = Choices.Count - 1; else if (n < 0) n = 0; - return choices[n].Name; + return Choices[n].Name; } - public string Url(int n) + public string URL(int n) { - if (n >= choices.Count) - n = choices.Count - 1; + if (n >= Choices.Count) + n = Choices.Count - 1; else if (n < 0) n = 0; - return choices[n].Url2; + return Choices[n].URL2; } } } diff --git a/TVRename/Settings/Settings.cs b/TVRename/Settings/Settings.cs index e14473f8c..276666d6e 100644 --- a/TVRename/Settings/Settings.cs +++ b/TVRename/Settings/Settings.cs @@ -77,6 +77,7 @@ public class ShowStatusColoringTypeList : Dictionary 1) + { + SeasonFolderFormat = defaultSeasonWord.Trim() + " " + (LeadingZeroOnSeason ? "{Season:2}" : "{Season}"); + } + else + { + SeasonFolderFormat = defaultSeasonWord.Trim() + (LeadingZeroOnSeason ? "{Season:2}" : "{Season}"); + } } } @@ -875,9 +890,11 @@ private void SetToDefaults() public void WriteXML(XmlWriter writer) { writer.WriteStartElement("Settings"); - TheSearchers.WriteXml(writer); + TheSearchers.WriteXML(writer); XmlHelper.WriteElementToXml(writer,"BGDownload",BGDownload); XmlHelper.WriteElementToXml(writer,"OfflineMode",OfflineMode); + XmlHelper.WriteElementToXml(writer,"ShowCollections", ShowCollections); + XmlHelper.WriteElementToXml(writer, "DeleteShowFromDisk", DeleteShowFromDisk); writer.WriteStartElement("Replacements"); foreach (Replacement R in Replacements) { @@ -1244,7 +1261,7 @@ public string BTSearchURL(ProcessedEpisode epi) string url = (epi.Show.UseCustomSearchUrl && !string.IsNullOrWhiteSpace(epi.Show.CustomSearchUrl)) ? epi.Show.CustomSearchUrl - : TheSearchers.CurrentSearchUrl(); + : TheSearchers.CurrentSearchURL(); return CustomEpisodeName.NameForNoExt(epi, url, true); } @@ -1284,6 +1301,7 @@ public bool KeepTogetherFilesWithType(string fileExtension) case KeepTogetherModes.All: return true; case KeepTogetherModes.Just: return keepTogetherExtensionsArray.Contains(fileExtension); case KeepTogetherModes.AllBut: return !keepTogetherExtensionsArray.Contains(fileExtension); + } return true; } diff --git a/TVRename/TVRename.csproj b/TVRename/TVRename.csproj index 3d21918aa..8dfcb7e63 100644 --- a/TVRename/TVRename.csproj +++ b/TVRename/TVRename.csproj @@ -88,9 +88,6 @@ ..\packages\NLog.4.5.7\lib\net45\NLog.dll - - ..\packages\NLog.Windows.Forms.4.2.3\lib\net35\NLog.Windows.Forms.dll - ..\packages\NodaTime.2.0.2\lib\net45\NodaTime.dll @@ -135,6 +132,12 @@ + + Form + + + AddEditCollection.cs + Form @@ -154,12 +157,6 @@ UpdateNotification.cs - - Form - - - LogViewer.cs - @@ -221,6 +218,7 @@ + @@ -399,6 +397,9 @@ + + AddEditCollection.cs + ActorsGrid.cs Designer @@ -493,9 +494,6 @@ TVRenameSplash.cs - - LogViewer.cs - ResXFileCodeGenerator Resources.Designer.cs diff --git a/TVRename/TVRename/ActionEngine.cs b/TVRename/TVRename/ActionEngine.cs index 00bd81b51..98de50904 100644 --- a/TVRename/TVRename/ActionEngine.cs +++ b/TVRename/TVRename/ActionEngine.cs @@ -69,6 +69,7 @@ public void ProcessSingleAction(object infoIn) catch (Exception e) { logger.Fatal(e, "Unhandled Exception in Process Single Action"); + return; } } @@ -96,9 +97,10 @@ public void DoActions(ItemList theList, bool showUI) { if (theList == null) { - logger.Info("Asked to do actions, but none provided...."); + logger.Info($"Asked to do actions, but none provided...."); return; } + logger.Info("**********************"); logger.Info($"Doing Selected Actions.... ({theList.Count} items detected, {theList.Actions().Count()} actions to be completed )"); diff --git a/TVRename/TVRename/PathManager.cs b/TVRename/TVRename/PathManager.cs index 600b46a04..8a8154d68 100644 --- a/TVRename/TVRename/PathManager.cs +++ b/TVRename/TVRename/PathManager.cs @@ -10,13 +10,18 @@ public static class PathManager private const string SETTINGS_FILE_NAME = "TVRenameSettings.xml"; private const string UI_LAYOUT_FILE_NAME = "Layout.xml"; private const string STATISTICS_FILE_NAME = "Statistics.xml"; + private const string SHOWS_FILE_NAME = "TVRenameShows.xml"; + private const string SHOWS_COLLECTION_FILE_NAME = "TVRenameColls.xml"; + private const string SHOWS_DEFAULT_COLLECTION = "2.1"; private static string UserDefinedBasePath; + private static string SHOWS_COLLECTION = ""; public static FileInfo[] GetPossibleSettingsHistory() { return new DirectoryInfo(System.IO.Path.GetDirectoryName(TVDocSettingsFile.FullName)).GetFiles(SETTINGS_FILE_NAME + "*"); } + public static FileInfo[] GetPossibleTvdbHistory() { return new DirectoryInfo(System.IO.Path.GetDirectoryName(TVDocSettingsFile.FullName)).GetFiles(TVDB_FILE_NAME + "*"); @@ -48,6 +53,40 @@ private static FileInfo GetFileInfo(string path, string file) return new FileInfo(System.IO.Path.Combine(path, file)); } + public static string ShowCollection + { + get + { + return SHOWS_COLLECTION; + } + set + { + if (value != SHOWS_DEFAULT_COLLECTION) + { + SHOWS_COLLECTION = value; + } + else + { + SHOWS_COLLECTION = ""; + } + } + } + + public static FileInfo ShowCollectionFile + { + get + { + if (!string.IsNullOrEmpty(UserDefinedBasePath)) + { + return GetFileInfo(UserDefinedBasePath, SHOWS_COLLECTION_FILE_NAME); + } + else + { + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename"), SHOWS_COLLECTION_FILE_NAME); + } + } + } + public static FileInfo StatisticsFile { get @@ -58,7 +97,7 @@ public static FileInfo StatisticsFile } else { - return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", "2.1"), STATISTICS_FILE_NAME); + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? SHOWS_COLLECTION : SHOWS_DEFAULT_COLLECTION)), STATISTICS_FILE_NAME); } } } @@ -74,7 +113,7 @@ public static FileInfo UILayoutFile } else { - return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", "2.1"), UI_LAYOUT_FILE_NAME); + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? "" : SHOWS_DEFAULT_COLLECTION)), UI_LAYOUT_FILE_NAME); } } } @@ -90,7 +129,7 @@ public static FileInfo TVDBFile } else { - return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", "2.1"), TVDB_FILE_NAME); + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? SHOWS_COLLECTION : SHOWS_DEFAULT_COLLECTION)), TVDB_FILE_NAME); } } } @@ -106,10 +145,24 @@ public static FileInfo TVDocSettingsFile } else { - return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", "2.1"), SETTINGS_FILE_NAME); + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? "" : SHOWS_DEFAULT_COLLECTION)), SETTINGS_FILE_NAME); } } } + public static FileInfo TVDocShowsFile + { + get + { + if (!string.IsNullOrEmpty(UserDefinedBasePath)) + { + return GetFileInfo(UserDefinedBasePath, SHOWS_FILE_NAME); + } + else + { + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? SHOWS_COLLECTION : SHOWS_DEFAULT_COLLECTION)), (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? SHOWS_FILE_NAME : SETTINGS_FILE_NAME)); + } + } + } } } diff --git a/TVRename/TVRename/ShowCollection.cs b/TVRename/TVRename/ShowCollection.cs new file mode 100644 index 000000000..0dcbd51f9 --- /dev/null +++ b/TVRename/TVRename/ShowCollection.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using Alphaleonis.Win32.Filesystem; +using System.Text.RegularExpressions; +using System.Threading; +using System.Windows.Forms; +using System.Linq; +using System.Xml; +using Directory = Alphaleonis.Win32.Filesystem.Directory; +using DirectoryInfo = Alphaleonis.Win32.Filesystem.DirectoryInfo; +using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; +using System.Text; +using NodaTime.Extensions; + +namespace TVRename +{ + public class ShowCollection + { + public string Path { get; set; } + public string Name { get; set; } + public string Description { get; set; } + + public ShowCollection (string Pa) + { + Path = Pa; + } + + public ShowCollection (XmlReader reader) + { + LoadXMLCollectionItem(reader); + } + + public void WriteXMLCollectionItem (XmlWriter writer) + { + writer.WriteStartElement("CollectionItem"); + XmlHelper.WriteElementToXml(writer, "Path", Path); + XmlHelper.WriteElementToXml(writer, "Name", Name); + XmlHelper.WriteElementToXml(writer, "Description", Description); + writer.WriteEndElement(); + } + + private void LoadXMLCollectionItem (XmlReader reader) + { + reader.Read(); + while (!reader.EOF) + { + if ((reader.Name == "CollectionItem") && (!reader.IsStartElement())) + { + break; + } + + if (reader.Name == "Path") + { + Path = reader.ReadElementContentAsString(); + } + if (reader.Name == "Name") + { + Name = reader.ReadElementContentAsString(); + } + if (reader.Name == "Description") + { + Description = reader.ReadElementContentAsString(); + } + else + { + reader.ReadOuterXml(); + } + } + } + } +} diff --git a/TVRename/TVRename/ShowLibrary.cs b/TVRename/TVRename/ShowLibrary.cs index fe3a99980..f077214a3 100644 --- a/TVRename/TVRename/ShowLibrary.cs +++ b/TVRename/TVRename/ShowLibrary.cs @@ -502,7 +502,7 @@ public static string GetBestNameFor(List episodeNames, string defaultNam return root.Trim().TrimEnd(wordsToTrim).Trim().TrimEnd(charsToTrim).Trim(); } - private static void Renumber(List eis) + public static void Renumber(List eis) { if (eis.Count == 0) return; // nothing to do @@ -592,16 +592,13 @@ public List NextNShows(int nShows, int nDaysPast, int nDaysFut if ((airdt == null) || (airdt == DateTime.MaxValue)) continue; - DateTime dt = airdt.Value; - - TimeSpan timeUntil = dt.Subtract(DateTime.Now); - if (timeUntil.TotalDays > nDaysFuture) continue; //episode is too far in the future + DateTime dt = (DateTime) airdt; TimeSpan ts = dt.Subtract(notBefore); - if (ts.TotalSeconds<0) continue; //episode is too far in the past - - //if we have a closer match - if (TimeSpan.Compare(ts,howClose)<0) + TimeSpan timeUntil = dt.Subtract(DateTime.Now); + if (((howClose == TimeSpan.MaxValue) || + (ts.CompareTo(howClose) <= 0) && (ts.TotalHours >= 0)) && (ts.TotalHours >= 0) && + (timeUntil.TotalDays <= nDaysFuture)) { howClose = ts; nextAfterThat = ei; diff --git a/TVRename/TVRename/TVDoc.cs b/TVRename/TVRename/TVDoc.cs index c7b99ccd5..a501c8a48 100644 --- a/TVRename/TVRename/TVDoc.cs +++ b/TVRename/TVRename/TVDoc.cs @@ -26,9 +26,18 @@ namespace TVRename { + public enum FileToHandle + { + Collections = 1, + Settings = 2, + Shows = 4, + TvDB = 8 + } + // ReSharper disable once InconsistentNaming public class TVDoc : IDisposable { + public readonly List ShowCollections; private readonly DownloadIdentifiersController downloadIdentifiers; private readonly List finders; public readonly ShowLibrary Library; @@ -49,21 +58,22 @@ public class TVDoc : IDisposable private bool currentlyBusy = false; // This is set to true when scanning and indicates to other objects not to commence a scan of their own private DateTime busySince; - public TVDoc(FileInfo settingsFile, CommandLineArgs args) + public TVDoc(CommandLineArgs args) { Args = args; - Library = new ShowLibrary(); - mStats = new TVRenameStats(); - actionManager = new ActionEngine(mStats); - cacheManager = new CacheUpdater(); + ShowCollections = new List(); + Library = new ShowLibrary(); + mStats = new TVRenameStats(); + actionManager = new ActionEngine(mStats); + cacheManager = new CacheUpdater(); - mDirty = false; - TheActionList = new ItemList(); + mDirty = false; + TheActionList = new ItemList(); - actionCancel = false; + actionCancel = false; - scanProgDlg = null; + scanProgDlg = null; finders = new List //These should be in order { @@ -75,8 +85,23 @@ public TVDoc(FileInfo settingsFile, CommandLineArgs args) }; downloadIdentifiers = new DownloadIdentifiersController(); + LoadOk = LoadXMLFile(FileToHandle.Collections, true); - LoadOk = ((settingsFile == null) || LoadXMLSettings(settingsFile)) && TheTVDB.Instance.LoadOk; + if (LoadOk) + { + LoadOk = LoadXMLFile(FileToHandle.TvDB | FileToHandle.Settings | FileToHandle.Shows, true); + } + } + + public void SwitchToCollection (string Collection) + { + PathManager.ShowCollection = Collection; + Library.Clear(); + TheActionList.Clear(); + + TheTVDB.Instance.ClearCache(); + + LoadXMLFile(FileToHandle.TvDB | FileToHandle.Settings | FileToHandle.Shows, false); } public TVRenameStats Stats() @@ -243,28 +268,88 @@ private static List FindEpOnDisk(DirFilesCache dfc, ShowItem si, Episo return ret; } - // ReSharper disable once InconsistentNaming - public void WriteXMLSettings() + public void WriteXMLFile (FileToHandle Files) { - // backup old settings before writing new ones - FileHelper.Rotate(PathManager.TVDocSettingsFile.FullName); - Logger.Info("Saving Settings to {0}", PathManager.TVDocSettingsFile.FullName); - XmlWriterSettings settings = new XmlWriterSettings { Indent = true, NewLineOnAttributes = true }; - using (XmlWriter writer = XmlWriter.Create(PathManager.TVDocSettingsFile.FullName, settings)) + if ((Files & FileToHandle.Collections) > 0) + { + FileHelper.Rotate(PathManager.ShowCollectionFile.FullName); + Logger.Info("Saving Collections to {0}", PathManager.ShowCollectionFile.FullName); + XmlWriter writer = XmlWriter.Create(PathManager.ShowCollectionFile.FullName, settings); + WriteXMLCollections(writer); + } + if ((Files & FileToHandle.Settings) > 0) + { + FileHelper.Rotate(PathManager.TVDocSettingsFile.FullName); + Logger.Info("Saving Settings to {0}", PathManager.TVDocSettingsFile.FullName); + XmlWriter writer = XmlWriter.Create(PathManager.TVDocSettingsFile.FullName, settings); + WriteXMLSettings(writer); + } + if (((Files & FileToHandle.Shows) > 0) && (!string.IsNullOrEmpty(PathManager.ShowCollection))) + { + FileHelper.Rotate(PathManager.TVDocShowsFile.FullName); + Logger.Info("Saving Shows to {0}", PathManager.TVDocShowsFile.FullName); + XmlWriter writer = XmlWriter.Create(PathManager.TVDocShowsFile.FullName, settings); + WriteXMLHeader(writer); + WriteXMLShows(writer); + } + + if ((Files & FileToHandle.TvDB) > 0) { - writer.WriteStartDocument(); - writer.WriteStartElement("TVRename"); + TheTVDB.Instance.SaveCache(); + } + } - XmlHelper.WriteAttributeToXml(writer, "Version", "2.1"); + private void WriteXMLCollections(XmlWriter writer) + { + using (writer) + { + WriteXMLHeader(writer); + + writer.WriteStartElement("Collections"); + foreach (ShowCollection sc in ShowCollections) + { + sc.WriteXMLCollectionItem(writer); + } + + writer.WriteEndElement(); // Collections + XmlHelper.WriteElementToXml(writer, "Current", (PathManager.ShowCollection == "" ? "2.1" : PathManager.ShowCollection)); + + WriteXMLFooter(writer); + } + } + + // ReSharper disable once InconsistentNaming + private void WriteXMLSettings(XmlWriter writer) + { + using (writer) + { + WriteXMLHeader(writer); TVSettings.Instance.WriteXML(writer); // + if (string.IsNullOrEmpty(PathManager.ShowCollection)) + { + WriteXMLShows(writer); + } + else + { + WriteXMLFooter(writer); + } + } + + mDirty = false; + } + + private void WriteXMLShows(XmlWriter writer) + { + using (writer) + { writer.WriteStartElement("MyShows"); foreach (ShowItem si in Library.Values) si.WriteXmlSettings(writer); @@ -273,10 +358,8 @@ public void WriteXMLSettings() XmlHelper.WriteStringsToXml(TVSettings.Instance.LibraryFolders, writer, "MonitorFolders", "Folder"); XmlHelper.WriteStringsToXml(TVSettings.Instance.IgnoreFolders, writer, "IgnoreFolders", "Folder"); - XmlHelper.WriteStringsToXml(TVSettings.Instance.DownloadFolders, writer, "FinderSearchFolders", - "Folder"); - XmlHelper.WriteStringsToXml(TVSettings.Instance.IgnoredAutoAddHints, writer, "IgnoredAutoAddHints", - "Hint"); + XmlHelper.WriteStringsToXml(TVSettings.Instance.DownloadFolders, writer, "FinderSearchFolders", "Folder"); + XmlHelper.WriteStringsToXml(TVSettings.Instance.IgnoredAutoAddHints, writer, "IgnoredAutoAddHints", "Hint"); writer.WriteStartElement("IgnoreItems"); foreach (IgnoreItem ii in TVSettings.Instance.Ignore) @@ -284,118 +367,377 @@ public void WriteXMLSettings() writer.WriteEndElement(); // IgnoreItems - writer.WriteEndElement(); // tvrename - writer.WriteEndDocument(); + WriteXMLFooter(writer); } mDirty = false; Stats().Save(); } - // ReSharper disable once InconsistentNaming - private bool LoadXMLSettings(FileInfo from) + private static void WriteXMLHeader(XmlWriter writer) { - Logger.Info("Loading Settings from {0}", from?.FullName); - if (from == null) - return true; + writer.WriteStartDocument(); + writer.WriteStartElement("TVRename"); - try + XmlHelper.WriteAttributeToXml(writer, "Version", "2.1"); + } + + private static void WriteXMLFooter(XmlWriter writer) + { + writer.WriteEndElement(); // tvrename + writer.WriteEndDocument(); + } + + private bool LoadXMLFile (FileToHandle Files, bool bInit) + { + bool bLoadOk = false; + XmlReaderSettings settings = new XmlReaderSettings + { + IgnoreComments = true, + IgnoreWhitespace = true + }; + + if ((Files & FileToHandle.Collections) > 0) + { + bLoadOk = ReadXMLCollections(settings, ShowCollections, LoadErr); + } + if ((Files & FileToHandle.TvDB) > 0) + { + bLoadOk = ReadXMLTvDBCache(bInit, Args); + } + if ((Files & FileToHandle.Settings) > 0) + { + bLoadOk = ReadXMLSettings(settings, LoadErr); + } + if ((Files & FileToHandle.Shows) > 0) + { + bLoadOk = ReadXMLShows(settings, Library, mStats, LoadErr); + } + + return bLoadOk; + } + + private static bool ReadXMLCollections(XmlReaderSettings settings, List lSc, string Err) + { + bool bLoadOk; + FileInfo showColls = PathManager.ShowCollectionFile; + Logger.Info("Loading Collections from {0}", showColls.FullName); + if (showColls == null) + { + bLoadOk = true; + } + else { - XmlReaderSettings settings = new XmlReaderSettings + try + { + XmlReader reader = XmlReader.Create(showColls.FullName, settings); + bLoadOk = LoadXMLCollections(reader, showColls, lSc, Err); + } + catch (Exception e) { - IgnoreComments = true, - IgnoreWhitespace = true - }; + if (!showColls.Exists) + { + bLoadOk = true; + } + else + { + Logger.Warn(e, "Problem on Startup loading Collection File"); + Err = showColls.Name + " : " + e.Message; + bLoadOk = false; + } + } + } + return bLoadOk; + } - if (!from.Exists) + private static bool ReadXMLTvDBCache (bool bInit, CommandLineArgs args) + { + bool bLoadOk; + FileInfo tvdbFile = PathManager.TVDBFile; + if (tvdbFile == null) + { + bLoadOk = true; + } + else + { + if (bInit) + { + TheTVDB.Instance.Setup(tvdbFile, PathManager.TVDBFile, args); + } + else { - return true; // that's ok + TheTVDB.Instance.RelaodCache(tvdbFile, PathManager.TVDBFile); } + bLoadOk = TheTVDB.Instance.LoadOk; + } + return bLoadOk; + } - using (XmlReader reader = XmlReader.Create(from.FullName, settings)) + private static bool LoadXMLCollections(XmlReader reader, FileInfo from, List lSc, string Err) + { + using (reader) + { + bool bGoodHeader = ReadXmlHeaderFromFile(reader, from, "Collections", Err); + if (bGoodHeader) { - reader.Read(); - if (reader.Name != "xml") + while (!reader.EOF) { - LoadErr = from.Name + " : Not a valid XML file"; - return false; + if (reader.Name == "TVRename" && !reader.IsStartElement()) + { + break; // end of it all + } + + if (reader.Name == "Collections") + { + LoadXMLEveryCollection(reader, lSc); + } + else if (reader.Name == "Current") + { + PathManager.ShowCollection = reader.ReadElementContentAsString(); + } + else + { + reader.ReadOuterXml(); + } + reader.Read(); } + } + } - reader.Read(); + return true; + } + + private static void LoadXMLEveryCollection (XmlReader reader, List Lsc) + { + while (!reader.EOF) + { + reader.Read(); - if (reader.Name != "TVRename") + if ((reader.Name == "Collections") && (!reader.IsStartElement())) + { + break; + } + + if (reader.Name == "CollectionItem") + { + ShowCollection Collection = new ShowCollection(reader); + + Lsc.Add(Collection); + } + else + { + reader.ReadOuterXml(); + } + } + } + + private static bool ReadXMLSettings(XmlReaderSettings settings, string Err) + { + bool bLoadOk; + + FileInfo settingsFile = PathManager.TVDocSettingsFile; + Logger.Info("Loading Settings from {0}", settingsFile.FullName); + if (settingsFile == null) + { + bLoadOk = true; + } + else + { + try + { + XmlReader reader = XmlReader.Create(settingsFile.FullName, settings); + bLoadOk = LoadXMLSettings(reader, settingsFile, Err); + } + catch (Exception e) + { + if (!settingsFile.Exists) { - LoadErr = from.Name + " : Not a TVRename settings file"; - return false; + bLoadOk = true; } - - if (reader.GetAttribute("Version") != "2.1") + else { - LoadErr = from.Name + " : Incompatible version"; - return false; + Logger.Warn(e, "Problem on Startup loading Settings File"); + Err = settingsFile.Name + " : " + e.Message; + bLoadOk = false; } + } + } + return bLoadOk; + } - reader.Read(); // move forward one - + // ReSharper disable once InconsistentNaming + private static bool LoadXMLSettings(XmlReader reader, FileInfo from, string Err) + { + using (reader) + { + bool bGoodHeader = ReadXmlHeaderFromFile(reader, from, "Settings", Err); + if (bGoodHeader) + { while (!reader.EOF) { if (reader.Name == "TVRename" && !reader.IsStartElement()) + { break; // end of it all + } if (reader.Name == "Settings") { TVSettings.Instance.load(reader.ReadSubtree()); reader.Read(); } - else if (reader.Name == "MyShows") + else { - Library.LoadFromXml(reader.ReadSubtree()); - reader.Read(); + reader.ReadOuterXml(); } - else if (reader.Name == "MonitorFolders") - TVSettings.Instance.LibraryFolders = - XmlHelper.ReadStringsFromXml(reader, "MonitorFolders", "Folder"); - else if (reader.Name == "IgnoreFolders") - TVSettings.Instance.IgnoreFolders = - XmlHelper.ReadStringsFromXml(reader, "IgnoreFolders", "Folder"); - else if (reader.Name == "FinderSearchFolders") - TVSettings.Instance.DownloadFolders = - XmlHelper.ReadStringsFromXml(reader, "FinderSearchFolders", "Folder"); - else if (reader.Name == "IgnoredAutoAddHints") - TVSettings.Instance.IgnoredAutoAddHints = - XmlHelper.ReadStringsFromXml(reader, "IgnoredAutoAddHints", "Hint"); - else if (reader.Name == "IgnoreItems") + } + } + } + return true; + } + + private static bool ReadXMLShows(XmlReaderSettings settings, ShowLibrary Sl, TVRenameStats St, string Err) + { + bool bLoadOk; + FileInfo showsFile = PathManager.TVDocShowsFile; + Logger.Info("Loading Shows from {0}", showsFile.FullName); + if (showsFile == null) + { + bLoadOk = true; + } + else + { + try + { + XmlReader reader = XmlReader.Create(showsFile.FullName, settings); + bLoadOk = LoadXMLSHows(reader, showsFile, Sl, Err); + try + { + St = TVRenameStats.Load(); + } + catch (Exception) + { + // not worried if stats loading fails + } + } + catch (Exception e) + { + if (!showsFile.Exists) + { + bLoadOk = true; + } + else + { + Logger.Warn(e, "Problem on Startup loading Shows File"); + Err = showsFile.Name + " : " + e.Message; + bLoadOk = false; + } + } + } + return bLoadOk; + } + + private static bool LoadXMLSHows(XmlReader reader, FileInfo from, ShowLibrary Sl, string Err) + { + using (reader) + { + bool bGoodHeader = ReadXmlHeaderFromFile(reader, from, "Shows", Err); + if (bGoodHeader) + { + while (!reader.EOF) + { + if (reader.Name == "TVRename" && !reader.IsStartElement()) { - XmlReader r2 = reader.ReadSubtree(); - r2.Read(); - r2.Read(); - while (r2.Name == "Ignore") - TVSettings.Instance.Ignore.Add(new IgnoreItem(r2)); + break; // end of it all + } + if (reader.Name == "MyShows") + { + Sl.LoadFromXml(reader.ReadSubtree()); reader.Read(); } - else - reader.ReadOuterXml(); + LoadXMLShowFolderStuff(reader); } } } - catch (Exception e) + + return true; + } + + private static void LoadXMLShowFolderStuff(XmlReader reader) + { + if (reader.Name == "MonitorFolders") { - Logger.Warn(e, "Problem on Startup loading File"); - LoadErr = from.Name + " : " + e.Message; - return false; + TVSettings.Instance.LibraryFolders = + XmlHelper.ReadStringsFromXml(reader, "MonitorFolders", "Folder"); + } + else if (reader.Name == "IgnoreFolders") + { + TVSettings.Instance.IgnoreFolders = + XmlHelper.ReadStringsFromXml(reader, "IgnoreFolders", "Folder"); + } + else if (reader.Name == "FinderSearchFolders") + { + TVSettings.Instance.DownloadFolders = + XmlHelper.ReadStringsFromXml(reader, "FinderSearchFolders", "Folder"); + } + else if (reader.Name == "IgnoredAutoAddHints") + { + TVSettings.Instance.IgnoredAutoAddHints = + XmlHelper.ReadStringsFromXml(reader, "IgnoredAutoAddHints", "Hint"); } + else if (reader.Name == "IgnoreItems") + { + XmlReader r2 = reader.ReadSubtree(); + r2.Read(); + r2.Read(); + while (r2.Name == "Ignore") + { + TVSettings.Instance.Ignore.Add(new IgnoreItem(r2)); + } - try + reader.Read(); + } + else { - mStats = TVRenameStats.Load(); + reader.ReadOuterXml(); } - catch (Exception) + } + + private static bool ReadXmlHeaderFromFile (XmlReader reader, FileInfo from, string contains, string Err) + { + bool bIsValidHeader; + + reader.Read(); + if (reader.Name != "xml") { - // not worried if stats loading fails + Err = from.Name + " : Not a valid XML file"; + bIsValidHeader = false; + } + else + { + reader.Read(); + if (reader.Name != "TVRename") + { + Err = from.Name + " : Not a TVRename " + contains + " file"; + bIsValidHeader = false; + } + else + { + if (reader.GetAttribute("Version") != "2.1") + { + Err = from.Name + " : Incompatible version"; + bIsValidHeader = false; + } + else + { + reader.Read(); // move forward one + Err = ""; + bIsValidHeader = true; + } + } } - return true; + return bIsValidHeader; } private void OutputActionFiles(TVSettings.ScanType st) @@ -502,6 +844,7 @@ public void Scan(List shows, bool unattended, TVSettings.ScanType st) catch (Exception e) { Logger.Fatal(e, "Unhandled Exception in ScanWorker"); + } finally { @@ -1367,7 +1710,8 @@ private void RenameAndMissingCheck(ShowItem si, DirFilesCache dfc,bool fullscan) //Check that the file does not already exist //if (FileHelper.FileExistsCaseSensitive(newFile.FullName)) if (FileHelper.FileExistsCaseSensitive(files,newFile)) - { + + { Logger.Warn($"Identified that {actualFile.FullName} should be renamed to {newName}, but it already exists."); } else @@ -1380,7 +1724,6 @@ private void RenameAndMissingCheck(ShowItem si, DirFilesCache dfc,bool fullscan) //one for that purpse downloadIdentifiers.NotifyComplete(newFile); - localEps[epNum] = newFile; } } } @@ -1389,8 +1732,7 @@ private void RenameAndMissingCheck(ShowItem si, DirFilesCache dfc,bool fullscan) ) // == MISSING CHECK part 1/2 == { // first pass of missing check is to tally up the episodes we do have - if (localEps[epNum] is null) localEps[epNum] = actualFile; - + localEps[epNum] = actualFile; if (epNum > maxEpNumFound) maxEpNumFound = epNum; } diff --git a/TVRename/TheTVDB/Actor.cs b/TVRename/TheTVDB/Actor.cs index e104e996d..1a59eae13 100644 --- a/TVRename/TheTVDB/Actor.cs +++ b/TVRename/TheTVDB/Actor.cs @@ -1,12 +1,17 @@ -// +// // Main website for TVRename is http://tvrename.com // // Source code available at https://github.com/TV-Rename/tvrename // // This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md // - +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; using System.Xml; +using System.Runtime.Serialization; +using NLog; namespace TVRename { @@ -30,7 +35,7 @@ public class Actor public Actor(string name) { - actorName = name; + this.actorName = name; } public Actor(int actorId, string actorImage, string actorName, string actorRole, int actorSeriesId, int actorSortOrder) { diff --git a/TVRename/TheTVDB/Episode.cs b/TVRename/TheTVDB/Episode.cs index 6b5259e04..88b1b3f90 100644 --- a/TVRename/TheTVDB/Episode.cs +++ b/TVRename/TheTVDB/Episode.cs @@ -360,9 +360,9 @@ private void LoadJson(int seriesId, JObject r) else if (!int.TryParse(dvdEpNumString, out DvdEpNum)) DvdEpNum = 0; SrvLastUpdated = (long) r["lastUpdated"]; - Overview = System.Web.HttpUtility.HtmlDecode((string)r["overview"]); + Overview = System.Web.HttpUtility.HtmlDecode((string) r["overview"]); EpisodeRating = (string) r["siteRating"]; - Name = System.Web.HttpUtility.HtmlDecode((string)r["episodeName"]); + Name = System.Web.HttpUtility.HtmlDecode((string) r["episodeName"]); string sn = (string) r["airedSeason"]; if (sn == null) diff --git a/TVRename/TheTVDB/Season.cs b/TVRename/TheTVDB/Season.cs index bde3bd4a1..1c17cf29f 100644 --- a/TVRename/TheTVDB/Season.cs +++ b/TVRename/TheTVDB/Season.cs @@ -20,7 +20,7 @@ public enum SeasonStatus noEpisodes, } - public Dictionary Episodes; + public System.Collections.Generic.Dictionary Episodes; public int SeasonId; public int SeasonNumber; public SeriesInfo TheSeries; @@ -43,7 +43,7 @@ public static string UISeasonWord(int season) else { bool leadingZero = TVSettings.Instance.LeadingZeroOnSeason; - if (leadingZero) + if (leadingZero == true) { return TVSettings.Instance.defaultSeasonWord + season.ToString("00"); } @@ -97,10 +97,10 @@ internal int MinYear() foreach (Episode e in Episodes.Values) { - DateTime? adt = e.GetAirDateDt(); - if (!adt.HasValue) continue; - DateTime airDateTime = adt.Value; - if (airDateTime.Year < min) min = airDateTime.Year; + if (e.GetAirDateDt().HasValue) + { + if (e.GetAirDateDt().Value.Year < min) min = e.GetAirDateDt().Value.Year; + } } return min; @@ -112,27 +112,27 @@ internal int MaxYear() foreach (Episode e in Episodes.Values) { - DateTime? adt = e.GetAirDateDt(); - if (!adt.HasValue) continue; - DateTime airDateTime = adt.Value; - if (airDateTime.Year > max) max = airDateTime.Year; + if (e.GetAirDateDt().HasValue) + { + if (e.GetAirDateDt().Value.Year > max) max = e.GetAirDateDt().Value.Year; + } } return max; } - private bool HasEpisodes => Episodes != null && Episodes.Count > 0; private bool HasUnairedEpisodes(TimeZone tz) { - if (!HasEpisodes) return false; - - foreach (Episode e in Episodes.Values) + if (HasEpisodes) { - DateTime? adt = e.GetAirDateDt(tz); - if (!adt.HasValue) continue; - DateTime airDateTime = adt.Value; - if (airDateTime > DateTime.Now) - return true; + foreach (Episode e in Episodes.Values) + { + if (e.GetAirDateDt(tz).HasValue) + { + if (e.GetAirDateDt(tz).Value > DateTime.Now) + return true; + } + } } return false; @@ -140,15 +140,16 @@ private bool HasUnairedEpisodes(TimeZone tz) private bool HasAiredEpisodes(TimeZone tz) { - if (!HasEpisodes) return false; - - foreach (Episode e in Episodes.Values) + if (HasEpisodes) { - DateTime? adt = e.GetAirDateDt(tz); - if (!adt.HasValue) continue; - DateTime airDateTime = adt.Value; - if (airDateTime < DateTime.Now) - return true; + foreach (Episode e in Episodes.Values) + { + if (e.GetAirDateDt(tz).HasValue) + { + if (e.GetAirDateDt(tz).Value < DateTime.Now) + return true; + } + } } return false; diff --git a/TVRename/TheTVDB/SeriesInfo.cs b/TVRename/TheTVDB/SeriesInfo.cs index 126ad4b6a..e0f759902 100644 --- a/TVRename/TheTVDB/SeriesInfo.cs +++ b/TVRename/TheTVDB/SeriesInfo.cs @@ -441,7 +441,7 @@ private void LoadJson(JObject bestLanguageR, JObject backupLanguageR) } //Looking at the data then the aliases, banner and runtime are also different by language - + if ((string.IsNullOrWhiteSpace(Items["aliases"]))) { Items["aliases"] = JsonHelper.Flatten(backupLanguageR["aliases"], "|"); diff --git a/TVRename/TheTVDB/TheTVDB.cs b/TVRename/TheTVDB/TheTVDB.cs index bfc0ce284..9043b22d4 100644 --- a/TVRename/TheTVDB/TheTVDB.cs +++ b/TVRename/TheTVDB/TheTVDB.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; +using System.Drawing.Drawing2D; using System.Net; using System.Text.RegularExpressions; using System.Threading; @@ -218,6 +219,42 @@ private bool LoadCache(FileInfo loadFrom) } } + public void RelaodCache(FileInfo loadFrom, FileInfo cache) + { + System.Diagnostics.Debug.Assert(cache != null); + cacheFile = cache; + + LastError = ""; + Connected = false; + extraEpisodes.Clear(); + removeEpisodeIds.Clear(); + + LanguageList = new List { new Language(7, "en", "English", "English") }; + + //assume that the data is up to date (this will be overridden by the value in the XML if we have a prior install) + //If we have no prior install then the app has no shows and is by definition up-to-date + newSrvTime = DateTime.UtcNow.ToUnixTime(); + + srvTime = 0; + + LoadOk = (loadFrom == null) || LoadCache(loadFrom); + + forceReloadOn.Clear(); + } + + public void ClearCache() + { + if (!GetLock("ClearCache")) + return; + + series.Clear(); + extraEpisodes.Clear(); + removeEpisodeIds.Clear(); + Unlock("ClearCache"); + + newSrvTime = DateTime.UtcNow.ToUnixTime(); + } + public void UpdatesDoneOk() { // call when all downloading and updating is done. updates local Srv_Time with the tentative @@ -425,7 +462,7 @@ public byte[] GetTvdbDownload(string url, bool forceReload = false) } } - public void ForgetEverything() + public void ForgetEverything() { if (!GetLock("ForgetEverything")) return; @@ -502,9 +539,49 @@ public bool GetUpdates() return false; } - long theTime = GetUpdateTime(); + long theTime = srvTime; - MarkPlaceholdersDirty(); + if (theTime == 0) + { + // we can use the oldest thing we have locally. It isn't safe to use the newest thing. + // This will only happen the first time we do an update, so a false _all update isn't too bad. + foreach (KeyValuePair kvp in series) + { + SeriesInfo ser = kvp.Value; + if ((theTime == 0) || ((ser.SrvLastUpdated != 0) && (ser.SrvLastUpdated < theTime))) + theTime = ser.SrvLastUpdated; + + //We can use AiredSeasons as it does not matter which order we do this in Aired or DVD + foreach (KeyValuePair kvp2 in kvp.Value.AiredSeasons) + { + Season seas = kvp2.Value; + + foreach (Episode e in seas.Episodes.Values) + { + if ((theTime == 0) || ((e.SrvLastUpdated != 0) && (e.SrvLastUpdated < theTime))) + theTime = e.SrvLastUpdated; + } + } + } + } + + // anything with a srv_lastupdated of 0 should be marked as dirty + // typically, this'll be placeholder series + foreach (KeyValuePair kvp in series) + { + SeriesInfo ser = kvp.Value; + if ((ser.SrvLastUpdated == 0) || (ser.AiredSeasons.Count == 0)) + ser.Dirty = true; + + foreach (KeyValuePair kvp2 in kvp.Value.AiredSeasons) + { + foreach (Episode ep in kvp2.Value.Episodes.Values) + { + if (ep.SrvLastUpdated == 0) + ep.Dirty = true; + } + } + } if (theTime == 0) { @@ -540,7 +617,7 @@ public bool GetUpdates() try { jsonUdpateResponse = HttpHelper.JsonHttpGetRequest(uri, - new Dictionary { { "fromTime", epochTime.ToString() } }, + new Dictionary {{"fromTime", epochTime.ToString()}}, tvDbTokenProvider.GetToken(), TVSettings.Instance.PreferredLanguage); } catch (WebException ex) @@ -560,7 +637,7 @@ public bool GetUpdates() { JToken dataToken = jsonUdpateResponse["data"]; - numberOfResponses = !dataToken.HasValues ? 0 : ((JArray)dataToken).Count; + numberOfResponses = !dataToken.HasValues ? 0 : ((JArray) dataToken).Count; } catch (InvalidCastException ex) { @@ -586,7 +663,17 @@ public bool GetUpdates() updatesResponses.Add(jsonUdpateResponse); numberofCallsMade++; - long maxUpdateTime = GetUpdateTime(jsonUdpateResponse); + long maxUpdateTime; + try + { + IEnumerable updateTimes = from a in jsonUdpateResponse["data"] select (long) a["lastUpdated"]; + maxUpdateTime = updateTimes.DefaultIfEmpty(0).Max(); + } + catch (Exception e) + { + Logger.Error(e,jsonUdpateResponse.ToString() ); + maxUpdateTime = 0; + } if (maxUpdateTime > 0) { @@ -623,244 +710,168 @@ public bool GetUpdates() Say("Processing Updates from TVDB"); - Parallel.ForEach(updatesResponses, jsonResponse => { ProcessUpdate(jsonResponse, uri); }); - - Say("Upgrading dirty locks"); - - UpgradeDirtyLocks(); - - Say(""); - - return true; - } - - private long GetUpdateTime() - { - return srvTime == 0 ? GetUpdateTimeFromShows(0) : srvTime; - } - - private void UpgradeDirtyLocks() - { - // if more than x% of a show's episodes are marked as dirty, just download the entire show again - foreach (KeyValuePair kvp in series) + Parallel.ForEach(updatesResponses, jsonResponse => { - int totaleps = 0; - int totaldirty = 0; - foreach (KeyValuePair kvp2 in kvp.Value.AiredSeasons) + // if updatetime > localtime for item, then remove it, so it will be downloaded later + try { - foreach (Episode ep in kvp2.Value.Episodes.Values) + foreach (JObject seriesResponse in jsonResponse["data"]) { - if (ep.Dirty) - totaldirty++; - - totaleps++; - } - } - - float percentDirty = 100; - if (totaldirty > 0 || totaleps > 0) percentDirty = 100 * totaldirty / totaleps; - if ((totaleps > 0) && ((percentDirty) >= TVSettings.Instance.PercentDirtyUpgrade())) // 10% - { - kvp.Value.Dirty = true; - kvp.Value.AiredSeasons.Clear(); - kvp.Value.DvdSeasons.Clear(); - Logger.Info("Planning to download all of {0} as {1}% of the episodes need to be updated", - kvp.Value.Name, percentDirty); - } - else - Logger.Trace( - "Not planning to download all of {0} as {1}% of the episodes need to be updated and that's less than the 10% limit to upgrade.", - kvp.Value.Name, percentDirty); - } - } - - private void ProcessUpdate(JObject jsonResponse, string uri) - { - // if updatetime > localtime for item, then remove it, so it will be downloaded later - try - { - foreach (JObject seriesResponse in jsonResponse["data"]) - { - int id = (int)seriesResponse["id"]; - long time = (long)seriesResponse["lastUpdated"]; + int id = (int) seriesResponse["id"]; + long time = (long) seriesResponse["lastUpdated"]; - if (this.series.ContainsKey(id)) // this is a series we have - { - if (time > this.series[id].SrvLastUpdated) // newer version on the server - this.series[id].Dirty = true; // mark as dirty, so it'll be fetched again later - else - Logger.Info(this.series[id].Name + " has a lastupdated of " + - Helpers.FromUnixTime(this.series[id].SrvLastUpdated) + " server says " + - Helpers.FromUnixTime(time)); + if (this.series.ContainsKey(id)) // this is a series we have + { + if (time > this.series[id].SrvLastUpdated) // newer version on the server + this.series[id].Dirty = true; // mark as dirty, so it'll be fetched again later + else + Logger.Info(this.series[id].Name + " has a lastupdated of " + + Helpers.FromUnixTime(this.series[id].SrvLastUpdated) + " server says " + + Helpers.FromUnixTime(time)); - //now we wish to see if any episodes from the series have been updated. If so then mark them as dirty too - List episodeDefaultLangResponses = null; - List episodeResponses = GetEpisodes(id, TVSettings.Instance.PreferredLanguage); - if (InForeignLanguage()) episodeDefaultLangResponses = GetEpisodes(id, DefaultLanguage); + //now we wish to see if any episodes from the series have been updated. If so then mark them as dirty too + List episodeDefaultLangResponses=null; + List episodeResponses = GetEpisodes(id, TVSettings.Instance.PreferredLanguage); + if (InForeignLanguage()) episodeDefaultLangResponses = GetEpisodes(id, DefaultLanguage); - Dictionary> episodesResponses = - MergeEpisodeResponses(episodeResponses, episodeDefaultLangResponses); + Dictionary> episodesResponses = + MergeEpisodeResponses(episodeResponses, episodeDefaultLangResponses); - int numberOfNewEpisodes = 0; - int numberOfUpdatedEpisodes = 0; + int numberOfNewEpisodes = 0; + int numberOfUpdatedEpisodes = 0; - ICollection oldEpisodeIds = new List(); - foreach (KeyValuePair kvp2 in GetSeries(id)?.AiredSeasons ?? new Dictionary()) - { - foreach (Episode ep in kvp2.Value.Episodes.Values) + ICollection oldEpisodeIds = new List(); + foreach (KeyValuePair kvp2 in GetSeries(id)?.AiredSeasons??new Dictionary()) { - oldEpisodeIds.Add(ep.EpisodeId); + foreach (Episode ep in kvp2.Value.Episodes.Values) + { + oldEpisodeIds.Add(ep.EpisodeId); + } } - } - foreach (JObject response in episodeResponses) - { - try + foreach (JObject response in episodeResponses) { - foreach (KeyValuePair> episodeData in episodesResponses) + try { - JToken episodeToUse = (episodeData.Value.Item1 ?? episodeData.Value.Item2); - long serverUpdateTime = (long)episodeToUse["lastUpdated"]; - int serverEpisodeId = episodeData.Key; - - bool found = false; - foreach (KeyValuePair kvp2 in this.series[id].AiredSeasons) + foreach (KeyValuePair> episodeData in episodesResponses) { - Season seas = kvp2.Value; + JToken episodeToUse = (episodeData.Value.Item1??episodeData.Value.Item2); + long serverUpdateTime = (long)episodeToUse["lastUpdated"]; + int serverEpisodeId = episodeData.Key; - foreach (Episode ep in seas.Episodes.Values) + bool found = false; + foreach (KeyValuePair kvp2 in this.series[id].AiredSeasons) { - if (ep.EpisodeId == serverEpisodeId) - { - oldEpisodeIds.Remove(serverEpisodeId); + Season seas = kvp2.Value; - if (ep.SrvLastUpdated < serverUpdateTime) + foreach (Episode ep in seas.Episodes.Values) + { + if (ep.EpisodeId == serverEpisodeId) { - ep.Dirty = true; // mark episode as dirty. - numberOfUpdatedEpisodes++; - } + oldEpisodeIds.Remove(serverEpisodeId); + + if (ep.SrvLastUpdated < serverUpdateTime) + { + ep.Dirty = true; // mark episode as dirty. + numberOfUpdatedEpisodes++; + } - found = true; - break; + found = true; + break; + } } } - } - if (!found) - { - // must be a new episode - LockExtraEpisodes(); - extraEpisodes.Add(new ExtraEp(id, serverEpisodeId)); - UnlockExtraEpisodes(); - numberOfNewEpisodes++; + if (!found) + { + // must be a new episode + LockExtraEpisodes(); + extraEpisodes.Add(new ExtraEp(id, serverEpisodeId)); + UnlockExtraEpisodes(); + numberOfNewEpisodes++; + } } } + catch (InvalidCastException ex) + { + Logger.Error("Did not recieve the expected format of episode json from {0}.", uri); + Logger.Error(ex); + Logger.Error(jsonResponse["data"].ToString()); + } + catch (OverflowException ex) + { + Logger.Error("Could not parse the episode json from {0}.", uri); + Logger.Error(ex); + Logger.Error(jsonResponse["data"].ToString()); + } } - catch (InvalidCastException ex) - { - Logger.Error("Did not recieve the expected format of episode json from {0}.", uri); - Logger.Error(ex); - Logger.Error(jsonResponse["data"].ToString()); - } - catch (OverflowException ex) - { - Logger.Error("Could not parse the episode json from {0}.", uri); - Logger.Error(ex); - Logger.Error(jsonResponse["data"].ToString()); - } - } - Logger.Info(this.series[id].Name + " had " + numberOfUpdatedEpisodes + - " episodes updated and " + numberOfNewEpisodes + " new episodes "); + Logger.Info(this.series[id].Name + " had " + numberOfUpdatedEpisodes + + " episodes updated and " + numberOfNewEpisodes + " new episodes "); - if (oldEpisodeIds.Count > 0) - Logger.Warn(this.series[id].Name + " had " + oldEpisodeIds.Count + - " episodes deleted: " + string.Join(",", oldEpisodeIds)); + if (oldEpisodeIds.Count > 0) + Logger.Warn(this.series[id].Name + " had " + oldEpisodeIds.Count + + " episodes deleted: " + string.Join(",", oldEpisodeIds)); - LockRemoveEpisodes(); - foreach (int episodeId in oldEpisodeIds) - removeEpisodeIds.Add(new ExtraEp(id, episodeId)); + LockRemoveEpisodes(); + foreach (int episodeId in oldEpisodeIds) + removeEpisodeIds.Add(new ExtraEp(id, episodeId)); - UnlockRemoveEpisodes(); + UnlockRemoveEpisodes(); + } } } - } - catch (InvalidCastException ex) - { - Logger.Error("Did not recieve the expected format of json from {0}.", uri); - Logger.Error(ex); - Logger.Error(jsonResponse["data"].ToString()); - } - catch (OverflowException ex) - { - Logger.Error("Could not parse the json from {0}.", uri); - Logger.Error(ex); - Logger.Error(jsonResponse["data"].ToString()); - } - } - - private static long GetUpdateTime(JObject jsonUdpateResponse) - { - long maxUpdateTime; - try - { - IEnumerable updateTimes = from a in jsonUdpateResponse["data"] select (long)a["lastUpdated"]; - maxUpdateTime = updateTimes.DefaultIfEmpty(0).Max(); - } - catch (Exception e) - { - Logger.Error(e, jsonUdpateResponse.ToString()); - maxUpdateTime = 0; - } - - return maxUpdateTime; - } - - private long GetUpdateTimeFromShows(long theTime) - { - // we can use the oldest thing we have locally. It isn't safe to use the newest thing. - // This will only happen the first time we do an update, so a false _all update isn't too bad. - foreach (KeyValuePair kvp in series) - { - SeriesInfo ser = kvp.Value; - if ((theTime == 0) || ((ser.SrvLastUpdated != 0) && (ser.SrvLastUpdated < theTime))) - theTime = ser.SrvLastUpdated; - - //We can use AiredSeasons as it does not matter which order we do this in Aired or DVD - foreach (KeyValuePair kvp2 in kvp.Value.AiredSeasons) + catch (InvalidCastException ex) { - Season seas = kvp2.Value; - - foreach (Episode e in seas.Episodes.Values) - { - if ((theTime == 0) || ((e.SrvLastUpdated != 0) && (e.SrvLastUpdated < theTime))) - theTime = e.SrvLastUpdated; - } + Logger.Error("Did not recieve the expected format of json from {0}.", uri); + Logger.Error(ex); + Logger.Error(jsonResponse["data"].ToString()); } - } + catch (OverflowException ex) + { + Logger.Error("Could not parse the json from {0}.", uri); + Logger.Error(ex); + Logger.Error(jsonResponse["data"].ToString()); + } + }); - return theTime; - } + Say("Upgrading dirty locks"); - private void MarkPlaceholdersDirty() - { - // anything with a srv_lastupdated of 0 should be marked as dirty - // typically, this'll be placeholder series + // if more than x% of a show's episodes are marked as dirty, just download the entire show again foreach (KeyValuePair kvp in series) { - SeriesInfo ser = kvp.Value; - if ((ser.SrvLastUpdated == 0) || (ser.AiredSeasons.Count == 0)) - ser.Dirty = true; - + int totaleps = 0; + int totaldirty = 0; foreach (KeyValuePair kvp2 in kvp.Value.AiredSeasons) { foreach (Episode ep in kvp2.Value.Episodes.Values) { - if (ep.SrvLastUpdated == 0) - ep.Dirty = true; + if (ep.Dirty) + totaldirty++; + + totaleps++; } } + + float percentDirty = 100; + if (totaldirty > 0 || totaleps > 0) percentDirty = 100 * totaldirty / totaleps; + if ((totaleps > 0) && ((percentDirty) >= TVSettings.Instance.PercentDirtyUpgrade())) // 10% + { + kvp.Value.Dirty = true; + kvp.Value.AiredSeasons.Clear(); + kvp.Value.DvdSeasons.Clear(); + Logger.Info("Planning to download all of {0} as {1}% of the episodes need to be updated", + kvp.Value.Name, percentDirty); + } + else + Logger.Trace( + "Not planning to download all of {0} as {1}% of the episodes need to be updated and that's less than the 10% limit to upgrade.", + kvp.Value.Name, percentDirty); } + + Say(""); + + return true; } private List GetEpisodes(int id,string lang) @@ -1050,6 +1061,7 @@ private void ProcessXmlBanner(XmlReader r, int codeHint) series[codeHint].BannersLoaded = true; break; // that's it. } + else if (r.Name == "xml") r.Read(); else @@ -1946,3 +1958,4 @@ public void Tidy(ICollection libraryValues) } } } + diff --git a/TVRename/Utility/BT.cs b/TVRename/Utility/BT.cs index d7e183b7f..912b76763 100644 --- a/TVRename/Utility/BT.cs +++ b/TVRename/Utility/BT.cs @@ -33,7 +33,7 @@ public enum BTChunk kBTEOF } - public class TorrentEntry: IDownloadInformation // represents a torrent downloading in uTorrent + public class TorrentEntry: DownloadInformation // represents a torrent downloading in uTorrent { public string DownloadingTo; public int PercentDone; @@ -46,11 +46,11 @@ public TorrentEntry(string torrentfile, string to, int percent) PercentDone = percent; } - string IDownloadInformation.FileIdentifier => TorrentFile; + string DownloadInformation.FileIdentifier => TorrentFile; - string IDownloadInformation.Destination => DownloadingTo; + string DownloadInformation.Destination => DownloadingTo; - string IDownloadInformation.RemainingText + string DownloadInformation.RemainingText { get { diff --git a/TVRename/Utility/DownloadInformation.cs b/TVRename/Utility/DownloadInformation.cs index f16e042d8..5ab5292df 100644 --- a/TVRename/Utility/DownloadInformation.cs +++ b/TVRename/Utility/DownloadInformation.cs @@ -1,6 +1,6 @@ namespace TVRename { - public interface IDownloadInformation + public interface DownloadInformation { string FileIdentifier { get; } string Destination { get; } diff --git a/TVRename/Utility/SAB/QueueSlotsSlot.cs b/TVRename/Utility/SAB/QueueSlotsSlot.cs index 1e2266c68..c0f778d22 100644 --- a/TVRename/Utility/SAB/QueueSlotsSlot.cs +++ b/TVRename/Utility/SAB/QueueSlotsSlot.cs @@ -6,7 +6,7 @@ namespace TVRename.SAB [System.SerializableAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [XmlType(AnonymousType = true)] - public class QueueSlotsSlot : object, System.ComponentModel.INotifyPropertyChanged,IDownloadInformation + public class QueueSlotsSlot : object, System.ComponentModel.INotifyPropertyChanged,DownloadInformation { private string statusField; private string indexField; @@ -237,11 +237,11 @@ public string size } } - string IDownloadInformation.FileIdentifier => filename; + string DownloadInformation.FileIdentifier => filename; - string IDownloadInformation.Destination => filename; + string DownloadInformation.Destination => filename; - string IDownloadInformation.RemainingText + string DownloadInformation.RemainingText { get { From 706718530a04f06912adc6bd3586a4d96c057438 Mon Sep 17 00:00:00 2001 From: Chlorel Date: Tue, 16 Oct 2018 14:44:51 +0200 Subject: [PATCH 04/12] Up To 2.6.x Rcx --- TVRename/Finders/FileFinder.cs | 123 ++-- TVRename/Finders/Finder.cs | 3 +- TVRename/Finders/SABnzbdFinder.cs | 65 +-- TVRename/Finders/qBitTorrentFinder.cs | 1 - TVRename/Forms/BulkAdd/BulkAdd.cs | 14 +- TVRename/Forms/BulkAdd/BulkAddEditShow.cs | 2 +- .../Forms/Preferences/AddEditSearchEngine.cs | 2 +- TVRename/Forms/Preferences/Preferences.cs | 8 +- TVRename/Forms/Tools/ActorsGrid.cs | 6 +- TVRename/Forms/Tools/ShowSummary.cs | 4 +- TVRename/Forms/UI.Designer.cs | 444 +++++++------- TVRename/Forms/UI.cs | 6 + TVRename/Forms/UI.resx | 4 +- .../Forms/Utilities/LogViewer.Designer.cs | 24 +- TVRename/Forms/Utilities/LogViewer.cs | 8 + .../ItemsAndActions/ActionCopyMoveRename.cs | 7 +- TVRename/ItemsAndActions/ActionDateTouch.cs | 51 +- TVRename/ItemsAndActions/ActionDelete.cs | 9 +- .../ItemsAndActions/ActionDownloadImage.cs | 43 +- TVRename/ItemsAndActions/ActionItem.cs | 106 ++-- TVRename/ItemsAndActions/ActionItemSorter.cs | 4 +- .../ItemsAndActions/ActionMede8erViewXML.cs | 22 +- TVRename/ItemsAndActions/ActionNFO.cs | 2 +- TVRename/ItemsAndActions/ActionPyTivoMeta.cs | 1 - TVRename/ItemsAndActions/ActionRSS.cs | 36 +- TVRename/ItemsAndActions/ItemDownloading.cs | 63 +- TVRename/ItemsAndActions/ItemMissing.cs | 31 +- TVRename/Settings/CustomSeasonName.cs | 11 + TVRename/Settings/Languages.cs | 115 ++++ TVRename/Settings/Searchers.cs | 49 +- TVRename/Settings/Settings.cs | 10 +- TVRename/Settings/ShowItem.cs | 24 +- TVRename/TVRename.csproj | 14 + TVRename/TVRename/ActionEngine.cs | 6 +- TVRename/TVRename/BullkAddManager.cs | 62 +- TVRename/TVRename/CacheUpdater.cs | 39 +- TVRename/TVRename/FoundFolder.cs | 9 +- TVRename/TVRename/PathManager.cs | 16 + TVRename/TVRename/ShowLibrary.cs | 41 +- TVRename/TVRename/TVDoc.cs | 38 +- TVRename/TheTVDB/Actor.cs | 11 +- TVRename/TheTVDB/Banner.cs | 20 +- TVRename/TheTVDB/Episode.cs | 4 +- TVRename/TheTVDB/Season.cs | 55 +- TVRename/TheTVDB/SeriesInfo.cs | 20 +- TVRename/TheTVDB/SeriesSpecifier.cs | 16 + TVRename/TheTVDB/TVSource.cs | 5 +- TVRename/TheTVDB/TheTVDB.cs | 542 +++++++++--------- TVRename/Utility/BT.cs | 8 +- TVRename/Utility/DownloadInformation.cs | 2 +- TVRename/Utility/SAB/QueueSlotsSlot.cs | 8 +- 51 files changed, 1178 insertions(+), 1036 deletions(-) create mode 100644 TVRename/Settings/Languages.cs create mode 100644 TVRename/TheTVDB/SeriesSpecifier.cs diff --git a/TVRename/Finders/FileFinder.cs b/TVRename/Finders/FileFinder.cs index eacbb41c3..52cb135b5 100644 --- a/TVRename/Finders/FileFinder.cs +++ b/TVRename/Finders/FileFinder.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Windows.Forms; using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; using DirectoryInfo = Alphaleonis.Win32.Filesystem.DirectoryInfo; @@ -25,15 +26,13 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) foreach (string s in TVSettings.Instance.DownloadFolders) fileCount += DirCache.CountFiles(s, true); - int c = 0; - DirCache dirCache = new DirCache(); foreach (string s in TVSettings.Instance.DownloadFolders) { if (ActionCancel) return; - dirCache.AddFolder(prog, c, fileCount, s, true); + dirCache.AddFolder(prog, 0, fileCount, s, true); } int currentItem = 0; @@ -47,30 +46,34 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) if (!(action1 is ItemMissing me)) continue; - int numberMatched = 0; ItemList thisRound = new ItemList(); - DirCacheEntry matchedFile=null; + List matchedFiles= new List(); foreach (DirCacheEntry dce in dirCache) { if (!ReviewFile(me, thisRound, dce)) continue; - numberMatched++; - matchedFile = dce; + matchedFiles.Add(dce); } - if (numberMatched == 1 ) + if (matchedFiles.Count == 1 ) { - if (!OtherActionsMatch(matchedFile, me, ActionList)) + if (!OtherActionsMatch(matchedFiles[0], me)) { toRemove.Add(action1); newList.AddRange(thisRound); } - else Logger.Warn($"Ignoring potential match for {action1.Episode.Show.ShowName} S{action1.Episode.AppropriateSeasonNumber} E{action1.Episode.AppropriateEpNum}: with file {matchedFile?.TheFile.FullName} as there are multiple actions for that file"); + else + { + Logger.Warn($"Ignoring potential match for {me.Episode.Show.ShowName} S{me.Episode.AppropriateSeasonNumber} E{action1.Episode.AppropriateEpNum}: with file {matchedFiles[0]?.TheFile.FullName} as there are multiple actions for that file"); + } } - else if (numberMatched>1) - { - Logger.Warn($"Ignoring potential match for {action1.Episode.Show.ShowName} S{action1.Episode.AppropriateSeasonNumber} E{action1.Episode.AppropriateEpNum}: with file {matchedFile?.TheFile.FullName} as there are multiple files for that action"); + else if (matchedFiles.Count > 1) + { + foreach (DirCacheEntry matchedFile in matchedFiles) + { + Logger.Warn($"Ignoring potential match for {me.Episode.Show.ShowName} S{me.Episode.AppropriateSeasonNumber} E{action1.Episode.AppropriateEpNum}: with file {matchedFile?.TheFile.FullName} as there are multiple files for that action"); + } } } @@ -124,10 +127,10 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) ActionList.Add(i); } - private bool OtherActionsMatch(DirCacheEntry matchedFile, ItemMissing me, ItemList actionList) + private bool OtherActionsMatch(DirCacheEntry matchedFile, Item me) //This is used to check whether the selected file may match any other files we are looking for { - foreach (Item testAction in actionList) + foreach (Item testAction in ActionList) { if (!(testAction is ItemMissing testMissingAction)) continue; if (testMissingAction.SameAs(me)) continue; @@ -180,27 +183,13 @@ private void KeepTogether(ItemList actionlist) if ((TVSettings.Instance.RenameTxtToSub) && (newName.EndsWith(".txt"))) newName = newName.Substring(0, newName.Length - 4) + ".sub"; - ActionCopyMoveRename newitem = new ActionCopyMoveRename(action.Operation, fi, FileHelper.FileInFolder(action.To.Directory, newName), action.Episode, null,null); // tidyup on main action, not this + ActionCopyMoveRename newitem = new ActionCopyMoveRename(action.Operation, fi, FileHelper.FileInFolder(action.To.Directory, newName), action.Episode, null, null); // tidyup on main action, not this // check this item isn't already in our to-do list - bool doNotAdd = false; - foreach (Item ai2 in actionlist) - { - if (!(ai2 is ActionCopyMoveRename)) - continue; + if (ActionListContains(actionlist, newitem)) continue; - if (((ActionCopyMoveRename)(ai2)).SameSource(newitem)) - { - doNotAdd = true; - break; - } - } - - if (!doNotAdd) - { - if (!newitem.SameAs(action)) // don't re-add ourself - extras.Add(newitem); - } + if (!newitem.SameAs(action)) // don't re-add ourself + extras.Add(newitem); } } catch (System.IO.PathTooLongException e) @@ -215,32 +204,49 @@ private void KeepTogether(ItemList actionlist) foreach (Item action in extras) { // check we don't already have this in our list and, if we don't add it! - bool have = false; - foreach (Item action2 in actionlist) + bool have = AlreadyHaveAction(actionlist, action); + + if (!have) + actionlist.Insert(0, action); // put before other actions, so tidyup is run last + } + } + + private static bool AlreadyHaveAction(ItemList actionlist, Item action) + { + foreach (Item action2 in actionlist) + { + if (action2.SameAs(action)) { - if (action2.SameAs(action)) - { - have = true; - break; - } + return true; + } - if ((action is Action a1) && (action2 is Action) ) + if ((action is Action a1) && (action2 is Action a2)) + { + if (a2.Produces == a1.Produces) { - Action a2 = (Action)action2; - if (a2.Produces == a1.Produces) - { - have = true; - break; - } + return true; } } + } - if (!have) - actionlist.Insert(0, action); // put before other actions, so tidyup is run last + return false; + } + + private static bool ActionListContains(ItemList actionlist, ActionCopyMoveRename newitem) + { + foreach (Item ai2 in actionlist) + { + if (!(ai2 is ActionCopyMoveRename)) + continue; + + if (((ActionCopyMoveRename)(ai2)).SameSource(newitem)) + { + return true; + } } + + return false; } - // consider each of the files, see if it is suitable for series "ser" and episode "epi" - // if so, add a rcitem for copy to "fi" private bool ReviewFile(ItemMissing me, ItemList addTo, DirCacheEntry dce) { @@ -260,11 +266,16 @@ private bool ReviewFile(ItemMissing me, ItemList addTo, DirCacheEntry dce) if (matched) { - if ((TVDoc.FindSeasEp(dce.TheFile, out int seasF, out int epF, out int maxEp, me.Episode.Show) && (seasF == season) && - (epF == epnum)) || - (me.Episode.Show.UseSequentialMatch && - TVDoc.MatchesSequentialNumber(dce.TheFile.Name, ref seasF, ref epF, me.Episode) && (seasF == season) && - (epF == epnum))) + bool regularMatch = TVDoc.FindSeasEp(dce.TheFile, out int seasF, out int epF, out int maxEp, me.Episode.Show) && + seasF == season && + epF == epnum; + + bool sequentialMatch = me.Episode.Show.UseSequentialMatch && + TVDoc.MatchesSequentialNumber(dce.TheFile.Name, ref seasF, ref epF, me.Episode) && + seasF == season && + epF == epnum; + + if (regularMatch || sequentialMatch) { if (maxEp != -1 && TVSettings.Instance.AutoMergeDownloadEpisodes) { diff --git a/TVRename/Finders/Finder.cs b/TVRename/Finders/Finder.cs index d205a1a13..328400ff8 100644 --- a/TVRename/Finders/Finder.cs +++ b/TVRename/Finders/Finder.cs @@ -4,6 +4,7 @@ public abstract class Finder { public enum DownloadApp { + // ReSharper disable once InconsistentNaming SABnzbd, uTorrent, qBitTorrent @@ -18,7 +19,7 @@ public enum DownloadApp protected Finder(TVDoc doc) => Doc = doc; // ReSharper disable once InconsistentNaming - public enum FinderDisplayType { local, downloading, rss}; + public enum FinderDisplayType { local, downloading, rss} public abstract void Check(SetProgressDelegate prog, int startpct, int totPct); diff --git a/TVRename/Finders/SABnzbdFinder.cs b/TVRename/Finders/SABnzbdFinder.cs index bff0cfad9..ab01c74a5 100644 --- a/TVRename/Finders/SABnzbdFinder.cs +++ b/TVRename/Finders/SABnzbdFinder.cs @@ -2,7 +2,6 @@ using System.Net; using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; - namespace TVRename { // ReSharper disable once InconsistentNaming @@ -10,15 +9,9 @@ class SABnzbdFinder :Finder { public SABnzbdFinder(TVDoc i) : base(i) { } - public override bool Active() - { - return TVSettings.Instance.CheckSABnzbd; - } + public override bool Active() => TVSettings.Instance.CheckSABnzbd; - public override FinderDisplayType DisplayType() - { - return FinderDisplayType.downloading; - } + public override FinderDisplayType DisplayType() => FinderDisplayType.downloading; public override void Check(SetProgressDelegate prog, int startpct, int totPct) { @@ -35,16 +28,7 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) string theUrl = "http://" + TVSettings.Instance.SABHostPort + "/sabnzbd/api?mode=queue&start=0&limit=8888&output=xml&apikey=" + TVSettings.Instance.SABAPIKey; - WebClient wc = new WebClient(); - byte[] r = null; - try - { - r = wc.DownloadData(theUrl); - } - catch (WebException) - { - Logger.Warn("Failed to obtain SABnzbd, please recheck settings: " + theUrl); - } + byte[] r = DownloadPage(theUrl); if (r == null) { @@ -57,7 +41,7 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) SAB.Result res = SAB.Result.Deserialize(r); if (res != null && res.status == "False") { - Logger.Error("Error processing data from SABnzbd (Queue Check): {0}",res.error ); + Logger.Error("Error processing data from SABnzbd (Queue Check): {0}", res.error); prog.Invoke(totPct); return; } @@ -80,7 +64,7 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) } System.Diagnostics.Debug.Assert(sq != null); // shouldn't happen - if (sq?.slots == null || sq.slots.Length == 0) // empty queue + if (sq.slots == null || sq.slots.Length == 0) // empty queue return; ItemList newList = new ItemList(); @@ -93,8 +77,7 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) if (ActionCancel) return; - prog.Invoke(startpct + (totPct - startpct) * (++n) / (c)); - + prog.Invoke(startpct + ((totPct - startpct) * (++n) / (c))); if (!(action1 is ItemMissing)) continue; @@ -105,19 +88,14 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) foreach (SAB.QueueSlotsSlot te in sq.slots) { - //foreach (queueSlotsSlot te in qs) - { - FileInfo file = new FileInfo(te.filename); - //if (!TVSettings.Instance.UsefulExtension(file.Extension, false)) // not a usefile file extension - // continue; - - if (!FileHelper.SimplifyAndCheckFilename(file.FullName, showname, true, false)) continue; - if (!TVDoc.FindSeasEp(file, out int seasF, out int epF, out int _, action.Episode.Show) || - (seasF != action.Episode.AppropriateSeasonNumber) || (epF != action.Episode.AppropriateEpNum )) continue; - toRemove.Add(action1); - newList.Add(new ItemDownloading(te, action.Episode, action.TheFileNoExt,DownloadApp.SABnzbd)); - break; - } + FileInfo file = new FileInfo(te.filename); + + if (!FileHelper.SimplifyAndCheckFilename(file.FullName, showname, true, false)) continue; + if (!TVDoc.FindSeasEp(file, out int seasF, out int epF, out int _, action.Episode.Show) || + (seasF != action.Episode.AppropriateSeasonNumber) || (epF != action.Episode.AppropriateEpNum)) continue; + toRemove.Add(action1); + newList.Add(new ItemDownloading(te, action.Episode, action.TheFileNoExt, DownloadApp.SABnzbd)); + break; } } @@ -130,5 +108,20 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) prog.Invoke(totPct); } + private static byte[] DownloadPage(string theUrl) + { + WebClient wc = new WebClient(); + byte[] r = null; + try + { + r = wc.DownloadData(theUrl); + } + catch (WebException) + { + Logger.Warn("Failed to obtain SABnzbd, please recheck settings: " + theUrl); + } + + return r; + } } } diff --git a/TVRename/Finders/qBitTorrentFinder.cs b/TVRename/Finders/qBitTorrentFinder.cs index 6ec305268..c7baff8bb 100644 --- a/TVRename/Finders/qBitTorrentFinder.cs +++ b/TVRename/Finders/qBitTorrentFinder.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Net; using System.Net.Http; -using System.Threading.Tasks; namespace TVRename { diff --git a/TVRename/Forms/BulkAdd/BulkAdd.cs b/TVRename/Forms/BulkAdd/BulkAdd.cs index 8f2288c44..7ee6b51f8 100644 --- a/TVRename/Forms/BulkAdd/BulkAdd.cs +++ b/TVRename/Forms/BulkAdd/BulkAdd.cs @@ -7,7 +7,6 @@ // using System.Collections.Generic; -using System.Linq; using System.Windows.Forms; using System.Threading; using DirectoryInfo = Alphaleonis.Win32.Filesystem.DirectoryInfo; @@ -316,9 +315,6 @@ private void bnFullAuto_Click(object _, System.EventArgs e) if (ai.CodeKnown) continue; - int p = ai.Folder.LastIndexOf(System.IO.Path.DirectorySeparatorChar); - FmpUpto = ai.Folder.Substring(p + 1); // +1 makes -1 "not found" result ok - BulkAddManager.GuessShowItem(ai,mDoc.Library); // update our display @@ -353,7 +349,7 @@ private void bnIgnoreNewFolder_Click(object _, System.EventArgs e) foreach (ListViewItem lvi in lvFMNewShows.SelectedItems) { FoundFolder ai = (FoundFolder)(lvi.Tag); - TVSettings.Instance.IgnoreFolders.Add(ai.Folder.ToLower()); + TVSettings.Instance.IgnoreFolders.Add(ai.Folder.FullName.ToLower()); engine.AddItems.Remove(ai); } mDoc.SetDirty(); @@ -383,7 +379,7 @@ private void bnNewFolderOpen_Click(object sender, System.EventArgs e) if (lvFMNewShows.SelectedItems[0].Tag is FoundFolder ai) { - Helpers.SysOpen(ai.Folder); + Helpers.SysOpen(ai.Folder.FullName); } } @@ -423,12 +419,12 @@ private void FillNewShowList(bool keepSel) private void UpdateResultEntry(FoundFolder ai, ListViewItem lvi) { lvi.SubItems.Clear(); - lvi.Text = ai.Folder; - lvi.SubItems.Add(ai.CodeKnown ? TheTVDB.Instance.GetSeries(ai.TVDBCode).Name : ""); + lvi.Text = ai.Folder.FullName; + lvi.SubItems.Add(ai.CodeKnown ? TheTVDB.Instance.GetSeries(ai.TVDBCode)?.Name : ""); lvi.SubItems.Add(ai.HasSeasonFoldersGuess ? "Folder per season" : "Flat"); lvi.SubItems.Add(ai.CodeKnown ? ai.TVDBCode.ToString() : ""); lvi.Tag = ai; - lvi.ImageIndex=(ai.CodeKnown&&!string.IsNullOrWhiteSpace(ai.Folder))?1:0; + lvi.ImageIndex=(ai.CodeKnown&&!string.IsNullOrWhiteSpace(ai.Folder.FullName))?1:0; } private void UpdateListItem(FoundFolder ai, bool makevis) diff --git a/TVRename/Forms/BulkAdd/BulkAddEditShow.cs b/TVRename/Forms/BulkAdd/BulkAddEditShow.cs index 69717fb63..a62c14fc3 100644 --- a/TVRename/Forms/BulkAdd/BulkAddEditShow.cs +++ b/TVRename/Forms/BulkAdd/BulkAddEditShow.cs @@ -33,7 +33,7 @@ public FolderMonitorEdit(FoundFolder hint) codeFinderControl.SetHint(hint.TVDBCode.ToString()); else { - string s = hint.Folder; + string s = hint.Folder.FullName; int p = s.LastIndexOf(System.IO.Path.DirectorySeparatorChar); codeFinderControl.SetHint(s.Substring(p+1)); } diff --git a/TVRename/Forms/Preferences/AddEditSearchEngine.cs b/TVRename/Forms/Preferences/AddEditSearchEngine.cs index ba681e94e..a60d670ec 100644 --- a/TVRename/Forms/Preferences/AddEditSearchEngine.cs +++ b/TVRename/Forms/Preferences/AddEditSearchEngine.cs @@ -40,7 +40,7 @@ public AddEditSearchEngine(Searchers s, ProcessedEpisode pe) { AddNewRow(); grid1[i + 1, 0].Value = mSearchers.Name(i); - grid1[i + 1, 1].Value = mSearchers.URL(i); + grid1[i + 1, 1].Value = mSearchers.Url(i); } } diff --git a/TVRename/Forms/Preferences/Preferences.cs b/TVRename/Forms/Preferences/Preferences.cs index 55af2b635..8cc69a61a 100644 --- a/TVRename/Forms/Preferences/Preferences.cs +++ b/TVRename/Forms/Preferences/Preferences.cs @@ -249,11 +249,11 @@ private void OKButton_Click(object sender, EventArgs e) TheTVDB.Instance.GetLock("Preferences-OK"); - foreach (TheTVDB.Language l in TheTVDB.Instance.LanguageList) + foreach (Language l in TheTVDB.Instance.LanguageList) { if (l.Name == cbLanguages.Text) { - s.PreferredLanguage = l.Abbreviation; + s.PreferredLanguageCode = l.Abbreviation; break; } } @@ -428,7 +428,7 @@ private void Preferences_Load(object sender, EventArgs e) chkAutoSearchForDownloadedFiles.Checked = s.AutoSearchForDownloadedFiles; cbSearchLocally.Checked = s.SearchLocally; cbLeaveOriginals.Checked = s.LeaveOriginals; - enterPreferredLanguage = s.PreferredLanguage; + enterPreferredLanguage = s.PreferredLanguageCode; cbEpThumbJpg.Checked = s.EpJPGs; cbSeriesJpg.Checked = s.SeriesJpg; @@ -969,7 +969,7 @@ private void FillLanguageList() cbLanguages.Items.Clear(); string pref = ""; - foreach (TheTVDB.Language l in TheTVDB.Instance.LanguageList) + foreach (Language l in TheTVDB.Instance.LanguageList) { cbLanguages.Items.Add(l.Name); diff --git a/TVRename/Forms/Tools/ActorsGrid.cs b/TVRename/Forms/Tools/ActorsGrid.cs index 194fdfe81..fe1aa1e56 100644 --- a/TVRename/Forms/Tools/ActorsGrid.cs +++ b/TVRename/Forms/Tools/ActorsGrid.cs @@ -276,7 +276,7 @@ private void FillGrid() { View = theData.Data[r][c].Value ? isActorModel : isGuestModel }; - grid1[r + 1, c + 1].AddController(new CellClickEvent(theData.Cols[c], theData.Rows[r])); + grid1[r + 1, c + 1].AddController(new CellClickEvent(theData.Cols[c])); } else grid1[r + 1, c + 1] = new Cell(""); @@ -344,13 +344,11 @@ private void rbTotals_CheckedChanged(object sender, EventArgs e) private class CellClickEvent : SourceGrid.Cells.Controllers.ControllerBase { - private readonly string show; private readonly string who; - public CellClickEvent(string who, string show) + public CellClickEvent(string who) { this.who = who; - this.show = show; } public override void OnClick(SourceGrid.CellContext sender, EventArgs e) diff --git a/TVRename/Forms/Tools/ShowSummary.cs b/TVRename/Forms/Tools/ShowSummary.cs index 47ffbbadd..a3053848c 100644 --- a/TVRename/Forms/Tools/ShowSummary.cs +++ b/TVRename/Forms/Tools/ShowSummary.cs @@ -299,7 +299,7 @@ private void TVDBFor(ShowItem si) private void ForceRefresh(ShowItem si) { if (si != null) - TheTVDB.Instance.ForgetShow(si.TvdbCode, true); + TheTVDB.Instance.ForgetShow(si.TvdbCode, true,si.UseCustomLanguage,si.CustomLanguageCode); mDoc.DoDownloadsFG(); } @@ -490,7 +490,7 @@ public ShowSummarySeasonData(int seasonNumber, int episodeCount, int episodeAire this.episodeAiredCount = episodeAiredCount; this.episodeGotCount = episodeGotCount; Season = season; - this.Ignored = ignored; + Ignored = ignored; } public SummaryOutput GetOuput() diff --git a/TVRename/Forms/UI.Designer.cs b/TVRename/Forms/UI.Designer.cs index a2b8c08d4..86376985b 100644 --- a/TVRename/Forms/UI.Designer.cs +++ b/TVRename/Forms/UI.Designer.cs @@ -138,6 +138,15 @@ public void InitializeComponent() this.bnActionOptions = new System.Windows.Forms.Button(); this.bnActionWhichSearch = new System.Windows.Forms.Button(); this.bnActionBTSearch = new System.Windows.Forms.Button(); + this.lvAction = new TVRename.MyListView(); + this.columnHeader48 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader49 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader51 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader52 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader53 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader54 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader55 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader58 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.ilIcons = new System.Windows.Forms.ImageList(this.components); this.bnActionAction = new System.Windows.Forms.Button(); this.bnActionRecentCheck = new System.Windows.Forms.Button(); @@ -148,6 +157,15 @@ public void InitializeComponent() this.bnWhenToWatchCheck = new System.Windows.Forms.Button(); this.txtWhenToWatchSynopsis = new System.Windows.Forms.TextBox(); this.calCalendar = new System.Windows.Forms.MonthCalendar(); + this.lvWhenToWatch = new TVRename.ListViewFlickerFree(); + this.columnHeader29 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader30 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader31 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader32 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader36 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader33 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader34 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader35 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.pbProgressBarx = new System.Windows.Forms.ProgressBar(); this.txtDLStatusLabel = new System.Windows.Forms.Label(); @@ -176,25 +194,8 @@ public void InitializeComponent() this.tmrPeriodicScan = new System.Windows.Forms.Timer(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.btnUpdateAvailable = new System.Windows.Forms.Button(); - this.lvAction = new TVRename.MyListView(); - this.columnHeader48 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader49 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader51 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader52 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader53 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader54 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader55 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader56 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader58 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.lvWhenToWatch = new TVRename.ListViewFlickerFree(); - this.columnHeader29 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader30 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader31 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader32 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader36 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader33 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader34 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader35 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); + this.logToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tbMyShows.SuspendLayout(); @@ -252,14 +253,14 @@ public void InitializeComponent() // aeCollToolStripMenuItem // this.aeCollToolStripMenuItem.Name = "aeCollToolStripMenuItem"; - this.aeCollToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.aeCollToolStripMenuItem.Size = new System.Drawing.Size(127, 22); this.aeCollToolStripMenuItem.Text = "Add / Edit"; this.aeCollToolStripMenuItem.Click += new System.EventHandler(this.aeCollToolStripMenuItem_Click); // // toolStripSeparator8 // this.toolStripSeparator8.Name = "toolStripSeparator8"; - this.toolStripSeparator8.Size = new System.Drawing.Size(177, 6); + this.toolStripSeparator8.Size = new System.Drawing.Size(124, 6); // // toolStripSeparator0 // @@ -511,7 +512,9 @@ public void InitializeComponent() this.toolStripSeparator7, this.buyMeADrinkToolStripMenuItem, this.toolStripSeparator6, - this.checkForNewVersionToolStripMenuItem}); + this.checkForNewVersionToolStripMenuItem, + this.toolStripSeparator9, + this.logToolStripMenuItem}); this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); this.helpToolStripMenuItem.Text = "&Help"; @@ -1032,6 +1035,115 @@ public void InitializeComponent() this.bnActionBTSearch.UseVisualStyleBackColor = true; this.bnActionBTSearch.Click += new System.EventHandler(this.bnActionBTSearch_Click); // + // lvAction + // + this.lvAction.AllowDrop = true; + this.lvAction.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvAction.CheckBoxes = true; + this.lvAction.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader48, + this.columnHeader49, + this.columnHeader51, + this.columnHeader52, + this.columnHeader53, + this.columnHeader54, + this.columnHeader55, + this.columnHeader58}); + this.lvAction.FullRowSelect = true; + listViewGroup1.Header = "Missing"; + listViewGroup1.Name = "lvgActionMissing"; + listViewGroup2.Header = "Rename"; + listViewGroup2.Name = "lvgActionRename"; + listViewGroup3.Header = "Copy"; + listViewGroup3.Name = "lvgActionCopy"; + listViewGroup4.Header = "Move"; + listViewGroup4.Name = "lvgActionMove"; + listViewGroup5.Header = "Remove"; + listViewGroup5.Name = "lvgActionDelete"; + listViewGroup6.Header = "Download RSS"; + listViewGroup6.Name = "lvgActionDownloadRSS"; + listViewGroup7.Header = "Download"; + listViewGroup7.Name = "lvgActionDownload"; + listViewGroup8.Header = "Media Center Metadata"; + listViewGroup8.Name = "lvgActionMeta"; + listViewGroup9.Header = "Update File Metadata"; + listViewGroup9.Name = "lvgUpdateFileDates"; + listViewGroup10.Header = "Downloading"; + listViewGroup10.Name = "lvgDownloading"; + this.lvAction.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { + listViewGroup1, + listViewGroup2, + listViewGroup3, + listViewGroup4, + listViewGroup5, + listViewGroup6, + listViewGroup7, + listViewGroup8, + listViewGroup9, + listViewGroup10}); + this.lvAction.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.lvAction.HideSelection = false; + this.lvAction.Location = new System.Drawing.Point(0, 35); + this.lvAction.Name = "lvAction"; + this.lvAction.ShowItemToolTips = true; + this.lvAction.Size = new System.Drawing.Size(920, 435); + this.lvAction.SmallImageList = this.ilIcons; + this.lvAction.TabIndex = 2; + this.lvAction.UseCompatibleStateImageBehavior = false; + this.lvAction.View = System.Windows.Forms.View.Details; + this.lvAction.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.lvAction_ItemCheck); + this.lvAction.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lvAction_ItemChecked); + this.lvAction.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.lvAction_RetrieveVirtualItem); + this.lvAction.SelectedIndexChanged += new System.EventHandler(this.lvAction_SelectedIndexChanged); + this.lvAction.DragDrop += new System.Windows.Forms.DragEventHandler(this.lvAction_DragDrop); + this.lvAction.DragEnter += new System.Windows.Forms.DragEventHandler(this.lvAction_DragEnter); + this.lvAction.DragOver += new System.Windows.Forms.DragEventHandler(this.lvAction_DragEnter); + this.lvAction.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvAction_KeyDown); + this.lvAction.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvAction_MouseClick); + this.lvAction.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvAction_MouseDoubleClick); + // + // columnHeader48 + // + this.columnHeader48.Text = "Show"; + this.columnHeader48.Width = 155; + // + // columnHeader49 + // + this.columnHeader49.Text = "Season"; + this.columnHeader49.Width = 50; + // + // columnHeader51 + // + this.columnHeader51.Text = "Episode"; + this.columnHeader51.Width = 50; + // + // columnHeader52 + // + this.columnHeader52.Text = "Date"; + this.columnHeader52.Width = 70; + // + // columnHeader53 + // + this.columnHeader53.Text = "Folder"; + this.columnHeader53.Width = 180; + // + // columnHeader54 + // + this.columnHeader54.Text = "Filename"; + this.columnHeader54.Width = 180; + // + // columnHeader55 + // + this.columnHeader55.Text = "Source"; + this.columnHeader55.Width = 180; + // + // columnHeader58 + // + this.columnHeader58.Text = "Errors"; + this.columnHeader58.Width = 180; + // // ilIcons // this.ilIcons.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ilIcons.ImageStream"))); @@ -1161,6 +1273,89 @@ public void InitializeComponent() this.calCalendar.TabIndex = 5; this.calCalendar.DateSelected += new System.Windows.Forms.DateRangeEventHandler(this.calCalendar_DateSelected); // + // lvWhenToWatch + // + this.lvWhenToWatch.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvWhenToWatch.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader29, + this.columnHeader30, + this.columnHeader31, + this.columnHeader32, + this.columnHeader36, + this.columnHeader33, + this.columnHeader34, + this.columnHeader35}); + this.lvWhenToWatch.FullRowSelect = true; + listViewGroup11.Header = "Recently Aired"; + listViewGroup11.Name = "justPassed"; + listViewGroup12.Header = "Next 7 Days"; + listViewGroup12.Name = "next7days"; + listViewGroup12.Tag = "1"; + listViewGroup13.Header = "Future Episodes"; + listViewGroup13.Name = "futureEps"; + listViewGroup14.Header = "Later"; + listViewGroup14.Name = "later"; + listViewGroup14.Tag = "2"; + this.lvWhenToWatch.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { + listViewGroup11, + listViewGroup12, + listViewGroup13, + listViewGroup14}); + this.lvWhenToWatch.HideSelection = false; + this.lvWhenToWatch.Location = new System.Drawing.Point(0, 35); + this.lvWhenToWatch.Name = "lvWhenToWatch"; + this.lvWhenToWatch.ShowItemToolTips = true; + this.lvWhenToWatch.Size = new System.Drawing.Size(923, 297); + this.lvWhenToWatch.SmallImageList = this.ilIcons; + this.lvWhenToWatch.TabIndex = 3; + this.lvWhenToWatch.UseCompatibleStateImageBehavior = false; + this.lvWhenToWatch.View = System.Windows.Forms.View.Details; + this.lvWhenToWatch.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lvWhenToWatch_ColumnClick); + this.lvWhenToWatch.SelectedIndexChanged += new System.EventHandler(this.lvWhenToWatch_Click); + this.lvWhenToWatch.DoubleClick += new System.EventHandler(this.lvWhenToWatch_DoubleClick); + this.lvWhenToWatch.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvWhenToWatch_MouseClick); + // + // columnHeader29 + // + this.columnHeader29.Text = "Show"; + this.columnHeader29.Width = 187; + // + // columnHeader30 + // + this.columnHeader30.Text = "Season"; + this.columnHeader30.Width = 51; + // + // columnHeader31 + // + this.columnHeader31.Text = "Episode"; + this.columnHeader31.Width = 55; + // + // columnHeader32 + // + this.columnHeader32.Text = "Air Date"; + this.columnHeader32.Width = 81; + // + // columnHeader36 + // + this.columnHeader36.Text = "Time"; + // + // columnHeader33 + // + this.columnHeader33.Text = "Day"; + this.columnHeader33.Width = 42; + // + // columnHeader34 + // + this.columnHeader34.Text = "How Long"; + this.columnHeader34.Width = 69; + // + // columnHeader35 + // + this.columnHeader35.Text = "Episode Name"; + this.columnHeader35.Width = 360; + // // tableLayoutPanel2 // this.tableLayoutPanel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) @@ -1343,203 +1538,17 @@ public void InitializeComponent() this.btnUpdateAvailable.Visible = false; this.btnUpdateAvailable.Click += new System.EventHandler(this.btnUpdateAvailable_Click); // - // lvAction - // - this.lvAction.AllowDrop = true; - this.lvAction.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvAction.CheckBoxes = true; - this.lvAction.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader48, - this.columnHeader49, - this.columnHeader51, - this.columnHeader52, - this.columnHeader53, - this.columnHeader54, - this.columnHeader55, - this.columnHeader56, - this.columnHeader58}); - this.lvAction.FullRowSelect = true; - listViewGroup1.Header = "Missing"; - listViewGroup1.Name = "lvgActionMissing"; - listViewGroup2.Header = "Rename"; - listViewGroup2.Name = "lvgActionRename"; - listViewGroup3.Header = "Copy"; - listViewGroup3.Name = "lvgActionCopy"; - listViewGroup4.Header = "Move"; - listViewGroup4.Name = "lvgActionMove"; - listViewGroup5.Header = "Remove"; - listViewGroup5.Name = "lvgActionDelete"; - listViewGroup6.Header = "Download RSS"; - listViewGroup6.Name = "lvgActionDownloadRSS"; - listViewGroup7.Header = "Download"; - listViewGroup7.Name = "lvgActionDownload"; - listViewGroup8.Header = "Media Center Metadata"; - listViewGroup8.Name = "lvgActionMeta"; - listViewGroup9.Header = "Update File Metadata"; - listViewGroup9.Name = "lvgUpdateFileDates"; - listViewGroup10.Header = "Downloading"; - listViewGroup10.Name = "lvgDownloading"; - this.lvAction.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { - listViewGroup1, - listViewGroup2, - listViewGroup3, - listViewGroup4, - listViewGroup5, - listViewGroup6, - listViewGroup7, - listViewGroup8, - listViewGroup9, - listViewGroup10}); - this.lvAction.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.lvAction.HideSelection = false; - this.lvAction.Location = new System.Drawing.Point(0, 35); - this.lvAction.Name = "lvAction"; - this.lvAction.ShowItemToolTips = true; - this.lvAction.Size = new System.Drawing.Size(920, 435); - this.lvAction.SmallImageList = this.ilIcons; - this.lvAction.TabIndex = 2; - this.lvAction.UseCompatibleStateImageBehavior = false; - this.lvAction.View = System.Windows.Forms.View.Details; - this.lvAction.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.lvAction_ItemCheck); - this.lvAction.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.lvAction_ItemChecked); - this.lvAction.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.lvAction_RetrieveVirtualItem); - this.lvAction.SelectedIndexChanged += new System.EventHandler(this.lvAction_SelectedIndexChanged); - this.lvAction.DragDrop += new System.Windows.Forms.DragEventHandler(this.lvAction_DragDrop); - this.lvAction.DragEnter += new System.Windows.Forms.DragEventHandler(this.lvAction_DragEnter); - this.lvAction.DragOver += new System.Windows.Forms.DragEventHandler(this.lvAction_DragEnter); - this.lvAction.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvAction_KeyDown); - this.lvAction.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvAction_MouseClick); - this.lvAction.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvAction_MouseDoubleClick); - // - // columnHeader48 - // - this.columnHeader48.Text = "Show"; - this.columnHeader48.Width = 155; - // - // columnHeader49 + // toolStripSeparator9 // - this.columnHeader49.Text = "Season"; - this.columnHeader49.Width = 50; + this.toolStripSeparator9.Name = "toolStripSeparator9"; + this.toolStripSeparator9.Size = new System.Drawing.Size(193, 6); // - // columnHeader51 + // logToolStripMenuItem // - this.columnHeader51.Text = "Episode"; - this.columnHeader51.Width = 50; - // - // columnHeader52 - // - this.columnHeader52.Text = "Date"; - this.columnHeader52.Width = 70; - // - // columnHeader53 - // - this.columnHeader53.Text = "Folder"; - this.columnHeader53.Width = 180; - // - // columnHeader54 - // - this.columnHeader54.Text = "Episode/Filename"; - this.columnHeader54.Width = 180; - // - // columnHeader55 - // - this.columnHeader55.Text = "Folder/Filename"; - this.columnHeader55.Width = 180; - // - // columnHeader56 - // - this.columnHeader56.Text = "Filename"; - this.columnHeader56.Width = 180; - // - // columnHeader58 - // - this.columnHeader58.Text = "Errors"; - this.columnHeader58.Width = 180; - // - // lvWhenToWatch - // - this.lvWhenToWatch.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvWhenToWatch.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader29, - this.columnHeader30, - this.columnHeader31, - this.columnHeader32, - this.columnHeader36, - this.columnHeader33, - this.columnHeader34, - this.columnHeader35}); - this.lvWhenToWatch.FullRowSelect = true; - listViewGroup11.Header = "Recently Aired"; - listViewGroup11.Name = "justPassed"; - listViewGroup12.Header = "Next 7 Days"; - listViewGroup12.Name = "next7days"; - listViewGroup12.Tag = "1"; - listViewGroup13.Header = "Future Episodes"; - listViewGroup13.Name = "futureEps"; - listViewGroup14.Header = "Later"; - listViewGroup14.Name = "later"; - listViewGroup14.Tag = "2"; - this.lvWhenToWatch.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { - listViewGroup11, - listViewGroup12, - listViewGroup13, - listViewGroup14}); - this.lvWhenToWatch.HideSelection = false; - this.lvWhenToWatch.Location = new System.Drawing.Point(0, 35); - this.lvWhenToWatch.Name = "lvWhenToWatch"; - this.lvWhenToWatch.ShowItemToolTips = true; - this.lvWhenToWatch.Size = new System.Drawing.Size(923, 297); - this.lvWhenToWatch.SmallImageList = this.ilIcons; - this.lvWhenToWatch.TabIndex = 3; - this.lvWhenToWatch.UseCompatibleStateImageBehavior = false; - this.lvWhenToWatch.View = System.Windows.Forms.View.Details; - this.lvWhenToWatch.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.lvWhenToWatch_ColumnClick); - this.lvWhenToWatch.SelectedIndexChanged += new System.EventHandler(this.lvWhenToWatch_Click); - this.lvWhenToWatch.DoubleClick += new System.EventHandler(this.lvWhenToWatch_DoubleClick); - this.lvWhenToWatch.MouseClick += new System.Windows.Forms.MouseEventHandler(this.lvWhenToWatch_MouseClick); - // - // columnHeader29 - // - this.columnHeader29.Text = "Show"; - this.columnHeader29.Width = 187; - // - // columnHeader30 - // - this.columnHeader30.Text = "Season"; - this.columnHeader30.Width = 51; - // - // columnHeader31 - // - this.columnHeader31.Text = "Episode"; - this.columnHeader31.Width = 55; - // - // columnHeader32 - // - this.columnHeader32.Text = "Air Date"; - this.columnHeader32.Width = 81; - // - // columnHeader36 - // - this.columnHeader36.Text = "Time"; - // - // columnHeader33 - // - this.columnHeader33.Text = "Day"; - this.columnHeader33.Width = 42; - // - // columnHeader34 - // - this.columnHeader34.Text = "How Long"; - this.columnHeader34.Width = 69; - // - // columnHeader35 - // - this.columnHeader35.Text = "Episode Name"; - this.columnHeader35.Width = 360; + this.logToolStripMenuItem.Name = "logToolStripMenuItem"; + this.logToolStripMenuItem.Size = new System.Drawing.Size(196, 22); + this.logToolStripMenuItem.Text = "Log"; + this.logToolStripMenuItem.Click += new System.EventHandler(this.logToolStripMenuItem_Click); // // UI // @@ -1598,7 +1607,6 @@ public void InitializeComponent() private System.Windows.Forms.ColumnHeader columnHeader53; private System.Windows.Forms.ColumnHeader columnHeader54; private System.Windows.Forms.ColumnHeader columnHeader55; - private System.Windows.Forms.ColumnHeader columnHeader56; private System.Windows.Forms.ToolStripSeparator toolStripSeparator3; private System.Windows.Forms.ToolStripMenuItem folderMonitorToolStripMenuItem; @@ -1724,5 +1732,7 @@ public void InitializeComponent() private ToolStripSeparator toolStripSeparator0; private ToolStripMenuItem aeCollToolStripMenuItem; private ToolStripSeparator toolStripSeparator8; + private ToolStripSeparator toolStripSeparator9; + private ToolStripMenuItem logToolStripMenuItem; } } diff --git a/TVRename/Forms/UI.cs b/TVRename/Forms/UI.cs index ab5c43138..82b6b5fe2 100644 --- a/TVRename/Forms/UI.cs +++ b/TVRename/Forms/UI.cs @@ -3708,5 +3708,11 @@ private void aeCollToolStripMenuItem_Click(object sender, EventArgs e) BuildCollectionsMenu(); } } + + private void logToolStripMenuItem_Click(object sender, EventArgs e) + { + LogViewer form = new LogViewer(); + form.Show(); + } } } diff --git a/TVRename/Forms/UI.resx b/TVRename/Forms/UI.resx index b4bfa1d05..6d684dc62 100644 --- a/TVRename/Forms/UI.resx +++ b/TVRename/Forms/UI.resx @@ -141,7 +141,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADk - HQAAAk1TRnQBSQFMAgEBEwEAARABBAEQAQQBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + HQAAAk1TRnQBSQFMAgEBEwEAARgBBAEYAQQBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAAVADAAEBAQABCAYAARQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -286,7 +286,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC0 - HQAAAk1TRnQBSQFMAgEBCwEAASwBBAEsAQQBEgEAAQ0BAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFI + HQAAAk1TRnQBSQFMAgEBCwEAATQBBAE0AQQBEgEAAQ0BAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFI AwABJwMAAQEBAAEYBQAB6AEgGAAD7wMSBjADCQYwAw8DKgMwAxsD0Q8AASEB1gEIASEB1gEIASEB1gEI ASEB1gEIMAAC+AH3AfMB6AHaAfEB0wG2AeEBswGMAdYBnAFxAdIBlAFoAdIBlAFnAdQBmgFvAd8BrQGG AfAB0QGzAfMB5gHVAfcB9gH1RQAD7wM8A58D5gMwA+ADzgNPA9gDtwOPA9EMAAEhAdYBCAEhAdYBCAEh diff --git a/TVRename/Forms/Utilities/LogViewer.Designer.cs b/TVRename/Forms/Utilities/LogViewer.Designer.cs index 0fe95751c..7401b6965 100644 --- a/TVRename/Forms/Utilities/LogViewer.Designer.cs +++ b/TVRename/Forms/Utilities/LogViewer.Designer.cs @@ -29,23 +29,38 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { this.logData = new System.Windows.Forms.RichTextBox(); + this.btnFullLog = new System.Windows.Forms.Button(); this.SuspendLayout(); // // logData // - this.logData.Dock = System.Windows.Forms.DockStyle.Fill; + this.logData.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.logData.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.logData.Location = new System.Drawing.Point(0, 0); + this.logData.Location = new System.Drawing.Point(0, 3); this.logData.Name = "logData"; - this.logData.Size = new System.Drawing.Size(800, 450); + this.logData.Size = new System.Drawing.Size(800, 409); this.logData.TabIndex = 0; this.logData.Text = ""; // - // frmLogging + // btnFullLog + // + this.btnFullLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnFullLog.Location = new System.Drawing.Point(695, 418); + this.btnFullLog.Name = "btnFullLog"; + this.btnFullLog.Size = new System.Drawing.Size(93, 23); + this.btnFullLog.TabIndex = 1; + this.btnFullLog.Text = "View Full Log"; + this.btnFullLog.UseVisualStyleBackColor = true; + this.btnFullLog.Click += new System.EventHandler(this.btnFullLog_Click); + // + // LogViewer // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.btnFullLog); this.Controls.Add(this.logData); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; this.MinimizeBox = false; @@ -61,5 +76,6 @@ private void InitializeComponent() #endregion private System.Windows.Forms.RichTextBox logData; + private System.Windows.Forms.Button btnFullLog; } } diff --git a/TVRename/Forms/Utilities/LogViewer.cs b/TVRename/Forms/Utilities/LogViewer.cs index 0ebe9e3bb..38d16c370 100644 --- a/TVRename/Forms/Utilities/LogViewer.cs +++ b/TVRename/Forms/Utilities/LogViewer.cs @@ -2,6 +2,8 @@ using System.Windows.Forms; using NLog; using NLog.Config; +using NLog.Layouts; +using NLog.Targets; using NLog.Windows.Forms; namespace TVRename @@ -36,5 +38,11 @@ private void Form1_Load(object sender, EventArgs e) LogManager.ReconfigExistingLoggers(); } + + private void btnFullLog_Click(object sender, EventArgs e) + { + FileTarget target = (FileTarget)LogManager.Configuration.FindTargetByName("logfile"); + System.Diagnostics.Process.Start(((SimpleLayout)target.FileName).FixedText); + } } } diff --git a/TVRename/ItemsAndActions/ActionCopyMoveRename.cs b/TVRename/ItemsAndActions/ActionCopyMoveRename.cs index c50f15e43..812712347 100644 --- a/TVRename/ItemsAndActions/ActionCopyMoveRename.cs +++ b/TVRename/ItemsAndActions/ActionCopyMoveRename.cs @@ -237,9 +237,8 @@ private long SourceFileSize() } } - protected override string FileInfo1 => From.DirectoryName; - protected override string FileInfo2 => From.Name; - protected override string FileInfo3 => To.DirectoryName; - protected override string FileInfo4 => To.Name; + protected override string DestinationFolder => To.DirectoryName; + protected override string DestinationFile => To.Name; + protected override string SourceDetails => From.FullName; } } diff --git a/TVRename/ItemsAndActions/ActionDateTouch.cs b/TVRename/ItemsAndActions/ActionDateTouch.cs index c7e72eca3..113fb7d9c 100644 --- a/TVRename/ItemsAndActions/ActionDateTouch.cs +++ b/TVRename/ItemsAndActions/ActionDateTouch.cs @@ -8,7 +8,6 @@ namespace TVRename { using System; - using System.Windows.Forms; using DirectoryInfo = Alphaleonis.Win32.Filesystem.DirectoryInfo; using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; @@ -107,50 +106,16 @@ public override int Compare(Item o) public override IgnoreItem Ignore => whereFile == null ? null : new IgnoreItem(whereFile.FullName); - public override ListViewItem ScanListViewItem - { - get - { - ListViewItem lvi = new ListViewItem(); - - if (Episode != null) - { - lvi.Text = Episode.Show.ShowName; - lvi.SubItems.Add(Episode.AppropriateSeasonNumber.ToString()); - lvi.SubItems.Add(Episode.NumsAsString()); - - } - else if (season != null) - { - lvi.Text = season.TheSeries.Name; - lvi.SubItems.Add(season.SeasonNumber.ToString()); - lvi.SubItems.Add(""); - - } - else if (show != null) - { - lvi.Text = show.ShowName; - lvi.SubItems.Add(""); - lvi.SubItems.Add(""); - } - - DateTime dt = updateTime; - - lvi.SubItems.Add((dt.CompareTo(DateTime.MaxValue)) != 0 ? dt.ToShortDateString() : ""); - - lvi.SubItems.Add(whereFile?.DirectoryName??whereDirectory?.FullName); - lvi.SubItems.Add(whereFile?.Name??whereDirectory?.Name); - - lvi.Tag = this; - - return lvi; - } - } - + protected override string SeriesName => (Episode != null) ? Episode.Show.ShowName : + (season != null) ? season.TheSeries.Name : show.ShowName; + protected override string SeasonNumber => (Episode != null) ? Episode.AppropriateSeasonNumber.ToString() : + (season != null) ? season.SeasonNumber.ToString() : string.Empty; + protected override string AirDate => + (updateTime.CompareTo(DateTime.MaxValue)) != 0 ? updateTime.ToShortDateString() : ""; + protected override string DestinationFolder => whereFile?.DirectoryName ?? whereDirectory?.FullName; + protected override string DestinationFile => whereFile?.Name ?? whereDirectory?.Name; public override string TargetFolder => whereFile?.DirectoryName??whereDirectory?.Name; - public override string ScanListViewGroup => "lvgUpdateFileDates"; - public override int IconNumber => 7; #endregion diff --git a/TVRename/ItemsAndActions/ActionDelete.cs b/TVRename/ItemsAndActions/ActionDelete.cs index 6d124b73b..ac0513d1c 100644 --- a/TVRename/ItemsAndActions/ActionDelete.cs +++ b/TVRename/ItemsAndActions/ActionDelete.cs @@ -12,10 +12,9 @@ public abstract class ActionDelete : ActionFileOperation public override long SizeOfWork => 100; public override int IconNumber => 9; public override string ScanListViewGroup => "lvgActionDelete"; - protected override string FileInfo1 => TargetFolder; - protected override string FileInfo2 => ProgressText; - protected override string FileInfo3 => string.Empty; - protected override string FileInfo4 => string.Empty; + + protected override string DestinationFolder => TargetFolder; + protected override string DestinationFile => ProgressText; } public class ActionDeleteFile : ActionDelete { @@ -28,7 +27,7 @@ public ActionDeleteFile(FileInfo remove, ProcessedEpisode ep, TidySettings tidyu Episode = ep; toRemove = remove; } - + public override string ProgressText => toRemove.Name; public override string Produces => toRemove.FullName; public override IgnoreItem Ignore => toRemove == null ? null : new IgnoreItem(toRemove.FullName); diff --git a/TVRename/ItemsAndActions/ActionDownloadImage.cs b/TVRename/ItemsAndActions/ActionDownloadImage.cs index cb2e0a29f..1893588cf 100644 --- a/TVRename/ItemsAndActions/ActionDownloadImage.cs +++ b/TVRename/ItemsAndActions/ActionDownloadImage.cs @@ -13,7 +13,6 @@ namespace TVRename { using System; - using System.Windows.Forms; using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; using System.IO; @@ -167,44 +166,16 @@ public override int Compare(Item o) public override int IconNumber => 5; public override IgnoreItem Ignore => GenerateIgnore(Destination?.FullName); - - public override ListViewItem ScanListViewItem - { - get - { - ListViewItem lvi = new ListViewItem { - Text = (Episode != null) ? Episode.Show.ShowName : ((SI != null) ? SI.ShowName : "") - }; - - lvi.SubItems.Add(Episode?.AppropriateSeasonNumber.ToString() ?? ""); - lvi.SubItems.Add(Episode?.NumsAsString() ?? ""); - lvi.SubItems.Add(Episode != null ? Episode.GetAirDateDT(true).PrettyPrint() : ""); - lvi.SubItems.Add(Destination.DirectoryName); - lvi.SubItems.Add(Path); - - if (string.IsNullOrEmpty(Path)) - lvi.BackColor = Helpers.WarningColor(); - lvi.SubItems.Add(Destination.Name); - - lvi.Tag = this; - - return lvi; - } - } + protected override string SeriesName => + (Episode != null) ? Episode.Show.ShowName : ((SI != null) ? SI.ShowName : ""); + protected override string DestinationFolder => TargetFolder; + protected override string DestinationFile => Destination.Name; + protected override string SourceDetails => Path; + protected override bool InError => string.IsNullOrEmpty(Path); public override string ScanListViewGroup => "lvgActionDownload"; - - public override string TargetFolder - { - get - { - if (Destination == null) - return null; - return Destination.DirectoryName; - } - } - + public override string TargetFolder => Destination == null ? null : Destination.DirectoryName; #endregion } } diff --git a/TVRename/ItemsAndActions/ActionItem.cs b/TVRename/ItemsAndActions/ActionItem.cs index 75e1f278f..32fddb58f 100644 --- a/TVRename/ItemsAndActions/ActionItem.cs +++ b/TVRename/ItemsAndActions/ActionItem.cs @@ -19,7 +19,6 @@ namespace TVRename public abstract class Item // something shown in the list on the Scan tab (not always an Action) { - public abstract ListViewItem ScanListViewItem { get; } // to add to Scan ListView public abstract string TargetFolder { get; } // return a list of folders for right-click menu public abstract string ScanListViewGroup { get; } // which group name for the listview public abstract int IconNumber { get; } // which icon number to use in "ilIcons" (UI.cs). -1 for none @@ -32,6 +31,37 @@ protected static IgnoreItem GenerateIgnore(string file) { return string.IsNullOrEmpty(file) ? null : new IgnoreItem(file); } + + public ListViewItem ScanListViewItem // to add to Scan ListView + { + get + { + ListViewItem lvi = new ListViewItem {Text = SeriesName}; + + lvi.SubItems.Add(SeasonNumber); + lvi.SubItems.Add(EpisodeNumber); + lvi.SubItems.Add(AirDate); + lvi.SubItems.Add(DestinationFolder); + lvi.SubItems.Add(DestinationFile); + lvi.SubItems.Add(SourceDetails); + + if (InError) + lvi.BackColor = Helpers.WarningColor(); + + lvi.Tag = this; + + return lvi; + } + } + + protected virtual string SeriesName => Episode?.TheSeries?.Name ?? string.Empty; + protected virtual string SeasonNumber => Episode?.AppropriateSeasonNumber.ToString() ?? string.Empty; + protected virtual string EpisodeNumber => Episode?.NumsAsString() ?? string.Empty; + protected virtual string AirDate => Episode?.GetAirDateDT(true).PrettyPrint() ?? string.Empty; + protected abstract string DestinationFolder { get; } + protected abstract string DestinationFile { get; } + protected virtual string SourceDetails => string.Empty; + protected virtual bool InError => false; } public abstract class Action : Item // Something we can do @@ -189,42 +219,6 @@ protected void DoTidyup(DirectoryInfo di) DeleteOrRecycleFolder(di); } - - public override ListViewItem ScanListViewItem - { - get - { - ListViewItem lvi = new ListViewItem(); - - if (Episode == null) - { - lvi.Text = ""; - lvi.SubItems.Add(""); - lvi.SubItems.Add(""); - lvi.SubItems.Add(""); - lvi.SubItems.Add(""); - } - else - { - lvi.Text = Episode.TheSeries.Name; - lvi.SubItems.Add(Episode.AppropriateSeasonNumber.ToString()); - lvi.SubItems.Add(Episode.NumsAsString()); - lvi.SubItems.Add(Episode.GetAirDateDT(true).PrettyPrint()); - } - - lvi.SubItems.Add(FileInfo1); - lvi.SubItems.Add(FileInfo2); - lvi.SubItems.Add(FileInfo3); - lvi.SubItems.Add(FileInfo4); - - return lvi; - } - } - - protected abstract string FileInfo1 { get; } - protected abstract string FileInfo2 { get; } - protected abstract string FileInfo3 { get; } - protected abstract string FileInfo4 { get; } } public abstract class ActionWriteMetadata : ActionDownload @@ -252,38 +246,12 @@ protected ActionWriteMetadata(FileInfo where, ShowItem sI) public override int IconNumber => 7; - public override ListViewItem ScanListViewItem - { - get - { - ListViewItem lvi = new ListViewItem(); - - if (Episode != null) - { - lvi.Text = Episode.Show.ShowName; - lvi.SubItems.Add(Episode.AppropriateSeasonNumber.ToString()); - lvi.SubItems.Add(Episode.NumsAsString()); - lvi.SubItems.Add(Episode.GetAirDateDT(true).PrettyPrint()); - } - else - { - lvi.Text = SelectedShow.ShowName; - lvi.SubItems.Add(""); - lvi.SubItems.Add(""); - lvi.SubItems.Add(""); - } - - lvi.SubItems.Add(Where.DirectoryName); - lvi.SubItems.Add(Where.Name); - - lvi.Tag = this; - - return lvi; - } - } + protected override string SeriesName => Episode?.Show?.ShowName ?? SelectedShow.ShowName; + protected override string DestinationFolder => Where.DirectoryName; + protected override string DestinationFile => Where.Name; } - public class ItemList : System.Collections.Generic.List + public class ItemList : List { public void Add(ItemList slil) { @@ -299,7 +267,7 @@ public void Add(ItemList slil) public class ActionQueue { - public readonly System.Collections.Generic.List Actions; // The contents of this queue + public readonly List Actions; // The contents of this queue public readonly int ParallelLimit; // Number of tasks in the queue than can be run at once public readonly string Name; // Name of this queue public int ActionPosition; // Position in the queue list of the next item to process @@ -308,7 +276,7 @@ public ActionQueue(string name, int parallelLimit) { Name = name; ParallelLimit = parallelLimit; - Actions = new System.Collections.Generic.List(); + Actions = new List(); ActionPosition = 0; } } diff --git a/TVRename/ItemsAndActions/ActionItemSorter.cs b/TVRename/ItemsAndActions/ActionItemSorter.cs index 21ce9bb56..c851afa50 100644 --- a/TVRename/ItemsAndActions/ActionItemSorter.cs +++ b/TVRename/ItemsAndActions/ActionItemSorter.cs @@ -11,8 +11,10 @@ public class ActionItemSorter : System.Collections.Generic.IComparer { #region IComparer Members - public virtual int Compare(Item x, Item y) + public int Compare(Item x, Item y) { + if (x is null) return -1; + if (y is null) return 1; return (x.GetType() == y.GetType()) ? x.Compare(y) : (TypeNumber(x) - TypeNumber(y)); } diff --git a/TVRename/ItemsAndActions/ActionMede8erViewXML.cs b/TVRename/ItemsAndActions/ActionMede8erViewXML.cs index 80683252a..06494b8c3 100644 --- a/TVRename/ItemsAndActions/ActionMede8erViewXML.cs +++ b/TVRename/ItemsAndActions/ActionMede8erViewXML.cs @@ -10,7 +10,6 @@ namespace TVRename { using System; using Alphaleonis.Win32.Filesystem; - using System.Windows.Forms; using System.Xml; public class ActionMede8erViewXML : ActionWriteMetadata @@ -82,23 +81,10 @@ public override int Compare(Item o) #region Item Members - public override ListViewItem ScanListViewItem - { - get - { - ListViewItem lvi = new ListViewItem {Text = SelectedShow.ShowName}; - - lvi.SubItems.Add(snum > 0 ? snum.ToString() : ""); - lvi.SubItems.Add(""); - lvi.SubItems.Add(""); - lvi.SubItems.Add(Where.DirectoryName); - lvi.SubItems.Add(Where.Name); - - lvi.Tag = this; - - return lvi; - } - } + protected override string SeriesName => SelectedShow.ShowName; + protected override string SeasonNumber => snum > 0 ? snum.ToString() : ""; + protected override string EpisodeNumber => string.Empty; + protected override string AirDate => string.Empty; #endregion } diff --git a/TVRename/ItemsAndActions/ActionNFO.cs b/TVRename/ItemsAndActions/ActionNFO.cs index dcd5ea4ce..7474374ab 100644 --- a/TVRename/ItemsAndActions/ActionNFO.cs +++ b/TVRename/ItemsAndActions/ActionNFO.cs @@ -179,7 +179,7 @@ public override bool Go(ref bool pause, TVRenameStats stats) XmlHelper.WriteElementToXml(writer, "title", SelectedShow.ShowName); XmlHelper.WriteElementToXml(writer, "episodeguideurl", - TheTVDB.BuildUrl(SelectedShow.TvdbCode, TVSettings.Instance.PreferredLanguage)); + TheTVDB.BuildUrl(SelectedShow.TvdbCode,SelectedShow.UseCustomLanguage? SelectedShow.PreferredLanguage.Abbreviation:TVSettings.Instance.PreferredLanguageCode)); XmlHelper.WriteElementToXml(writer, "plot", SelectedShow.TheSeries().GetOverview()); diff --git a/TVRename/ItemsAndActions/ActionPyTivoMeta.cs b/TVRename/ItemsAndActions/ActionPyTivoMeta.cs index 935949044..0065ac968 100644 --- a/TVRename/ItemsAndActions/ActionPyTivoMeta.cs +++ b/TVRename/ItemsAndActions/ActionPyTivoMeta.cs @@ -8,7 +8,6 @@ namespace TVRename { using System; - using System.Windows.Forms; using System.IO; using Directory = Alphaleonis.Win32.Filesystem.Directory; using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; diff --git a/TVRename/ItemsAndActions/ActionRSS.cs b/TVRename/ItemsAndActions/ActionRSS.cs index d1ca4b40c..15490bc4a 100644 --- a/TVRename/ItemsAndActions/ActionRSS.cs +++ b/TVRename/ItemsAndActions/ActionRSS.cs @@ -1,4 +1,3 @@ -// public override IgnoreItem Ignore // Main website for TVRename is http://tvrename.com // // Source code available at https://github.com/TV-Rename/tvrename @@ -9,13 +8,12 @@ namespace TVRename { using System; using Alphaleonis.Win32.Filesystem; - using System.Windows.Forms; // ReSharper disable once InconsistentNaming public class ActionRSS : ActionDownload { // ReSharper disable once InconsistentNaming - public RSSItem RSS; + public readonly RSSItem RSS; private readonly string theFileNoExt; public ActionRSS(RSSItem rss, string toWhereNoExt, ProcessedEpisode pe) @@ -104,35 +102,15 @@ public override int Compare(Item o) public override IgnoreItem Ignore => GenerateIgnore(theFileNoExt); - public override ListViewItem ScanListViewItem - { - get - { - ListViewItem lvi = new ListViewItem {Text = Episode.Show.ShowName}; - - lvi.SubItems.Add(Episode.AppropriateSeasonNumber.ToString()); - lvi.SubItems.Add(Episode.NumsAsString()); - lvi.SubItems.Add(Episode.GetAirDateDT(true).PrettyPrint()); - lvi.SubItems.Add(theFileNoExt); - lvi.SubItems.Add(RSS.Title); + protected override string DestinationFolder => TargetFolder; + protected override string DestinationFile => TargetFilename; + protected override string SourceDetails => RSS.Title; - lvi.Tag = this; - - return lvi; - } - } + public override string TargetFolder => string.IsNullOrEmpty(theFileNoExt) ? null : new FileInfo(theFileNoExt).DirectoryName; - public override string TargetFolder - { - get - { - if (string.IsNullOrEmpty(theFileNoExt)) - return null; - return new FileInfo(theFileNoExt).DirectoryName; - } - } + private string TargetFilename => string.IsNullOrEmpty(theFileNoExt) ? null : new FileInfo(theFileNoExt).Name; -public override string ScanListViewGroup => "lvgActionDownloadRSS"; + public override string ScanListViewGroup => "lvgActionDownloadRSS"; public override int IconNumber => 6; diff --git a/TVRename/ItemsAndActions/ItemDownloading.cs b/TVRename/ItemsAndActions/ItemDownloading.cs index 2b4d046d9..913c6bc90 100644 --- a/TVRename/ItemsAndActions/ItemDownloading.cs +++ b/TVRename/ItemsAndActions/ItemDownloading.cs @@ -8,55 +8,34 @@ using Alphaleonis.Win32.Filesystem; using System; -using System.Windows.Forms; namespace TVRename { public class ItemDownloading : Item { - public DownloadInformation Entry; - public string DesiredLocationNoExt; - - - public ItemDownloading(DownloadInformation dl, ProcessedEpisode pe, string desiredLocationNoExt, TVRename.Finder.DownloadApp tApp) - { - Episode = pe; - DesiredLocationNoExt = desiredLocationNoExt; - Entry = dl; - IconNumber = (tApp == TVRename.Finder.DownloadApp.uTorrent) ? 2 : - (tApp == TVRename.Finder.DownloadApp.SABnzbd) ? 8 : - (tApp == TVRename.Finder.DownloadApp.qBitTorrent) ? 10 : 0; - } + private readonly IDownloadInformation Entry; + public readonly string DesiredLocationNoExt; public override IgnoreItem Ignore => GenerateIgnore(DesiredLocationNoExt); - public override string ScanListViewGroup => "lvgDownloading"; - public override ListViewItem ScanListViewItem - { - get - { - ListViewItem lvi = new ListViewItem { Text = Episode.Show.ShowName }; - lvi.SubItems.Add(Episode.AppropriateSeasonNumber.ToString()); - lvi.SubItems.Add(Episode.NumsAsString()); - lvi.SubItems.Add(Episode.GetAirDateDT(true).PrettyPrint()); - lvi.SubItems.Add(FileIdentifier); - lvi.SubItems.Add(Destination); - lvi.SubItems.Add(Remaining); - lvi.Tag = this; - return lvi; - } - } + protected override string DestinationFolder => FileIdentifier; + protected override string DestinationFile => Destination; + protected override string SourceDetails => Remaining; + private string FileIdentifier => Entry.FileIdentifier; + private string Destination => Entry.Destination; + private string Remaining => Entry.RemainingText; + public override int IconNumber { get; } + public override string TargetFolder => string.IsNullOrEmpty(Destination) ? null : new FileInfo(Destination).DirectoryName; - public override string TargetFolder + public ItemDownloading(IDownloadInformation dl, ProcessedEpisode pe, string desiredLocationNoExt, Finder.DownloadApp tApp) { - get - { - if (string.IsNullOrEmpty(Destination)) - return null; - - return new FileInfo(Destination).DirectoryName; - } + Episode = pe; + DesiredLocationNoExt = desiredLocationNoExt; + Entry = dl; + IconNumber = (tApp == Finder.DownloadApp.uTorrent) ? 2 : + (tApp == Finder.DownloadApp.SABnzbd) ? 8 : + (tApp == Finder.DownloadApp.qBitTorrent) ? 10 : 0; } #region Item Members @@ -78,13 +57,5 @@ public override int Compare(Item o) return string.Compare((DesiredLocationNoExt), ut.DesiredLocationNoExt, StringComparison.Ordinal); } #endregion - - #region Item Members - public override int IconNumber { get; } - #endregion - - protected string FileIdentifier => Entry.FileIdentifier; - protected string Destination => Entry.Destination; - protected string Remaining => Entry.RemainingText; } } diff --git a/TVRename/ItemsAndActions/ItemMissing.cs b/TVRename/ItemsAndActions/ItemMissing.cs index 0890a0ae6..50912d6ca 100644 --- a/TVRename/ItemsAndActions/ItemMissing.cs +++ b/TVRename/ItemsAndActions/ItemMissing.cs @@ -9,7 +9,6 @@ namespace TVRename { using System; using Alphaleonis.Win32.Filesystem; - using System.Windows.Forms; public class ItemMissing : Item { @@ -34,9 +33,8 @@ public override bool SameAs(Item o) public override int Compare(Item o) { - ItemMissing miss = o as ItemMissing; //return (o == null || miss == null) ? 0 : (this.TheFileNoExt + this.Episode.Name).CompareTo(miss.TheFileNoExt + miss.Episode.Name); - if (o == null || miss == null) + if (o == null || !(o is ItemMissing miss)) { return 0; } @@ -60,32 +58,11 @@ public override int Compare(Item o) public override IgnoreItem Ignore => GenerateIgnore(TheFileNoExt); - public override ListViewItem ScanListViewItem - { - get - { - ListViewItem lvi = new ListViewItem {Text = Episode.Show.ShowName}; - lvi.SubItems.Add(Episode.AppropriateSeasonNumber.ToString()); - lvi.SubItems.Add(Episode.NumsAsString()); - lvi.SubItems.Add(Episode.GetAirDateDT(true).PrettyPrint()); - lvi.SubItems.Add(folder); - lvi.SubItems.Add(Filename); - lvi.Tag = this; - return lvi; - } - } - + protected override string DestinationFolder => folder; + protected override string DestinationFile => Filename; public override string ScanListViewGroup => "lvgActionMissing"; - public override string TargetFolder - { - get - { - if (string.IsNullOrEmpty(TheFileNoExt)) - return null; - return new FileInfo(TheFileNoExt).DirectoryName; - } - } + public override string TargetFolder => string.IsNullOrEmpty(TheFileNoExt) ? null : new FileInfo(TheFileNoExt).DirectoryName; public override int IconNumber => 1; diff --git a/TVRename/Settings/CustomSeasonName.cs b/TVRename/Settings/CustomSeasonName.cs index af1f46847..93e7888f3 100644 --- a/TVRename/Settings/CustomSeasonName.cs +++ b/TVRename/Settings/CustomSeasonName.cs @@ -52,6 +52,17 @@ public CustomSeasonName() "{EndYear}" }; + public List ExamplePresets(Season s) + { + List possibleExamples = new List(); + foreach (string example in Presets) + { + possibleExamples.Add(NameFor(s,example)); + } + + return possibleExamples; + } + public string NameFor(Season s) => NameFor(s, styleString); public static string NameFor(Season s, string styleString) => NameFor(s, styleString, false); diff --git a/TVRename/Settings/Languages.cs b/TVRename/Settings/Languages.cs new file mode 100644 index 000000000..a9e874eea --- /dev/null +++ b/TVRename/Settings/Languages.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.Xml; +using System.Xml.Serialization; +using Alphaleonis.Win32.Filesystem; + +namespace TVRename +{ + [Serializable] + [System.ComponentModel.DesignerCategoryAttribute("code")] + + [XmlRoot("Languages", Namespace = "")] + public class Languages : List + { + [XmlIgnoreAttribute] private static readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger(); + + public static Languages Load() + { + string fn = PathManager.LanguagesFile.FullName; + + return !File.Exists(fn) ? new Languages() : LoadFrom(fn); + } + + public void Save() + { + SaveToFile(PathManager.LanguagesFile.FullName); + } + + private static Languages LoadFrom(string filename) + { + if (!File.Exists(filename)) + return null; + + XmlReaderSettings settings = new XmlReaderSettings { IgnoreComments = true, IgnoreWhitespace = true }; + Languages sc; + + try + { + using (XmlReader reader = XmlReader.Create(filename, settings)) + { + XmlSerializer xs = new XmlSerializer(typeof(Languages)); + sc = (Languages)xs.Deserialize(reader); + System.Diagnostics.Debug.Assert(sc != null); + } + } + catch (Exception e) + { + logger.Fatal(e); + return new Languages(); + } + + return sc; + } + + private void SaveToFile(string toFile) + { + System.IO.DirectoryInfo di = new System.IO.FileInfo(toFile).Directory; + if (!di.Exists) + di.Create(); + + XmlWriterSettings settings = new XmlWriterSettings { Indent = true, NewLineOnAttributes = true }; + using (XmlWriter writer = XmlWriter.Create(toFile, settings)) + { + XmlSerializer xs = new XmlSerializer(typeof(Languages)); + xs.Serialize(writer, this); + } + } + + public Language GetLanguageFromCode(string languageAbbreviation) + { + foreach (Language l in this) + { + if (l.Abbreviation == languageAbbreviation) return l; + } + return null; + } + + public Language GetLanguageFromLocalName(string language) + { + foreach (Language l in this) + { + if (l.Name == language) return l; + } + return null; + } + + public Language GetLanguageFromId(int languageId) + { + foreach (Language l in this) + { + if (l.Id == languageId) return l; + } + return null; + } + } + + public class Language + { + public Language() { + } + + public Language(int id, string abbreviation, string name, string englishName) + { + Id = id; + Abbreviation = abbreviation; + Name = name; + EnglishName = englishName; + } + + public int Id { get; set; } + public string Abbreviation { get; set; } + public string Name { get; set; } + public string EnglishName { get; set; } + } +} diff --git a/TVRename/Settings/Searchers.cs b/TVRename/Settings/Searchers.cs index 3542f86ed..6f63409d2 100644 --- a/TVRename/Settings/Searchers.cs +++ b/TVRename/Settings/Searchers.cs @@ -16,14 +16,14 @@ namespace TVRename { public class Searchers { - public class Choice + private class Choice { public string Name; - public string URL2; + public string Url2; } public string CurrentSearch; - private readonly List Choices = new List(); + private readonly List choices = new List(); public Searchers() { @@ -38,7 +38,7 @@ public Searchers() public Searchers(XmlReader reader) { - Choices = new List(); + choices = new List(); CurrentSearch = ""; reader.Read(); @@ -73,7 +73,7 @@ public Searchers(XmlReader reader) public void SetToNumber(int n) { - CurrentSearch = Choices[n].Name; + CurrentSearch = choices[n].Name; } public int CurrentSearchNum() @@ -81,23 +81,24 @@ public int CurrentSearchNum() return NumForName(CurrentSearch); } - public int NumForName(string srch) + private int NumForName(string srch) { - for (int i = 0; i < Choices.Count; i++) + for (int i = 0; i < choices.Count; i++) { - if (Choices[i].Name == srch) + if (choices[i].Name == srch) return i; } return 0; } - public string CurrentSearchURL() + public string CurrentSearchUrl() { - if (Choices.Count == 0) + if (choices.Count == 0) return ""; - return Choices[CurrentSearchNum()].URL2; + return choices[CurrentSearchNum()].Url2; } - public void WriteXML(XmlWriter writer) + + public void WriteXml(XmlWriter writer) { writer.WriteStartElement("TheSearchers"); XmlHelper.WriteElementToXml(writer,"Current",CurrentSearch); @@ -105,44 +106,44 @@ public void WriteXML(XmlWriter writer) for (int i = 0; i < Count(); i++) { writer.WriteStartElement("Choice"); - XmlHelper.WriteAttributeToXml(writer,"Name",Choices[i].Name); - XmlHelper.WriteAttributeToXml(writer,"URL2",Choices[i].URL2); + XmlHelper.WriteAttributeToXml(writer,"Name",choices[i].Name); + XmlHelper.WriteAttributeToXml(writer,"URL2",choices[i].Url2); writer.WriteEndElement(); } writer.WriteEndElement(); // TheSearchers } public void Clear() { - Choices.Clear(); + choices.Clear(); } public void Add(string name, string url) { - Choices.Add(new Choice { Name = name, URL2 = url }); + choices.Add(new Choice { Name = name, Url2 = url }); } public int Count() { - return Choices.Count; + return choices.Count; } public string Name(int n) { - if (n >= Choices.Count) - n = Choices.Count - 1; + if (n >= choices.Count) + n = choices.Count - 1; else if (n < 0) n = 0; - return Choices[n].Name; + return choices[n].Name; } - public string URL(int n) + public string Url(int n) { - if (n >= Choices.Count) - n = Choices.Count - 1; + if (n >= choices.Count) + n = choices.Count - 1; else if (n < 0) n = 0; - return Choices[n].URL2; + return choices[n].Url2; } } } diff --git a/TVRename/Settings/Settings.cs b/TVRename/Settings/Settings.cs index 276666d6e..3dd5b853a 100644 --- a/TVRename/Settings/Settings.cs +++ b/TVRename/Settings/Settings.cs @@ -396,7 +396,7 @@ internal bool IncludeBetaUpdates() public string SABHostPort = ""; public string SABAPIKey = ""; public bool CheckSABnzbd = false; - public string PreferredLanguage = "en"; + public string PreferredLanguageCode = "en"; public WTWDoubleClickAction WTWDoubleClick; public readonly TidySettings Tidyup = new TidySettings(); @@ -534,7 +534,7 @@ public void load(XmlReader reader) else if (reader.Name == "SABHostPort") SABHostPort = reader.ReadElementContentAsString(); else if (reader.Name == "PreferredLanguage") - PreferredLanguage = reader.ReadElementContentAsString(); + PreferredLanguageCode = reader.ReadElementContentAsString(); else if (reader.Name == "WTWDoubleClick") WTWDoubleClick = (WTWDoubleClickAction)reader.ReadElementContentAsInt(); else if (reader.Name == "ExportMissingXML") @@ -890,7 +890,7 @@ private void SetToDefaults() public void WriteXML(XmlWriter writer) { writer.WriteStartElement("Settings"); - TheSearchers.WriteXML(writer); + TheSearchers.WriteXml(writer); XmlHelper.WriteElementToXml(writer,"BGDownload",BGDownload); XmlHelper.WriteElementToXml(writer,"OfflineMode",OfflineMode); XmlHelper.WriteElementToXml(writer,"ShowCollections", ShowCollections); @@ -987,7 +987,7 @@ public void WriteXML(XmlWriter writer) XmlHelper.WriteElementToXml(writer,"SABAPIKey",SABAPIKey); XmlHelper.WriteElementToXml(writer,"CheckSABnzbd",CheckSABnzbd); XmlHelper.WriteElementToXml(writer,"SABHostPort",SABHostPort); - XmlHelper.WriteElementToXml(writer,"PreferredLanguage",PreferredLanguage); + XmlHelper.WriteElementToXml(writer,"PreferredLanguage", PreferredLanguageCode); XmlHelper.WriteElementToXml(writer,"WTWDoubleClick",(int) WTWDoubleClick); XmlHelper.WriteElementToXml(writer,"EpJPGs",EpJPGs); XmlHelper.WriteElementToXml(writer,"SeriesJpg",SeriesJpg); @@ -1261,7 +1261,7 @@ public string BTSearchURL(ProcessedEpisode epi) string url = (epi.Show.UseCustomSearchUrl && !string.IsNullOrWhiteSpace(epi.Show.CustomSearchUrl)) ? epi.Show.CustomSearchUrl - : TheSearchers.CurrentSearchURL(); + : TheSearchers.CurrentSearchUrl(); return CustomEpisodeName.NameForNoExt(epi, url, true); } diff --git a/TVRename/Settings/ShowItem.cs b/TVRename/Settings/ShowItem.cs index 60d1b7c86..3502ff7a0 100644 --- a/TVRename/Settings/ShowItem.cs +++ b/TVRename/Settings/ShowItem.cs @@ -26,7 +26,6 @@ public class ShowItem public AutomaticFolderType AutoAddType; public bool CountSpecials; - public string CustomShowName; public bool DvdOrder; // sort by DVD order, not the default sort we get public bool DoMissingCheck; public bool DoRename; @@ -39,6 +38,9 @@ public class ShowItem public bool ShowNextAirdate; public int TvdbCode; public bool UseCustomShowName; + public string CustomShowName; + public bool UseCustomLanguage; + public string CustomLanguageCode; public bool UseSequentialMatch; public readonly List AliasNames = new List(); public bool UseCustomSearchUrl; @@ -118,6 +120,13 @@ public ShowItem(XmlReader reader) CustomShowName = reader.ReadElementContentAsString(); UseCustomShowName = true; } + if (reader.Name == "UseCustomLanguage") + UseCustomLanguage = reader.ReadElementContentAsBoolean(); + + if (reader.Name == "CustomLanguageCode") + { + CustomLanguageCode = reader.ReadElementContentAsString(); + } if (reader.Name == "UseCustomShowName") UseCustomShowName = reader.ReadElementContentAsBoolean(); @@ -141,7 +150,6 @@ public ShowItem(XmlReader reader) TEMP_AutoAdd_SeasonFolderName = reader.ReadElementContentAsString(); upgradeFromOldAutoAddFunction = true; } - else if (reader.Name == "PadSeasonToTwoDigits") { TEMP_PadSeasonToTwoDigits = reader.ReadElementContentAsBoolean(); @@ -428,12 +436,22 @@ private bool HasAiredEpisodes public string[] Genres => TheSeries()?.GetGenres(); + public Language PreferredLanguage + { + get + { + if (UseCustomLanguage) return TheTVDB.Instance.LanguageList.GetLanguageFromCode(CustomLanguageCode); + return TheTVDB.Instance.PreferredLanuage; + } + } + private void SetDefaults() { ManualFolderLocations = new Dictionary>(); IgnoreSeasons = new List(); UseCustomShowName = false; CustomShowName = ""; + UseCustomLanguage = false; UseSequentialMatch = false; SeasonRules = new Dictionary>(); SeasonEpisodes = new Dictionary>(); @@ -522,6 +540,8 @@ public void WriteXmlSettings(XmlWriter writer) XmlHelper.WriteElementToXml(writer,"UseCustomShowName",UseCustomShowName); XmlHelper.WriteElementToXml(writer,"CustomShowName",CustomShowName); + XmlHelper.WriteElementToXml(writer, "UseCustomLanguage", UseCustomLanguage); + XmlHelper.WriteElementToXml(writer, "CustomLanguageCode", CustomLanguageCode); XmlHelper.WriteElementToXml(writer,"ShowNextAirdate",ShowNextAirdate); XmlHelper.WriteElementToXml(writer,"TVDBID",TvdbCode); XmlHelper.WriteElementToXml(writer, "FolderBase", AutoAddFolderBase); diff --git a/TVRename/TVRename.csproj b/TVRename/TVRename.csproj index 8dfcb7e63..2c4bd4510 100644 --- a/TVRename/TVRename.csproj +++ b/TVRename/TVRename.csproj @@ -88,6 +88,9 @@ ..\packages\NLog.4.5.7\lib\net45\NLog.dll + + ..\packages\NLog.Windows.Forms.4.2.3\lib\net35\NLog.Windows.Forms.dll + ..\packages\NodaTime.2.0.2\lib\net45\NodaTime.dll @@ -157,6 +160,12 @@ UpdateNotification.cs + + Form + + + LogViewer.cs + @@ -209,10 +218,12 @@ + + @@ -494,6 +505,9 @@ TVRenameSplash.cs + + LogViewer.cs + ResXFileCodeGenerator Resources.Designer.cs diff --git a/TVRename/TVRename/ActionEngine.cs b/TVRename/TVRename/ActionEngine.cs index 98de50904..31578d1b1 100644 --- a/TVRename/TVRename/ActionEngine.cs +++ b/TVRename/TVRename/ActionEngine.cs @@ -69,7 +69,6 @@ public void ProcessSingleAction(object infoIn) catch (Exception e) { logger.Fatal(e, "Unhandled Exception in Process Single Action"); - return; } } @@ -97,10 +96,9 @@ public void DoActions(ItemList theList, bool showUI) { if (theList == null) { - logger.Info($"Asked to do actions, but none provided...."); + logger.Info("Asked to do actions, but none provided...."); return; } - logger.Info("**********************"); logger.Info($"Doing Selected Actions.... ({theList.Count} items detected, {theList.Actions().Count()} actions to be completed )"); @@ -125,7 +123,7 @@ public void DoActions(ItemList theList, bool showUI) if ((cmp != null) && (cmp.ShowDialog() == DialogResult.Cancel)) actionProcessorThread.Abort(); - + actionProcessorThread.Join(); theList.RemoveAll(x => (x is Action action) && action.Done && !action.Error); diff --git a/TVRename/TVRename/BullkAddManager.cs b/TVRename/TVRename/BullkAddManager.cs index ad8b62949..a51936e9e 100644 --- a/TVRename/TVRename/BullkAddManager.cs +++ b/TVRename/TVRename/BullkAddManager.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; +using System.Xml; using Alphaleonis.Win32.Filesystem; namespace TVRename @@ -26,14 +27,31 @@ public static void GuessShowItem(FoundFolder ai, ShowLibrary library) { string showName = GuessShowName(ai, library); - if (string.IsNullOrEmpty(showName)) + int tvdbId = FindShowCode(ai); + + if (string.IsNullOrEmpty(showName) && tvdbId == -1) return; TheTVDB.Instance.GetLock("GuessShowItem"); + if (tvdbId != -1) + { + TheTVDB.Instance.Unlock("GuessShowItem"); + SeriesInfo series = TheTVDB.Instance.GetSeriesAndDownload(tvdbId); + if (series != null) + { + ai.TVDBCode = tvdbId; + return; + } + } + SeriesInfo ser = TheTVDB.Instance.GetSeries(showName); if (ser != null) + { ai.TVDBCode = ser.TvdbCode; + TheTVDB.Instance.Unlock("GuessShowItem"); + return; + } //Try removing any year string showNameNoYear = Regex.Replace(showName, @"\(\d{4}\)", "").Trim(); @@ -44,11 +62,46 @@ public static void GuessShowItem(FoundFolder ai, ShowLibrary library) TheTVDB.Instance.Unlock("GuessShowItem"); } + private static int FindShowCode(FoundFolder ai) + { + List possibleFilenames = new List {"series.xml", "tvshow.nfo"}; + foreach (string fileName in possibleFilenames) + { + IEnumerable files = ai.Folder.EnumerateFiles(fileName).ToList(); + if (files.Any()) + { + foreach (FileInfo file in files) + { + int x = FindShowCode(file); + if (x != -1) return x; + } + } + } + //Can't find it + return -1; + } + + private static int FindShowCode(FileInfo file) + { + using (XmlReader reader = XmlReader.Create(file.OpenText())) + { + while (reader.Read()) + { + if ((reader.Name == "tvdbid") && reader.IsStartElement()) + { + int x = reader.ReadElementContentAsInt(); + if (x != -1) return x; + } + } + } + return -1; + } + private static string GuessShowName(FoundFolder ai, ShowLibrary library) { // see if we can guess a season number and show name, too // Assume is blah\blah\blah\show\season X - string showName = ai.Folder; + string showName = ai.Folder.FullName; foreach (string seasonWord in library.SeasonWords()) { @@ -84,7 +137,6 @@ private bool HasSeasonFolders(DirectoryInfo di, out DirectoryInfo[] subDirs, out { foreach (DirectoryInfo subDir in subDirs) { - //TODO - this could make use of the presets to see whether they match string regex = "^(?" + sw + "\\s*)(?\\d+)$"; Match m = Regex.Match(subDir.Name, regex, RegexOptions.IgnoreCase); if (!m.Success) continue; @@ -173,7 +225,7 @@ public bool CheckFolderForShows(DirectoryInfo di2, bool andGuess, out DirectoryI // ....its good! FoundFolder ai = - new FoundFolder(di2.FullName, hasSeasonFolders, folderFormat); + new FoundFolder(di2, hasSeasonFolders, folderFormat); AddItems.Add(ai); Logger.Info("Adding {0} as a new folder", theFolder); @@ -238,7 +290,7 @@ public void AddAllToMyShows() mDoc.Library.Add(found); } - found.AutoAddFolderBase = ai.Folder; + found.AutoAddFolderBase = ai.Folder.FullName; if (ai.HasSeasonFoldersGuess) { diff --git a/TVRename/TVRename/CacheUpdater.cs b/TVRename/TVRename/CacheUpdater.cs index fca538e49..08b4c74fe 100644 --- a/TVRename/TVRename/CacheUpdater.cs +++ b/TVRename/TVRename/CacheUpdater.cs @@ -22,7 +22,7 @@ public class CacheUpdater:IDisposable private Semaphore workerSemaphore; private List workers; private Thread mDownloaderThread; - private ICollection downloadIds; + private ICollection downloadIds; private static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger(); private static readonly NLog.Logger Threadslogger = NLog.LogManager.GetLogger("threads"); @@ -33,7 +33,7 @@ public CacheUpdater() downloadOk = true; } - public void StartBgDownloadThread(bool stopOnError, ICollection shows) + public void StartBgDownloadThread(bool stopOnError, ICollection shows) { if (!DownloadDone) return; @@ -47,7 +47,7 @@ public void StartBgDownloadThread(bool stopOnError, ICollection shows) mDownloaderThread.Start(); } - public bool DoDownloadsFg(bool showProgress, bool showErrorMsgBox, ICollection shows) + public bool DoDownloadsFg(bool showProgress, bool showErrorMsgBox, ICollection shows) { if (TVSettings.Instance.OfflineMode) return true; // don't do internet in offline mode! @@ -84,26 +84,11 @@ public bool DoDownloadsFg(bool showProgress, bool showErrorMsgBox, ICollection !CodeUnknown; public bool CodeUnknown => TVDBCode == -1; - public FoundFolder(string folder, bool seasonFolders, string folderFormat) + public FoundFolder(DirectoryInfo directory, bool seasonFolders, string folderFormat) { - Folder = folder; + Folder = directory; TVDBCode = -1; HasSeasonFoldersGuess = seasonFolders; SeasonFolderFormat = folderFormat; diff --git a/TVRename/TVRename/PathManager.cs b/TVRename/TVRename/PathManager.cs index 8a8154d68..d24a77312 100644 --- a/TVRename/TVRename/PathManager.cs +++ b/TVRename/TVRename/PathManager.cs @@ -10,6 +10,7 @@ public static class PathManager private const string SETTINGS_FILE_NAME = "TVRenameSettings.xml"; private const string UI_LAYOUT_FILE_NAME = "Layout.xml"; private const string STATISTICS_FILE_NAME = "Statistics.xml"; + private const string LANGUAGES_FILE_NAME = "Languages.xml"; private const string SHOWS_FILE_NAME = "TVRenameShows.xml"; private const string SHOWS_COLLECTION_FILE_NAME = "TVRenameColls.xml"; private const string SHOWS_DEFAULT_COLLECTION = "2.1"; @@ -150,6 +151,21 @@ public static FileInfo TVDocSettingsFile } } + public static FileInfo LanguagesFile + { + get + { + if (!string.IsNullOrEmpty(UserDefinedBasePath)) + { + return GetFileInfo(UserDefinedBasePath, LANGUAGES_FILE_NAME); + } + else + { + return GetFileInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "TVRename", "TVRename", (!string.IsNullOrEmpty(SHOWS_COLLECTION) ? "" : SHOWS_DEFAULT_COLLECTION)), LANGUAGES_FILE_NAME); + } + } + } + public static FileInfo TVDocShowsFile { get diff --git a/TVRename/TVRename/ShowLibrary.cs b/TVRename/TVRename/ShowLibrary.cs index f077214a3..2028e5e3f 100644 --- a/TVRename/TVRename/ShowLibrary.cs +++ b/TVRename/TVRename/ShowLibrary.cs @@ -15,6 +15,20 @@ public class ShowLibrary : ConcurrentDictionary private static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger(); public IEnumerable Shows => Values; + public ICollection SeriesSpecifiers + { + get + { + List value = new List(); + foreach (KeyValuePair series in this) + { + value.Add(new SeriesSpecifier(series.Key,series.Value.UseCustomLanguage,series.Value.CustomLanguageCode)); + } + + return value; + } + } + private IEnumerable GetSeasonWords() { //See https://github.com/TV-Rename/tvrename/issues/241 for background @@ -33,6 +47,18 @@ private IEnumerable GetSeasonWords() return results.Where(t => !string.IsNullOrWhiteSpace(t)).Distinct(); } + public IEnumerable GetSeasonPatterns() + { + List results = new List {TVSettings.Instance.SeasonFolderFormat}; + + IEnumerable seasonWordsFromShows = + from si in Values select si.AutoAddCustomFolderFormat; + + results.AddRange(seasonWordsFromShows.Distinct().ToList()); + + return results; + } + private IEnumerable seasonWordsCache; internal IEnumerable SeasonWords() @@ -502,7 +528,7 @@ public static string GetBestNameFor(List episodeNames, string defaultNam return root.Trim().TrimEnd(wordsToTrim).Trim().TrimEnd(charsToTrim).Trim(); } - public static void Renumber(List eis) + private static void Renumber(List eis) { if (eis.Count == 0) return; // nothing to do @@ -592,13 +618,16 @@ public List NextNShows(int nShows, int nDaysPast, int nDaysFut if ((airdt == null) || (airdt == DateTime.MaxValue)) continue; - DateTime dt = (DateTime) airdt; + DateTime dt = airdt.Value; - TimeSpan ts = dt.Subtract(notBefore); TimeSpan timeUntil = dt.Subtract(DateTime.Now); - if (((howClose == TimeSpan.MaxValue) || - (ts.CompareTo(howClose) <= 0) && (ts.TotalHours >= 0)) && (ts.TotalHours >= 0) && - (timeUntil.TotalDays <= nDaysFuture)) + if (timeUntil.TotalDays > nDaysFuture) continue; //episode is too far in the future + + TimeSpan ts = dt.Subtract(notBefore); + if (ts.TotalSeconds<0) continue; //episode is too far in the past + + //if we have a closer match + if (TimeSpan.Compare(ts,howClose)<0) { howClose = ts; nextAfterThat = ei; diff --git a/TVRename/TVRename/TVDoc.cs b/TVRename/TVRename/TVDoc.cs index a501c8a48..186ae555a 100644 --- a/TVRename/TVRename/TVDoc.cs +++ b/TVRename/TVRename/TVDoc.cs @@ -133,7 +133,7 @@ public void DoActions(ItemList theList) // ReSharper disable once InconsistentNaming public bool DoDownloadsFG() { - ICollection shows = Library.Keys; + ICollection shows = Library.SeriesSpecifiers; bool returnValue = cacheManager.DoDownloadsFg((!Args.Hide), (!Args.Unattended) && (!Args.Hide), shows); Library.GenDict(); return returnValue; @@ -142,7 +142,7 @@ public bool DoDownloadsFG() // ReSharper disable once InconsistentNaming public void DoDownloadsBG() { - ICollection shows = Library.Keys; + ICollection shows = Library.SeriesSpecifiers; cacheManager.StartBgDownloadThread(false, shows); } @@ -343,7 +343,10 @@ private void WriteXMLSettings(XmlWriter writer) } } + TheTVDB.Instance.LanguageList.Save(); + mDirty = false; + } private void WriteXMLShows(XmlWriter writer) @@ -561,6 +564,16 @@ private static bool ReadXMLSettings(XmlReaderSettings settings, string Err) bLoadOk = false; } } + + try + { + TheTVDB.Instance.LanguageList = Languages.Load(); + } + catch (Exception) + { + // not worried if language loading fails as we'll repopulate + } + } return bLoadOk; } @@ -1569,7 +1582,7 @@ private void RenameAndMissingCheck(SetProgressDelegate prog, ICollection> allFolders = si.AllFolderLocations(); if (allFolders.Count == 0) // no folders defined for this show @@ -1630,7 +1643,7 @@ private void RenameAndMissingCheck(ShowItem si, DirFilesCache dfc,bool fullscan) } // base folder: - if (!string.IsNullOrEmpty(si.AutoAddFolderBase) && (si.AutoAddType!= ShowItem.AutomaticFolderType.none)) + if (!string.IsNullOrEmpty(si.AutoAddFolderBase) && (si.AutoAddType != ShowItem.AutomaticFolderType.none)) { // main image for the folder itself TheActionList.Add(downloadIdentifiers.ProcessShow(si)); @@ -1689,14 +1702,14 @@ private void RenameAndMissingCheck(ShowItem si, DirFilesCache dfc,bool fullscan) ProcessedEpisode ep = eps[epIdx]; FileInfo actualFile = fi; - if (renCheck && TVSettings.Instance.FileHasUsefulExtension( fi, true, out string otherExtension)) // == RENAMING CHECK == + if (renCheck && TVSettings.Instance.FileHasUsefulExtension(fi, true, out string otherExtension)) // == RENAMING CHECK == { string newName = TVSettings.Instance.FilenameFriendly( TVSettings.Instance.NamingStyle.NameFor(ep, otherExtension, folder.Length)); if (TVSettings.Instance.RetainLanguageSpecificSubtitles && fi.IsLanguageSpecificSubtitle(out string subtitleExtension) && - actualFile.Name!= newName) + actualFile.Name != newName) { newName = TVSettings.Instance.FilenameFriendly( TVSettings.Instance.NamingStyle.NameFor(ep, subtitleExtension, @@ -1705,13 +1718,12 @@ private void RenameAndMissingCheck(ShowItem si, DirFilesCache dfc,bool fullscan) FileInfo newFile = FileHelper.FileInFolder(folder, newName); // rename updates the filename - if (newName != actualFile.Name) + if (newName != actualFile.Name) { //Check that the file does not already exist //if (FileHelper.FileExistsCaseSensitive(newFile.FullName)) - if (FileHelper.FileExistsCaseSensitive(files,newFile)) - - { + if (FileHelper.FileExistsCaseSensitive(files, newFile)) + { Logger.Warn($"Identified that {actualFile.FullName} should be renamed to {newName}, but it already exists."); } else @@ -1724,6 +1736,7 @@ private void RenameAndMissingCheck(ShowItem si, DirFilesCache dfc,bool fullscan) //one for that purpse downloadIdentifiers.NotifyComplete(newFile); + localEps[epNum] = newFile; } } } @@ -1732,7 +1745,8 @@ private void RenameAndMissingCheck(ShowItem si, DirFilesCache dfc,bool fullscan) ) // == MISSING CHECK part 1/2 == { // first pass of missing check is to tally up the episodes we do have - localEps[epNum] = actualFile; + if (localEps[epNum] is null) localEps[epNum] = actualFile; + if (epNum > maxEpNumFound) maxEpNumFound = epNum; } @@ -2153,7 +2167,7 @@ internal void ForceRefresh(List sis) { foreach (ShowItem si in sis) { - TheTVDB.Instance.ForgetShow(si.TvdbCode, true); + TheTVDB.Instance.ForgetShow(si.TvdbCode, true, si.UseCustomLanguage, si.CustomLanguageCode); } } diff --git a/TVRename/TheTVDB/Actor.cs b/TVRename/TheTVDB/Actor.cs index 1a59eae13..e104e996d 100644 --- a/TVRename/TheTVDB/Actor.cs +++ b/TVRename/TheTVDB/Actor.cs @@ -1,17 +1,12 @@ -// +// // Main website for TVRename is http://tvrename.com // // Source code available at https://github.com/TV-Rename/tvrename // // This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md // -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; + using System.Xml; -using System.Runtime.Serialization; -using NLog; namespace TVRename { @@ -35,7 +30,7 @@ public class Actor public Actor(string name) { - this.actorName = name; + actorName = name; } public Actor(int actorId, string actorImage, string actorName, string actorRole, int actorSeriesId, int actorSortOrder) { diff --git a/TVRename/TheTVDB/Banner.cs b/TVRename/TheTVDB/Banner.cs index bfb6cbad3..5a610c54d 100644 --- a/TVRename/TheTVDB/Banner.cs +++ b/TVRename/TheTVDB/Banner.cs @@ -26,7 +26,6 @@ public class Banner public int SeasonId; public int SeriesId; private string thumbnailPath; - private Season theSeason; private SeriesInfo theSeries; @@ -48,10 +47,7 @@ public Banner(Banner o) theSeries = o.theSeries; } - public Banner(SeriesInfo ser, Season seas) - { - SetDefaults(ser, seas); - } + public Banner(SeriesInfo ser, Season seas) => SetDefaults(ser, seas); public Banner(int seriesId, XmlReader r) { @@ -171,22 +167,14 @@ public Banner(int seriesId, JObject json, int langId) public bool IsSeasonPoster() => (bannerType == "season"); - public bool IsSeasonBanner() - { - return ((bannerType == "seasonwide") ); - } + public bool IsSeasonBanner() => (bannerType == "seasonwide" ); - public bool IsFanart() - { - return ((bannerType == "fanart") ); - } + public bool IsFanart() => (bannerType == "fanart"); private void SetDefaults(SeriesInfo ser, Season seas) { theSeason = seas; theSeries = ser; - - BannerId = -1; BannerPath = ""; bannerType = ""; @@ -198,7 +186,6 @@ private void SetDefaults(SeriesInfo ser, Season seas) SeriesId = -1; thumbnailPath = ""; - } public void SetSeriesSeason(SeriesInfo ser, Season seas) @@ -237,4 +224,3 @@ public void WriteXml(XmlWriter writer) } } } - diff --git a/TVRename/TheTVDB/Episode.cs b/TVRename/TheTVDB/Episode.cs index 88b1b3f90..6b5259e04 100644 --- a/TVRename/TheTVDB/Episode.cs +++ b/TVRename/TheTVDB/Episode.cs @@ -360,9 +360,9 @@ private void LoadJson(int seriesId, JObject r) else if (!int.TryParse(dvdEpNumString, out DvdEpNum)) DvdEpNum = 0; SrvLastUpdated = (long) r["lastUpdated"]; - Overview = System.Web.HttpUtility.HtmlDecode((string) r["overview"]); + Overview = System.Web.HttpUtility.HtmlDecode((string)r["overview"]); EpisodeRating = (string) r["siteRating"]; - Name = System.Web.HttpUtility.HtmlDecode((string) r["episodeName"]); + Name = System.Web.HttpUtility.HtmlDecode((string)r["episodeName"]); string sn = (string) r["airedSeason"]; if (sn == null) diff --git a/TVRename/TheTVDB/Season.cs b/TVRename/TheTVDB/Season.cs index 1c17cf29f..bde3bd4a1 100644 --- a/TVRename/TheTVDB/Season.cs +++ b/TVRename/TheTVDB/Season.cs @@ -20,7 +20,7 @@ public enum SeasonStatus noEpisodes, } - public System.Collections.Generic.Dictionary Episodes; + public Dictionary Episodes; public int SeasonId; public int SeasonNumber; public SeriesInfo TheSeries; @@ -43,7 +43,7 @@ public static string UISeasonWord(int season) else { bool leadingZero = TVSettings.Instance.LeadingZeroOnSeason; - if (leadingZero == true) + if (leadingZero) { return TVSettings.Instance.defaultSeasonWord + season.ToString("00"); } @@ -97,10 +97,10 @@ internal int MinYear() foreach (Episode e in Episodes.Values) { - if (e.GetAirDateDt().HasValue) - { - if (e.GetAirDateDt().Value.Year < min) min = e.GetAirDateDt().Value.Year; - } + DateTime? adt = e.GetAirDateDt(); + if (!adt.HasValue) continue; + DateTime airDateTime = adt.Value; + if (airDateTime.Year < min) min = airDateTime.Year; } return min; @@ -112,27 +112,27 @@ internal int MaxYear() foreach (Episode e in Episodes.Values) { - if (e.GetAirDateDt().HasValue) - { - if (e.GetAirDateDt().Value.Year > max) max = e.GetAirDateDt().Value.Year; - } + DateTime? adt = e.GetAirDateDt(); + if (!adt.HasValue) continue; + DateTime airDateTime = adt.Value; + if (airDateTime.Year > max) max = airDateTime.Year; } return max; } + private bool HasEpisodes => Episodes != null && Episodes.Count > 0; private bool HasUnairedEpisodes(TimeZone tz) { - if (HasEpisodes) + if (!HasEpisodes) return false; + + foreach (Episode e in Episodes.Values) { - foreach (Episode e in Episodes.Values) - { - if (e.GetAirDateDt(tz).HasValue) - { - if (e.GetAirDateDt(tz).Value > DateTime.Now) - return true; - } - } + DateTime? adt = e.GetAirDateDt(tz); + if (!adt.HasValue) continue; + DateTime airDateTime = adt.Value; + if (airDateTime > DateTime.Now) + return true; } return false; @@ -140,16 +140,15 @@ private bool HasUnairedEpisodes(TimeZone tz) private bool HasAiredEpisodes(TimeZone tz) { - if (HasEpisodes) + if (!HasEpisodes) return false; + + foreach (Episode e in Episodes.Values) { - foreach (Episode e in Episodes.Values) - { - if (e.GetAirDateDt(tz).HasValue) - { - if (e.GetAirDateDt(tz).Value < DateTime.Now) - return true; - } - } + DateTime? adt = e.GetAirDateDt(tz); + if (!adt.HasValue) continue; + DateTime airDateTime = adt.Value; + if (airDateTime < DateTime.Now) + return true; } return false; diff --git a/TVRename/TheTVDB/SeriesInfo.cs b/TVRename/TheTVDB/SeriesInfo.cs index e0f759902..d9aa017ec 100644 --- a/TVRename/TheTVDB/SeriesInfo.cs +++ b/TVRename/TheTVDB/SeriesInfo.cs @@ -19,8 +19,9 @@ public class SeriesInfo public DateTime? AirsTime; public bool Dirty; // set to true if local info is known to be older than whats on the server public DateTime? FirstAired; - public Dictionary Items; // e.g. Overview, Banner, Poster, etc. - private int languageId; + private Dictionary Items; // e.g. Overview, Banner, Poster, etc. + public string targetLanguageCode; //The Language Code we'd like the Series in ; null if we want to use the system setting + private int languageId; //The actual language obtained public string Name; public bool BannersLoaded; @@ -51,6 +52,8 @@ public class SeriesInfo public int TvdbCode; public string TempTimeZone; + public bool useCustomLanguage => targetLanguageCode != null; + public int MinYear() { int min = 9999; @@ -95,6 +98,14 @@ public SeriesInfo(string name, int id) TvdbCode = id; } + public SeriesInfo(string name, int id, string langCode) + { + SetToDefauts(); + targetLanguageCode = langCode; + Name = name; + TvdbCode = id; + } + public SeriesInfo(XmlReader r) { SetToDefauts(); @@ -107,7 +118,8 @@ public SeriesInfo(JObject json,int langId) languageId = langId; LoadJson(json); - if (string.IsNullOrEmpty(Name) ){ + if (string.IsNullOrEmpty(Name)) + { Logger.Warn("Issue with series " + TvdbCode ); Logger.Warn(json.ToString()); } @@ -441,7 +453,7 @@ private void LoadJson(JObject bestLanguageR, JObject backupLanguageR) } //Looking at the data then the aliases, banner and runtime are also different by language - + if ((string.IsNullOrWhiteSpace(Items["aliases"]))) { Items["aliases"] = JsonHelper.Flatten(backupLanguageR["aliases"], "|"); diff --git a/TVRename/TheTVDB/SeriesSpecifier.cs b/TVRename/TheTVDB/SeriesSpecifier.cs new file mode 100644 index 000000000..f4fcc8619 --- /dev/null +++ b/TVRename/TheTVDB/SeriesSpecifier.cs @@ -0,0 +1,16 @@ +namespace TVRename +{ + public class SeriesSpecifier + { + public readonly int seriesId; + public readonly bool useCustomLanguage; + public readonly string customLanguageCode; + + public SeriesSpecifier(int key, bool useCustomLanguage, string customLanguageCode) + { + this.seriesId = key; + this.useCustomLanguage = useCustomLanguage; + this.customLanguageCode = customLanguageCode; + } + } +} diff --git a/TVRename/TheTVDB/TVSource.cs b/TVRename/TheTVDB/TVSource.cs index 89b52431b..599c2b15f 100644 --- a/TVRename/TheTVDB/TVSource.cs +++ b/TVRename/TheTVDB/TVSource.cs @@ -10,7 +10,7 @@ public interface iTVSource bool Connect(); void SaveCache(); - bool EnsureUpdated(int code, bool bannersToo); + bool EnsureUpdated(int code, bool bannersToo, bool useCustomLangCode, string langCode); bool GetUpdates(); void UpdatesDoneOk(); @@ -21,7 +21,8 @@ public interface iTVSource void Tidy(ICollection libraryValues); void ForgetEverything(); - void ForgetShow(int id, bool makePlaceholder); + void ForgetShow(int id); + void ForgetShow(int id, bool makePlaceholder,bool useCustomLanguage,string langCode); } } diff --git a/TVRename/TheTVDB/TheTVDB.cs b/TVRename/TheTVDB/TheTVDB.cs index 9043b22d4..7dde5d086 100644 --- a/TVRename/TheTVDB/TheTVDB.cs +++ b/TVRename/TheTVDB/TheTVDB.cs @@ -8,7 +8,6 @@ using System; using System.Collections.Generic; -using System.Drawing.Drawing2D; using System.Net; using System.Text.RegularExpressions; using System.Threading; @@ -42,22 +41,6 @@ public TVDBException(string message) } } - public class Language - { - public Language(int id, string abbreviation, string name, string englishName) - { - Id = id; - Abbreviation = abbreviation; - Name = name; - EnglishName = englishName; - } - - public int Id { get; set; } - public string Abbreviation { get; set; } - public string Name { get; set; } - public string EnglishName { get; set; } - } - private static readonly string WebsiteRoot = "http://thetvdb.com"; private FileInfo cacheFile; @@ -69,7 +52,7 @@ public Language(int id, string abbreviation, string name, string englishName) private List removeEpisodeIds; // IDs of episodes that should be removed private List forceReloadOn; - public List LanguageList; + public Languages LanguageList; public string LastError; public string LoadErr; public bool LoadOk; @@ -81,8 +64,7 @@ public Language(int id, string abbreviation, string name, string englishName) private long srvTime; // only update this after a 100% successful download private readonly TvDbTokenProvider tvDbTokenProvider = new TvDbTokenProvider(); - public string RequestLanguage = "en"; // Set and updated by TVDoc - private static readonly string DefaultLanguage = "en"; //Default backup language + private static readonly string DefaultLanguageCode = "en"; //Default backup language private CommandLineArgs args; private static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger(); @@ -110,6 +92,8 @@ public static TheTVDB Instance } } + public Language PreferredLanuage => LanguageList.GetLanguageFromCode(TVSettings.Instance.PreferredLanguageCode); + public void Setup(FileInfo loadFrom, FileInfo cache, CommandLineArgs cla) { args = cla; @@ -122,7 +106,7 @@ public void Setup(FileInfo loadFrom, FileInfo cache, CommandLineArgs cla) extraEpisodes = new List(); removeEpisodeIds = new List(); - LanguageList = new List {new Language(7, "en", "English", "English")}; + LanguageList = new Languages {new Language(7, "en", "English", "English")}; //assume that the data is up to date (this will be overridden by the value in the XML if we have a prior install) //If we have no prior install then the app has no shows and is by definition up-to-date @@ -147,6 +131,8 @@ public void Setup(FileInfo loadFrom, FileInfo cache, CommandLineArgs cla) public SeriesInfo GetSeries(int id) => HasSeries(id) ? series[id] : null; + public SeriesInfo GetSeriesAndDownload(int id) => HasSeries(id) ? series[id] : DownloadSeriesNow(id,false,false,false,TVSettings.Instance.PreferredLanguageCode); + public Dictionary GetSeriesDict() => series; private Dictionary GetSeriesDictMatching(string testShowName) @@ -229,7 +215,7 @@ public void RelaodCache(FileInfo loadFrom, FileInfo cache) extraEpisodes.Clear(); removeEpisodeIds.Clear(); - LanguageList = new List { new Language(7, "en", "English", "English") }; +// LanguageList = new List { new Language(7, "en", "English", "English") }; //assume that the data is up to date (this will be overridden by the value in the XML if we have a prior install) //If we have no prior install then the app has no shows and is by definition up-to-date @@ -255,6 +241,7 @@ public void ClearCache() newSrvTime = DateTime.UtcNow.ToUnixTime(); } + public void UpdatesDoneOk() { // call when all downloading and updating is done. updates local Srv_Time with the tentative @@ -412,7 +399,7 @@ private Episode FindEpisodeById(int id) public bool Connect() { - Connected = GetLanguages(); + Connected = UpdateLanguages(); return Connected; } @@ -462,7 +449,7 @@ public byte[] GetTvdbDownload(string url, bool forceReload = false) } } - public void ForgetEverything() + public void ForgetEverything() { if (!GetLock("ForgetEverything")) return; @@ -476,7 +463,7 @@ public void ForgetEverything() newSrvTime = DateTime.UtcNow.ToUnixTime(); } - public void ForgetShow(int id, bool makePlaceholder) + public void ForgetShow(int id, bool makePlaceholder,bool useCustomLanguage, string customLanguageCode) { if (!GetLock("ForgetShow")) return; @@ -487,7 +474,11 @@ public void ForgetShow(int id, bool makePlaceholder) series.Remove(id); if (makePlaceholder) { - AddPlaceholderSeries(id, name); + if (useCustomLanguage) + AddPlaceholderSeries(id, name,customLanguageCode); + else + AddPlaceholderSeries(id, name); + forceReloadOn.Add(id); } } @@ -495,7 +486,20 @@ public void ForgetShow(int id, bool makePlaceholder) Unlock("ForgetShow"); } - private bool GetLanguages() + public void ForgetShow(int id) + { + if (!GetLock("ForgetShow")) + return; + + if (series.ContainsKey(id)) + { + string name = series[id].Name; + series.Remove(id); + } + + Unlock("ForgetShow"); + } + private bool UpdateLanguages() { Say("TheTVDB Languages"); try @@ -539,49 +543,9 @@ public bool GetUpdates() return false; } - long theTime = srvTime; - - if (theTime == 0) - { - // we can use the oldest thing we have locally. It isn't safe to use the newest thing. - // This will only happen the first time we do an update, so a false _all update isn't too bad. - foreach (KeyValuePair kvp in series) - { - SeriesInfo ser = kvp.Value; - if ((theTime == 0) || ((ser.SrvLastUpdated != 0) && (ser.SrvLastUpdated < theTime))) - theTime = ser.SrvLastUpdated; - - //We can use AiredSeasons as it does not matter which order we do this in Aired or DVD - foreach (KeyValuePair kvp2 in kvp.Value.AiredSeasons) - { - Season seas = kvp2.Value; - - foreach (Episode e in seas.Episodes.Values) - { - if ((theTime == 0) || ((e.SrvLastUpdated != 0) && (e.SrvLastUpdated < theTime))) - theTime = e.SrvLastUpdated; - } - } - } - } - - // anything with a srv_lastupdated of 0 should be marked as dirty - // typically, this'll be placeholder series - foreach (KeyValuePair kvp in series) - { - SeriesInfo ser = kvp.Value; - if ((ser.SrvLastUpdated == 0) || (ser.AiredSeasons.Count == 0)) - ser.Dirty = true; + long theTime = GetUpdateTime(); - foreach (KeyValuePair kvp2 in kvp.Value.AiredSeasons) - { - foreach (Episode ep in kvp2.Value.Episodes.Values) - { - if (ep.SrvLastUpdated == 0) - ep.Dirty = true; - } - } - } + MarkPlaceholdersDirty(); if (theTime == 0) { @@ -617,8 +581,8 @@ public bool GetUpdates() try { jsonUdpateResponse = HttpHelper.JsonHttpGetRequest(uri, - new Dictionary {{"fromTime", epochTime.ToString()}}, - tvDbTokenProvider.GetToken(), TVSettings.Instance.PreferredLanguage); + new Dictionary { { "fromTime", epochTime.ToString() } }, + tvDbTokenProvider.GetToken(), TVSettings.Instance.PreferredLanguageCode); } catch (WebException ex) { @@ -637,7 +601,7 @@ public bool GetUpdates() { JToken dataToken = jsonUdpateResponse["data"]; - numberOfResponses = !dataToken.HasValues ? 0 : ((JArray) dataToken).Count; + numberOfResponses = !dataToken.HasValues ? 0 : ((JArray)dataToken).Count; } catch (InvalidCastException ex) { @@ -663,17 +627,7 @@ public bool GetUpdates() updatesResponses.Add(jsonUdpateResponse); numberofCallsMade++; - long maxUpdateTime; - try - { - IEnumerable updateTimes = from a in jsonUdpateResponse["data"] select (long) a["lastUpdated"]; - maxUpdateTime = updateTimes.DefaultIfEmpty(0).Max(); - } - catch (Exception e) - { - Logger.Error(e,jsonUdpateResponse.ToString() ); - maxUpdateTime = 0; - } + long maxUpdateTime = GetUpdateTime(jsonUdpateResponse); if (maxUpdateTime > 0) { @@ -710,168 +664,245 @@ public bool GetUpdates() Say("Processing Updates from TVDB"); - Parallel.ForEach(updatesResponses, jsonResponse => + Parallel.ForEach(updatesResponses, jsonResponse => { ProcessUpdate(jsonResponse, uri); }); + + Say("Upgrading dirty locks"); + + UpgradeDirtyLocks(); + + Say(""); + + return true; + } + + private long GetUpdateTime() + { + return srvTime == 0 ? GetUpdateTimeFromShows(0) : srvTime; + } + + private void UpgradeDirtyLocks() + { + // if more than x% of a show's episodes are marked as dirty, just download the entire show again + foreach (KeyValuePair kvp in series) { - // if updatetime > localtime for item, then remove it, so it will be downloaded later - try + int totaleps = 0; + int totaldirty = 0; + foreach (KeyValuePair kvp2 in kvp.Value.AiredSeasons) { - foreach (JObject seriesResponse in jsonResponse["data"]) + foreach (Episode ep in kvp2.Value.Episodes.Values) { - int id = (int) seriesResponse["id"]; - long time = (long) seriesResponse["lastUpdated"]; + if (ep.Dirty) + totaldirty++; - if (this.series.ContainsKey(id)) // this is a series we have - { - if (time > this.series[id].SrvLastUpdated) // newer version on the server - this.series[id].Dirty = true; // mark as dirty, so it'll be fetched again later - else - Logger.Info(this.series[id].Name + " has a lastupdated of " + - Helpers.FromUnixTime(this.series[id].SrvLastUpdated) + " server says " + - Helpers.FromUnixTime(time)); + totaleps++; + } + } - //now we wish to see if any episodes from the series have been updated. If so then mark them as dirty too - List episodeDefaultLangResponses=null; - List episodeResponses = GetEpisodes(id, TVSettings.Instance.PreferredLanguage); - if (InForeignLanguage()) episodeDefaultLangResponses = GetEpisodes(id, DefaultLanguage); + float percentDirty = 100; + if (totaldirty > 0 || totaleps > 0) percentDirty = 100 * totaldirty / totaleps; + if ((totaleps > 0) && ((percentDirty) >= TVSettings.Instance.PercentDirtyUpgrade())) // 10% + { + kvp.Value.Dirty = true; + kvp.Value.AiredSeasons.Clear(); + kvp.Value.DvdSeasons.Clear(); + Logger.Info("Planning to download all of {0} as {1}% of the episodes need to be updated", + kvp.Value.Name, percentDirty); + } + else + Logger.Trace( + "Not planning to download all of {0} as {1}% of the episodes need to be updated and that's less than the 10% limit to upgrade.", + kvp.Value.Name, percentDirty); + } + } + + private void ProcessUpdate(JObject jsonResponse, string uri) + { + // if updatetime > localtime for item, then remove it, so it will be downloaded later + try + { + foreach (JObject seriesResponse in jsonResponse["data"]) + { + int id = (int)seriesResponse["id"]; + long time = (long)seriesResponse["lastUpdated"]; + + if (this.series.ContainsKey(id)) // this is a series we have + { + if (time > this.series[id].SrvLastUpdated) // newer version on the server + this.series[id].Dirty = true; // mark as dirty, so it'll be fetched again later + else + Logger.Info(this.series[id].Name + " has a lastupdated of " + + Helpers.FromUnixTime(this.series[id].SrvLastUpdated) + " server says " + + Helpers.FromUnixTime(time)); - Dictionary> episodesResponses = - MergeEpisodeResponses(episodeResponses, episodeDefaultLangResponses); + //now we wish to see if any episodes from the series have been updated. If so then mark them as dirty too + List episodeDefaultLangResponses = null; + string requestedLanguageCode = series[id].useCustomLanguage ? series[id].targetLanguageCode: TVSettings.Instance.PreferredLanguageCode; + List episodeResponses = GetEpisodes(id, requestedLanguageCode); + if (IsNotDefaultLanguage(requestedLanguageCode)) episodeDefaultLangResponses = GetEpisodes(id, DefaultLanguageCode); - int numberOfNewEpisodes = 0; - int numberOfUpdatedEpisodes = 0; + Dictionary> episodesResponses = + MergeEpisodeResponses(episodeResponses, episodeDefaultLangResponses); - ICollection oldEpisodeIds = new List(); - foreach (KeyValuePair kvp2 in GetSeries(id)?.AiredSeasons??new Dictionary()) + int numberOfNewEpisodes = 0; + int numberOfUpdatedEpisodes = 0; + + ICollection oldEpisodeIds = new List(); + foreach (KeyValuePair kvp2 in GetSeries(id)?.AiredSeasons ?? new Dictionary()) + { + foreach (Episode ep in kvp2.Value.Episodes.Values) { - foreach (Episode ep in kvp2.Value.Episodes.Values) - { - oldEpisodeIds.Add(ep.EpisodeId); - } + oldEpisodeIds.Add(ep.EpisodeId); } + } - foreach (JObject response in episodeResponses) + foreach (JObject response in episodeResponses) + { + try { - try + foreach (KeyValuePair> episodeData in episodesResponses) { - foreach (KeyValuePair> episodeData in episodesResponses) + JToken episodeToUse = (episodeData.Value.Item1 ?? episodeData.Value.Item2); + long serverUpdateTime = (long)episodeToUse["lastUpdated"]; + int serverEpisodeId = episodeData.Key; + + bool found = false; + foreach (KeyValuePair kvp2 in this.series[id].AiredSeasons) { - JToken episodeToUse = (episodeData.Value.Item1??episodeData.Value.Item2); - long serverUpdateTime = (long)episodeToUse["lastUpdated"]; - int serverEpisodeId = episodeData.Key; + Season seas = kvp2.Value; - bool found = false; - foreach (KeyValuePair kvp2 in this.series[id].AiredSeasons) + foreach (Episode ep in seas.Episodes.Values) { - Season seas = kvp2.Value; - - foreach (Episode ep in seas.Episodes.Values) + if (ep.EpisodeId == serverEpisodeId) { - if (ep.EpisodeId == serverEpisodeId) - { - oldEpisodeIds.Remove(serverEpisodeId); - - if (ep.SrvLastUpdated < serverUpdateTime) - { - ep.Dirty = true; // mark episode as dirty. - numberOfUpdatedEpisodes++; - } + oldEpisodeIds.Remove(serverEpisodeId); - found = true; - break; + if (ep.SrvLastUpdated < serverUpdateTime) + { + ep.Dirty = true; // mark episode as dirty. + numberOfUpdatedEpisodes++; } + + found = true; + break; } } + } - if (!found) - { - // must be a new episode - LockExtraEpisodes(); - extraEpisodes.Add(new ExtraEp(id, serverEpisodeId)); - UnlockExtraEpisodes(); - numberOfNewEpisodes++; - } + if (!found) + { + // must be a new episode + LockExtraEpisodes(); + extraEpisodes.Add(new ExtraEp(id, serverEpisodeId)); + UnlockExtraEpisodes(); + numberOfNewEpisodes++; } } - catch (InvalidCastException ex) - { - Logger.Error("Did not recieve the expected format of episode json from {0}.", uri); - Logger.Error(ex); - Logger.Error(jsonResponse["data"].ToString()); - } - catch (OverflowException ex) - { - Logger.Error("Could not parse the episode json from {0}.", uri); - Logger.Error(ex); - Logger.Error(jsonResponse["data"].ToString()); - } } + catch (InvalidCastException ex) + { + Logger.Error("Did not recieve the expected format of episode json from {0}.", uri); + Logger.Error(ex); + Logger.Error(jsonResponse["data"].ToString()); + } + catch (OverflowException ex) + { + Logger.Error("Could not parse the episode json from {0}.", uri); + Logger.Error(ex); + Logger.Error(jsonResponse["data"].ToString()); + } + } - Logger.Info(this.series[id].Name + " had " + numberOfUpdatedEpisodes + - " episodes updated and " + numberOfNewEpisodes + " new episodes "); + Logger.Info(this.series[id].Name + " had " + numberOfUpdatedEpisodes + + " episodes updated and " + numberOfNewEpisodes + " new episodes "); - if (oldEpisodeIds.Count > 0) - Logger.Warn(this.series[id].Name + " had " + oldEpisodeIds.Count + - " episodes deleted: " + string.Join(",", oldEpisodeIds)); + if (oldEpisodeIds.Count > 0) + Logger.Warn(this.series[id].Name + " had " + oldEpisodeIds.Count + + " episodes deleted: " + string.Join(",", oldEpisodeIds)); - LockRemoveEpisodes(); - foreach (int episodeId in oldEpisodeIds) - removeEpisodeIds.Add(new ExtraEp(id, episodeId)); + LockRemoveEpisodes(); + foreach (int episodeId in oldEpisodeIds) + removeEpisodeIds.Add(new ExtraEp(id, episodeId)); - UnlockRemoveEpisodes(); - } + UnlockRemoveEpisodes(); } } - catch (InvalidCastException ex) - { - Logger.Error("Did not recieve the expected format of json from {0}.", uri); - Logger.Error(ex); - Logger.Error(jsonResponse["data"].ToString()); - } - catch (OverflowException ex) - { - Logger.Error("Could not parse the json from {0}.", uri); - Logger.Error(ex); - Logger.Error(jsonResponse["data"].ToString()); - } - }); + } + catch (InvalidCastException ex) + { + Logger.Error("Did not recieve the expected format of json from {0}.", uri); + Logger.Error(ex); + Logger.Error(jsonResponse["data"].ToString()); + } + catch (OverflowException ex) + { + Logger.Error("Could not parse the json from {0}.", uri); + Logger.Error(ex); + Logger.Error(jsonResponse["data"].ToString()); + } + } - Say("Upgrading dirty locks"); + private static long GetUpdateTime(JObject jsonUdpateResponse) + { + long maxUpdateTime; + try + { + IEnumerable updateTimes = from a in jsonUdpateResponse["data"] select (long)a["lastUpdated"]; + maxUpdateTime = updateTimes.DefaultIfEmpty(0).Max(); + } + catch (Exception e) + { + Logger.Error(e, jsonUdpateResponse.ToString()); + maxUpdateTime = 0; + } - // if more than x% of a show's episodes are marked as dirty, just download the entire show again + return maxUpdateTime; + } + + private long GetUpdateTimeFromShows(long theTime) + { + // we can use the oldest thing we have locally. It isn't safe to use the newest thing. + // This will only happen the first time we do an update, so a false _all update isn't too bad. foreach (KeyValuePair kvp in series) { - int totaleps = 0; - int totaldirty = 0; + SeriesInfo ser = kvp.Value; + if ((theTime == 0) || ((ser.SrvLastUpdated != 0) && (ser.SrvLastUpdated < theTime))) + theTime = ser.SrvLastUpdated; + + //We can use AiredSeasons as it does not matter which order we do this in Aired or DVD foreach (KeyValuePair kvp2 in kvp.Value.AiredSeasons) { - foreach (Episode ep in kvp2.Value.Episodes.Values) - { - if (ep.Dirty) - totaldirty++; + Season seas = kvp2.Value; - totaleps++; + foreach (Episode e in seas.Episodes.Values) + { + if ((theTime == 0) || ((e.SrvLastUpdated != 0) && (e.SrvLastUpdated < theTime))) + theTime = e.SrvLastUpdated; } } + } - float percentDirty = 100; - if (totaldirty > 0 || totaleps > 0) percentDirty = 100 * totaldirty / totaleps; - if ((totaleps > 0) && ((percentDirty) >= TVSettings.Instance.PercentDirtyUpgrade())) // 10% + return theTime; + } + + private void MarkPlaceholdersDirty() + { + // anything with a srv_lastupdated of 0 should be marked as dirty + // typically, this'll be placeholder series + foreach (KeyValuePair kvp in series) + { + SeriesInfo ser = kvp.Value; + if ((ser.SrvLastUpdated == 0) || (ser.AiredSeasons.Count == 0)) + ser.Dirty = true; + + foreach (KeyValuePair kvp2 in kvp.Value.AiredSeasons) { - kvp.Value.Dirty = true; - kvp.Value.AiredSeasons.Clear(); - kvp.Value.DvdSeasons.Clear(); - Logger.Info("Planning to download all of {0} as {1}% of the episodes need to be updated", - kvp.Value.Name, percentDirty); + foreach (Episode ep in kvp2.Value.Episodes.Values) + { + if (ep.SrvLastUpdated == 0) + ep.Dirty = true; + } } - else - Logger.Trace( - "Not planning to download all of {0} as {1}% of the episodes need to be updated and that's less than the 10% limit to upgrade.", - kvp.Value.Name, percentDirty); } - - Say(""); - - return true; } private List GetEpisodes(int id,string lang) @@ -1061,7 +1092,6 @@ private void ProcessXmlBanner(XmlReader r, int codeHint) series[codeHint].BannersLoaded = true; break; // that's it. } - else if (r.Name == "xml") r.Read(); else @@ -1069,26 +1099,10 @@ private void ProcessXmlBanner(XmlReader r, int codeHint) } } - private int GetLanguageId() - { - foreach (Language l in LanguageList) - { - if (l.Abbreviation == TVSettings.Instance.PreferredLanguage) return l.Id; - } - - return -1; - } - - private int GetDefaultLanguageId() - { - foreach (Language l in LanguageList) - { - if (l.Abbreviation == DefaultLanguage) return l.Id; - } - - return -1; - } + private int GetLanguageId() => LanguageList.GetLanguageFromCode(TVSettings.Instance.PreferredLanguageCode).Id; + private int GetDefaultLanguageId() => LanguageList.GetLanguageFromCode(DefaultLanguageCode).Id; + private bool ProcessXml(Stream str, int? codeHint) { // Will have one or more series, and episodes @@ -1231,7 +1245,7 @@ private bool DoWeForceReloadFor(int code) return forceReloadOn.Contains(code) || !series.ContainsKey(code); } - private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo) + private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo, bool useCustomLangCode, string langCode) { bool forceReload = DoWeForceReloadFor(code); @@ -1254,14 +1268,14 @@ private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo string uri = TvDbTokenProvider.TVDB_API_URL + "/series/" + code; JObject jsonResponse; JObject jsonDefaultLangResponse = new JObject(); + string requestedLanguageCode = useCustomLangCode ? langCode : TVSettings.Instance.PreferredLanguageCode; try { - jsonResponse = HttpHelper.JsonHttpGetRequest(uri, null, tvDbTokenProvider.GetToken(), - TVSettings.Instance.PreferredLanguage); + jsonResponse = HttpHelper.JsonHttpGetRequest(uri, null, tvDbTokenProvider.GetToken(),requestedLanguageCode); - if (InForeignLanguage()) + if (IsNotDefaultLanguage(requestedLanguageCode)) jsonDefaultLangResponse = - HttpHelper.JsonHttpGetRequest(uri, null, tvDbTokenProvider.GetToken(), DefaultLanguage); + HttpHelper.JsonHttpGetRequest(uri, null, tvDbTokenProvider.GetToken(), DefaultLanguageCode); } catch (WebException ex) { @@ -1275,7 +1289,7 @@ private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo SeriesInfo si; JObject seriesData = (JObject) jsonResponse["data"]; - if (InForeignLanguage()) + if (IsNotDefaultLanguage(requestedLanguageCode)) { JObject seriesDataDefaultLang = (JObject) jsonDefaultLangResponse["data"]; si = new SeriesInfo(seriesData, seriesDataDefaultLang, GetLanguageId()); @@ -1297,7 +1311,7 @@ private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo if (episodesToo || forceReload) { - ReloadEpisodes(code); + ReloadEpisodes(code,useCustomLangCode,langCode); } List bannerResponses = new List(); @@ -1311,7 +1325,7 @@ private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo { JObject jsonEpisodeSearchResponse = HttpHelper.JsonHttpGetRequest( TvDbTokenProvider.TVDB_API_URL + "/series/" + code + "/images", null, tvDbTokenProvider.GetToken(), - TVSettings.Instance.PreferredLanguage); + requestedLanguageCode); JObject a = (JObject) jsonEpisodeSearchResponse["data"]; @@ -1324,7 +1338,7 @@ private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo { //no images for chosen language Logger.Warn(ex, - $"No images found for {TvDbTokenProvider.TVDB_API_URL }/series/{code}/images in language {TVSettings.Instance.PreferredLanguage}"); + $"No images found for {TvDbTokenProvider.TVDB_API_URL }/series/{code}/images in language {requestedLanguageCode}"); } foreach (string imageType in imageTypes) @@ -1334,7 +1348,7 @@ private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo JObject jsonImageResponse = HttpHelper.JsonHttpGetRequest( TvDbTokenProvider.TVDB_API_URL + "/series/" + code + "/images/query", new Dictionary {{"keyType", imageType}}, tvDbTokenProvider.GetToken(), - TVSettings.Instance.PreferredLanguage); + requestedLanguageCode); bannerResponses.Add(jsonImageResponse); } @@ -1347,7 +1361,7 @@ private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo } } - if (InForeignLanguage()) + if (IsNotDefaultLanguage(requestedLanguageCode)) { List imageDefaultLangTypes = new List(); @@ -1355,7 +1369,7 @@ private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo { JObject jsonEpisodeSearchDefaultLangResponse = HttpHelper.JsonHttpGetRequest( TvDbTokenProvider.TVDB_API_URL + "/series/" + code + "/images", null, tvDbTokenProvider.GetToken(), - DefaultLanguage); + DefaultLanguageCode); JObject adl = (JObject) jsonEpisodeSearchDefaultLangResponse["data"]; @@ -1367,7 +1381,7 @@ private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo catch (WebException ex) { Logger.Info("Looking for images, but none found for seriesId {0} in {1}", code, - DefaultLanguage); + DefaultLanguageCode); Logger.Info(ex); @@ -1381,7 +1395,7 @@ private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo JObject jsonImageDefaultLangResponse = HttpHelper.JsonHttpGetRequest( TvDbTokenProvider.TVDB_API_URL + "/series/" + code + "/images/query", new Dictionary {{"keyType", imageType}}, tvDbTokenProvider.GetToken(), - DefaultLanguage); + DefaultLanguageCode); bannerDefaultLangResponses.Add(jsonImageDefaultLangResponse); } @@ -1480,11 +1494,12 @@ private SeriesInfo DownloadSeriesNow(int code, bool episodesToo, bool bannersToo return (series.ContainsKey(code)) ? series[code] : null; } - private void ReloadEpisodes(int code) + private void ReloadEpisodes(int code, bool useCustomLangCode, string langCode) { - List episodePrefLangResponses = GetEpisodes(code, TVSettings.Instance.PreferredLanguage); + string requestLangCode = useCustomLangCode ? langCode : TVSettings.Instance.PreferredLanguageCode; + List episodePrefLangResponses = GetEpisodes(code, requestLangCode); List episodeDefaultLangResponses = null; - if (InForeignLanguage()) episodeDefaultLangResponses = GetEpisodes(code, DefaultLanguage); + if (IsNotDefaultLanguage(requestLangCode)) episodeDefaultLangResponses = GetEpisodes(code, DefaultLanguageCode); Dictionary> episodeResponses = MergeEpisodeResponses(episodePrefLangResponses, episodeDefaultLangResponses); @@ -1562,14 +1577,18 @@ private static Dictionary> MergeEpisodeResponses(List return episodeIds; } - private bool InForeignLanguage() => DefaultLanguage != TVSettings.Instance.PreferredLanguage; + private bool InForeignLanguage() => DefaultLanguageCode != TVSettings.Instance.PreferredLanguageCode; + + private bool IsNotDefaultLanguage(string languageCode) => DefaultLanguageCode != languageCode; private bool DownloadEpisodeNow(int seriesId, int episodeId, bool dvdOrder = false) { + string requestLangCode; if (series.ContainsKey(seriesId)) { Episode ep = FindEpisodeById(episodeId); string eptxt = EpisodeDescription(dvdOrder, episodeId, ep); + requestLangCode = (series[seriesId].useCustomLanguage)? series[seriesId].targetLanguageCode: TVSettings.Instance.PreferredLanguageCode; Say(series[seriesId].Name + " (" + eptxt + ")"); } else @@ -1581,12 +1600,11 @@ private bool DownloadEpisodeNow(int seriesId, int episodeId, bool dvdOrder = fal try { - jsonEpisodeResponse = HttpHelper.JsonHttpGetRequest(uri, null, tvDbTokenProvider.GetToken(), - TVSettings.Instance.PreferredLanguage); + jsonEpisodeResponse = HttpHelper.JsonHttpGetRequest(uri, null, tvDbTokenProvider.GetToken(), requestLangCode); - if (InForeignLanguage()) + if (IsNotDefaultLanguage(requestLangCode)) jsonEpisodeDefaultLangResponse = - HttpHelper.JsonHttpGetRequest(uri, null, tvDbTokenProvider.GetToken(), DefaultLanguage); + HttpHelper.JsonHttpGetRequest(uri, null, tvDbTokenProvider.GetToken(), DefaultLanguageCode); } catch (WebException ex) { @@ -1604,7 +1622,7 @@ private bool DownloadEpisodeNow(int seriesId, int episodeId, bool dvdOrder = fal Episode e; JObject jsonResponseData = (JObject)jsonEpisodeResponse["data"]; - if (InForeignLanguage()) + if (IsNotDefaultLanguage(requestLangCode)) { JObject seriesDataDefaultLang = (JObject) jsonEpisodeDefaultLangResponse["data"]; e = new Episode(seriesId, jsonResponseData, seriesDataDefaultLang); @@ -1737,15 +1755,20 @@ private void AddPlaceholderSeries(int code, string name) series[code] = new SeriesInfo(name ?? "", code) {Dirty = true}; } - public bool EnsureUpdated(int code, bool bannersToo) + private void AddPlaceholderSeries(int code, string name,string customLanguageCode) + { + series[code] = new SeriesInfo(name ?? "", code, customLanguageCode) { Dirty = true }; + } + + public bool EnsureUpdated(int code, bool bannersToo, bool useCustomLangCode, string langCode) { if (DoWeForceReloadFor(code) || (series[code].AiredSeasons.Count == 0)) - return DownloadSeriesNow(code, true, bannersToo) != null; // the whole lot! + return DownloadSeriesNow(code, true, bannersToo,useCustomLangCode,langCode) != null; // the whole lot! bool ok = true; if ((series[code].Dirty) || (bannersToo && !series[code].BannersLoaded)) - ok = (DownloadSeriesNow(code, false, bannersToo) != null); + ok = (DownloadSeriesNow(code, false, bannersToo, useCustomLangCode, langCode) != null); foreach (KeyValuePair kvp in GetSeries(code)?.AiredSeasons??new Dictionary()) { @@ -1785,35 +1808,35 @@ public bool EnsureUpdated(int code, bool bannersToo) public void Search(string text) { + if (!Connected && !Connect()) + { + Say("Failed to Connect"); + return; + } + text = Helpers.RemoveDiacritics(text); // API doesn't like accented characters bool isNumber = Regex.Match(text, "^[0-9]+$").Success; if (isNumber) - DownloadSeriesNow(int.Parse(text), false, false); + DownloadSeriesNow(int.Parse(text), false, false,false, TVSettings.Instance.PreferredLanguageCode); // but, the number could also be a name, so continue searching as usual //text = text.Replace(".", " "); - if (!Connected && !Connect()) - { - Say("Failed to Connect"); - return; - } - string uri = TvDbTokenProvider.TVDB_API_URL + "/search/series"; JObject jsonSearchResponse = null; JObject jsonSearchDefaultLangResponse = null; try { jsonSearchResponse = HttpHelper.JsonHttpGetRequest(uri, new Dictionary {{"name", text}}, - tvDbTokenProvider.GetToken(), TVSettings.Instance.PreferredLanguage); + tvDbTokenProvider.GetToken(), TVSettings.Instance.PreferredLanguageCode); } catch (WebException ex) { if (((HttpWebResponse) ex.Response).StatusCode == HttpStatusCode.NotFound) { Logger.Info( - $"Could not find any earch results for {text} in {TVSettings.Instance.PreferredLanguage}"); + $"Could not find any search results for {text} in {TVSettings.Instance.PreferredLanguageCode}"); } else { @@ -1828,14 +1851,14 @@ public void Search(string text) try { jsonSearchDefaultLangResponse = HttpHelper.JsonHttpGetRequest(uri, - new Dictionary {{"name", text}}, tvDbTokenProvider.GetToken(), DefaultLanguage); + new Dictionary {{"name", text}}, tvDbTokenProvider.GetToken(), DefaultLanguageCode); } catch (WebException ex) { if (((HttpWebResponse)ex.Response).StatusCode == HttpStatusCode.NotFound) { Logger.Info( - $"Could not find any earch results for {text} in {DefaultLanguage}"); + $"Could not find any earch results for {text} in {DefaultLanguageCode}"); } else { @@ -1951,11 +1974,10 @@ public void Tidy(ICollection libraryValues) } foreach (int i in removeList) - ForgetShow(i, false); + ForgetShow(i); Unlock("TheTVDB"); SaveCache(); } } } - diff --git a/TVRename/Utility/BT.cs b/TVRename/Utility/BT.cs index 912b76763..d7e183b7f 100644 --- a/TVRename/Utility/BT.cs +++ b/TVRename/Utility/BT.cs @@ -33,7 +33,7 @@ public enum BTChunk kBTEOF } - public class TorrentEntry: DownloadInformation // represents a torrent downloading in uTorrent + public class TorrentEntry: IDownloadInformation // represents a torrent downloading in uTorrent { public string DownloadingTo; public int PercentDone; @@ -46,11 +46,11 @@ public TorrentEntry(string torrentfile, string to, int percent) PercentDone = percent; } - string DownloadInformation.FileIdentifier => TorrentFile; + string IDownloadInformation.FileIdentifier => TorrentFile; - string DownloadInformation.Destination => DownloadingTo; + string IDownloadInformation.Destination => DownloadingTo; - string DownloadInformation.RemainingText + string IDownloadInformation.RemainingText { get { diff --git a/TVRename/Utility/DownloadInformation.cs b/TVRename/Utility/DownloadInformation.cs index 5ab5292df..f16e042d8 100644 --- a/TVRename/Utility/DownloadInformation.cs +++ b/TVRename/Utility/DownloadInformation.cs @@ -1,6 +1,6 @@ namespace TVRename { - public interface DownloadInformation + public interface IDownloadInformation { string FileIdentifier { get; } string Destination { get; } diff --git a/TVRename/Utility/SAB/QueueSlotsSlot.cs b/TVRename/Utility/SAB/QueueSlotsSlot.cs index c0f778d22..1e2266c68 100644 --- a/TVRename/Utility/SAB/QueueSlotsSlot.cs +++ b/TVRename/Utility/SAB/QueueSlotsSlot.cs @@ -6,7 +6,7 @@ namespace TVRename.SAB [System.SerializableAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [XmlType(AnonymousType = true)] - public class QueueSlotsSlot : object, System.ComponentModel.INotifyPropertyChanged,DownloadInformation + public class QueueSlotsSlot : object, System.ComponentModel.INotifyPropertyChanged,IDownloadInformation { private string statusField; private string indexField; @@ -237,11 +237,11 @@ public string size } } - string DownloadInformation.FileIdentifier => filename; + string IDownloadInformation.FileIdentifier => filename; - string DownloadInformation.Destination => filename; + string IDownloadInformation.Destination => filename; - string DownloadInformation.RemainingText + string IDownloadInformation.RemainingText { get { From 3d5e3053e0e79370b36cf58c7e9f97b6b036ee56 Mon Sep 17 00:00:00 2001 From: Chlorel Date: Tue, 16 Oct 2018 15:59:15 +0200 Subject: [PATCH 05/12] App Base changes --- TVRename/App/ApplicationBase.cs | 38 +++++++++++++++++------------ TVRename/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/TVRename/App/ApplicationBase.cs b/TVRename/App/ApplicationBase.cs index 85e9a1e98..c82bd2fa8 100644 --- a/TVRename/App/ApplicationBase.cs +++ b/TVRename/App/ApplicationBase.cs @@ -56,22 +56,7 @@ protected override void OnCreateMainForm() PathManager.ShowCollection = ""; - // Check arguments for custom settings path - if (!string.IsNullOrEmpty(clargs.UserFilePath)) - { - try - { - PathManager.SetUserDefinedBasePath(clargs.UserFilePath); - } - catch (Exception ex) - { - if (!clargs.Unattended && !clargs.Hide) MessageBox.Show($"Error while setting the User-Defined File Path:{Environment.NewLine}{ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - - Logger.Error(ex, $"Error while setting the User-Defined File Path - EXITING: {clargs.UserFilePath}"); - - Environment.Exit(1); - } - } + SetupCustomSettings(clargs); TVDoc doc; @@ -122,6 +107,27 @@ protected override void OnCreateMainForm() MainForm = ui; } + private static void SetupCustomSettings(CommandLineArgs clargs) + { + // Check arguments for custom settings path + if (!string.IsNullOrEmpty(clargs.UserFilePath)) + { + try + { + PathManager.SetUserDefinedBasePath(clargs.UserFilePath); + } + catch (Exception ex) + { + if (!clargs.Unattended && !clargs.Hide) MessageBox.Show($"Error while setting the User-Defined File Path:{Environment.NewLine}{ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + + Logger.Error(ex, $"Error while setting the User-Defined File Path - EXITING: {clargs.UserFilePath}"); + + Environment.Exit(1); + } + } + } + + private static void ConvertSeriesTimeZones(TVDoc doc, TheTVDB tvdb) { //this is just to convert timezones in the TheTVDB into the TVDOC where they should be: diff --git a/TVRename/Properties/AssemblyInfo.cs b/TVRename/Properties/AssemblyInfo.cs index f9954e926..f16a67403 100644 --- a/TVRename/Properties/AssemblyInfo.cs +++ b/TVRename/Properties/AssemblyInfo.cs @@ -17,5 +17,5 @@ [assembly: AssemblyVersion("2.5.3.0")] [assembly: AssemblyFileVersion("2.5.3")] -[assembly: AssemblyInformationalVersion("2.5.5")] // Display version +[assembly: AssemblyInformationalVersion("2.6.5")] // Display version From 22551b39bef3df136097f47526894a7e4e2c6bb7 Mon Sep 17 00:00:00 2001 From: Chlorel Date: Tue, 16 Oct 2018 16:06:41 +0200 Subject: [PATCH 06/12] better vers --- TVRename/App/ApplicationBase.cs | 2 -- TVRename/TVRename/TVDoc.cs | 16 ++++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/TVRename/App/ApplicationBase.cs b/TVRename/App/ApplicationBase.cs index c82bd2fa8..a98ac615c 100644 --- a/TVRename/App/ApplicationBase.cs +++ b/TVRename/App/ApplicationBase.cs @@ -55,7 +55,6 @@ protected override void OnCreateMainForm() } PathManager.ShowCollection = ""; - SetupCustomSettings(clargs); TVDoc doc; @@ -127,7 +126,6 @@ private static void SetupCustomSettings(CommandLineArgs clargs) } } - private static void ConvertSeriesTimeZones(TVDoc doc, TheTVDB tvdb) { //this is just to convert timezones in the TheTVDB into the TVDOC where they should be: diff --git a/TVRename/TVRename/TVDoc.cs b/TVRename/TVRename/TVDoc.cs index 657bee788..e04b0fb70 100644 --- a/TVRename/TVRename/TVDoc.cs +++ b/TVRename/TVRename/TVDoc.cs @@ -277,21 +277,21 @@ public void WriteXMLFile (FileToHandle Files) NewLineOnAttributes = true }; - if ((Files & FileToHandle.Collections) > 0) + if ( Files.HasFlag(FileToHandle.Collections) ) { FileHelper.Rotate(PathManager.ShowCollectionFile.FullName); Logger.Info("Saving Collections to {0}", PathManager.ShowCollectionFile.FullName); XmlWriter writer = XmlWriter.Create(PathManager.ShowCollectionFile.FullName, settings); WriteXMLCollections(writer); } - if ((Files & FileToHandle.Settings) > 0) + if ( Files.HasFlag(FileToHandle.Settings) ) { FileHelper.Rotate(PathManager.TVDocSettingsFile.FullName); Logger.Info("Saving Settings to {0}", PathManager.TVDocSettingsFile.FullName); XmlWriter writer = XmlWriter.Create(PathManager.TVDocSettingsFile.FullName, settings); WriteXMLSettings(writer); } - if (((Files & FileToHandle.Shows) > 0) && (!string.IsNullOrEmpty(PathManager.ShowCollection))) + if ((Files.HasFlag(FileToHandle.Shows)) && (!string.IsNullOrEmpty(PathManager.ShowCollection))) { FileHelper.Rotate(PathManager.TVDocShowsFile.FullName); Logger.Info("Saving Shows to {0}", PathManager.TVDocShowsFile.FullName); @@ -300,7 +300,7 @@ public void WriteXMLFile (FileToHandle Files) WriteXMLShows(writer); } - if ((Files & FileToHandle.TvDB) > 0) + if (Files.HasFlag(FileToHandle.TvDB)) { TheTVDB.Instance.SaveCache(); } @@ -402,19 +402,19 @@ private bool LoadXMLFile (FileToHandle Files, bool bInit) IgnoreWhitespace = true }; - if ((Files & FileToHandle.Collections) > 0) + if (Files.HasFlag(FileToHandle.Collections)) { bLoadOk = ReadXMLCollections(settings, ShowCollections, LoadErr); } - if ((Files & FileToHandle.TvDB) > 0) + if (Files.HasFlag(FileToHandle.TvDB)) { bLoadOk = ReadXMLTvDBCache(bInit, Args); } - if ((Files & FileToHandle.Settings) > 0) + if (Files.HasFlag(FileToHandle.Settings)) { bLoadOk = ReadXMLSettings(settings, LoadErr); } - if ((Files & FileToHandle.Shows) > 0) + if (Files.HasFlag(FileToHandle.Shows) ) { bLoadOk = ReadXMLShows(settings, Library, mStats, LoadErr); } From 20551628e617396003f1aa67728134b44f0394bc Mon Sep 17 00:00:00 2001 From: Chlorel Date: Tue, 16 Oct 2018 18:47:48 +0200 Subject: [PATCH 07/12] One other way to get to last stand ... --- TVRename/App/ApplicationBase.cs | 9 ++-- TVRename/App/AutoFolderMonitor.cs | 1 - TVRename/App/CommandLineArgs.cs | 3 -- .../DownloadIdentifers/DownloadEpisodeJPG.cs | 1 - .../DownloadIdentifers/DownloadFanartJPG.cs | 13 +----- .../DownloadIdentifers/DownloadXBMCImages.cs | 1 - .../DownloadIdentifers/IncorrectFileDates.cs | 1 - TVRename/Exporter/MissingCSV.cs | 3 -- TVRename/Finders/RSSFinder.cs | 31 +++++++------ .../Forms/Preferences/AddEditSearchEngine.cs | 46 +++++++++---------- .../Forms/Preferences/CustomNameDesigner.cs | 3 -- .../ShowPreferences/FolderBrowserDialogEx.cs | 1 - .../Supporting/CopyMoveProgress.Designer.cs | 1 - TVRename/Forms/Supporting/CopyMoveProgress.cs | 2 - TVRename/Forms/Supporting/Filters.cs | 2 - TVRename/Forms/Supporting/TVRenameSplash.cs | 2 - TVRename/Forms/Tools/DupEpFinder.cs | 17 ++++--- .../ItemsAndActions/ActionDownloadImage.cs | 1 - TVRename/ItemsAndActions/ActionMede8erXML.cs | 1 - TVRename/ItemsAndActions/ActionWdtvMeta.cs | 1 - TVRename/ItemsAndActions/ItemDownloading.cs | 14 ++++-- 21 files changed, 65 insertions(+), 89 deletions(-) diff --git a/TVRename/App/ApplicationBase.cs b/TVRename/App/ApplicationBase.cs index a98ac615c..84253d3e2 100644 --- a/TVRename/App/ApplicationBase.cs +++ b/TVRename/App/ApplicationBase.cs @@ -23,7 +23,6 @@ protected override void OnCreateSplashScreen() CommandLineArgs clargs = new CommandLineArgs(CommandLineArgs); if (clargs.Hide) SplashScreen.Visible = false; - } /// @@ -33,13 +32,15 @@ protected override void OnCreateSplashScreen() protected override void OnCreateMainForm() { CommandLineArgs clargs = new CommandLineArgs(CommandLineArgs); + PathManager.ShowCollection = ""; + if (clargs.Hide) SplashScreen.SafeInvoke( - () => ((TVRenameSplash)SplashScreen).Visible = false,true); + () => ((TVRenameSplash)SplashScreen).Visible = false, true); // Update splash screen SplashScreen.SafeInvoke( - () => ((TVRenameSplash) SplashScreen).UpdateStatus("Initializing"), true); + () => ((TVRenameSplash)SplashScreen).UpdateStatus("Initializing"), true); // Update RegVersion to bring the WebBrowser up to speed RegistryHelper.UpdateBrowserEmulationVersion(); @@ -54,7 +55,6 @@ protected override void OnCreateMainForm() recoverText = "Recover manually requested."; } - PathManager.ShowCollection = ""; SetupCustomSettings(clargs); TVDoc doc; @@ -144,7 +144,6 @@ private static void ConvertSeriesTimeZones(TVDoc doc, TheTVDB tvdb) doc.SetDirty(); Logger.Info("Copied timezone:{0} onto series {1}", newTimeZone, si.ShowName); } - } } } diff --git a/TVRename/App/AutoFolderMonitor.cs b/TVRename/App/AutoFolderMonitor.cs index ab64d0db4..364ffebed 100644 --- a/TVRename/App/AutoFolderMonitor.cs +++ b/TVRename/App/AutoFolderMonitor.cs @@ -45,7 +45,6 @@ public void StartMonitor() if ((File.GetAttributes(efi) & FileAttributes.Directory) != (FileAttributes.Directory)) // not a folder continue; - FileSystemWatcher watcher = new FileSystemWatcher(efi); watcher.Changed += watcher_Changed; watcher.Created += watcher_Changed; diff --git a/TVRename/App/CommandLineArgs.cs b/TVRename/App/CommandLineArgs.cs index 901ff1675..6cdb0bfbf 100644 --- a/TVRename/App/CommandLineArgs.cs +++ b/TVRename/App/CommandLineArgs.cs @@ -88,9 +88,6 @@ public static string Helptext() output.AppendLine("Further information is available at http://www.tvrename.com/cmd-line"); return output.ToString(); - - } } } - diff --git a/TVRename/DownloadIdentifers/DownloadEpisodeJPG.cs b/TVRename/DownloadIdentifers/DownloadEpisodeJPG.cs index 1605f123f..52b387b92 100644 --- a/TVRename/DownloadIdentifers/DownloadEpisodeJPG.cs +++ b/TVRename/DownloadIdentifers/DownloadEpisodeJPG.cs @@ -1,6 +1,5 @@ using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; - namespace TVRename { internal class DownloadEpisodeJpg : DownloadIdentifier diff --git a/TVRename/DownloadIdentifers/DownloadFanartJPG.cs b/TVRename/DownloadIdentifers/DownloadFanartJPG.cs index 1dc07ad8b..71ea2caf7 100644 --- a/TVRename/DownloadIdentifers/DownloadFanartJPG.cs +++ b/TVRename/DownloadIdentifers/DownloadFanartJPG.cs @@ -8,15 +8,9 @@ class DownloadFanartJpg : DownloadIdentifier private static List DoneFanartJpg; private const string DEFAULT_FILE_NAME = "fanart.jpg"; - public DownloadFanartJpg() - { - Reset(); - } + public DownloadFanartJpg() => Reset(); - public override DownloadType GetDownloadType() - { - return DownloadType.downloadImage; - } + public override DownloadType GetDownloadType() => DownloadType.downloadImage; public override ItemList ProcessShow(ShowItem si, bool forceRefresh) { @@ -36,7 +30,6 @@ public override ItemList ProcessShow(ShowItem si, bool forceRefresh) DoneFanartJpg.Add(fi.FullName); } return theActionList; - } return base.ProcessShow(si, forceRefresh); } @@ -45,7 +38,5 @@ public sealed override void Reset() { DoneFanartJpg = new List(); } - } - } diff --git a/TVRename/DownloadIdentifers/DownloadXBMCImages.cs b/TVRename/DownloadIdentifers/DownloadXBMCImages.cs index 4dcbd2b60..dfe01e2a0 100644 --- a/TVRename/DownloadIdentifers/DownloadXBMCImages.cs +++ b/TVRename/DownloadIdentifers/DownloadXBMCImages.cs @@ -2,7 +2,6 @@ using System.Globalization; using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; - namespace TVRename { class DownloadKodiImages : DownloadIdentifier diff --git a/TVRename/DownloadIdentifers/IncorrectFileDates.cs b/TVRename/DownloadIdentifers/IncorrectFileDates.cs index 712698922..dfdb9a1c4 100644 --- a/TVRename/DownloadIdentifers/IncorrectFileDates.cs +++ b/TVRename/DownloadIdentifers/IncorrectFileDates.cs @@ -41,7 +41,6 @@ public override ItemList ProcessSeason(ShowItem si, string folder, int snum, boo if (newUpdateTime.Value.CompareTo(Helpers.WindowsStartDateTime) < 0) newUpdateTime = Helpers.WindowsStartDateTime; - DirectoryInfo di = new DirectoryInfo(folder); if ((di.LastWriteTimeUtc != newUpdateTime.Value) &&(!doneFilesAndFolders.Contains(di.FullName))) { diff --git a/TVRename/Exporter/MissingCSV.cs b/TVRename/Exporter/MissingCSV.cs index 945f1b93f..c5ed0c0c6 100644 --- a/TVRename/Exporter/MissingCSV.cs +++ b/TVRename/Exporter/MissingCSV.cs @@ -23,7 +23,6 @@ public override void Run() try { - using (System.IO.StreamWriter file = new System.IO.StreamWriter(Location())) { file.WriteLine("Show Name,Season,Episode,Episode Name,Air Date,Folder,Nice Name,thetvdb.com Code"); @@ -36,9 +35,7 @@ public override void Run() DateTime? dt = pe.GetAirDateDT(true); file.WriteLine($"\"{pe.TheSeries.Name}\",{pe.AppropriateSeasonNumber},{pe.NumsAsString()},\"{pe.Name}\",{dt:G},\"{action.TargetFolder}\",\"{im.Filename }\",{pe.SeriesId}"); } - } - } } catch (Exception e) diff --git a/TVRename/Finders/RSSFinder.cs b/TVRename/Finders/RSSFinder.cs index 6fbc8f627..7d5a07c98 100644 --- a/TVRename/Finders/RSSFinder.cs +++ b/TVRename/Finders/RSSFinder.cs @@ -60,8 +60,24 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) } } + List duplicateActionRss = FindDuplicates(newItems); + + foreach (ActionRSS x in duplicateActionRss) + newItems.Remove(x); + + foreach (Item i in toRemove) + ActionList.Remove(i); + + foreach (Item action in newItems) + ActionList.Add(action); + + prog.Invoke(totPct); + } + + private static List FindDuplicates(ItemList newItems) + { //We now want to rationlise the newItems - just in case we've added duplicates - List duplicateActionRss = new List(); + List duplicateActionRss = new List(); foreach (Item x in newItems) { @@ -85,24 +101,13 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) if (testActionRssOne.RSS.Title.ContainsOneOf(preferredTerms) && !testActionRssTwo.RSS.Title.ContainsOneOf(preferredTerms)) { - duplicateActionRss.Add(testActionRssTwo); Logger.Info( $"Removing {testActionRssTwo.RSS.URL} as it is not as good a match as {testActionRssOne.RSS.URL}"); } } } - - foreach (ActionRSS x in duplicateActionRss) - newItems.Remove(x); - - foreach (Item i in toRemove) - ActionList.Remove(i); - - foreach (Item action in newItems) - ActionList.Add(action); - - prog.Invoke(totPct); + return duplicateActionRss; } } // ReSharper disable once InconsistentNaming diff --git a/TVRename/Forms/Preferences/AddEditSearchEngine.cs b/TVRename/Forms/Preferences/AddEditSearchEngine.cs index a60d670ec..84e560257 100644 --- a/TVRename/Forms/Preferences/AddEditSearchEngine.cs +++ b/TVRename/Forms/Preferences/AddEditSearchEngine.cs @@ -5,8 +5,14 @@ // // This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md // -using System.Windows.Forms; + +using System; using System.Drawing; +using System.Windows.Forms; +using SourceGrid; +using SourceGrid.Cells.Views; +using ColumnHeader = SourceGrid.Cells.ColumnHeader; +using ContentAlignment = DevAge.Drawing.ContentAlignment; namespace TVRename { @@ -22,7 +28,7 @@ namespace TVRename public partial class AddEditSearchEngine : Form { private CustomNameTagsFloatingWindow cntfw; - private SourceGrid.Grid grid1; + private Grid grid1; private readonly ProcessedEpisode sampleEpisode; private readonly Searchers mSearchers; @@ -46,12 +52,12 @@ public AddEditSearchEngine(Searchers s, ProcessedEpisode pe) private void SetupGrid() { - SourceGrid.Cells.Views.Cell titleModel = new SourceGrid.Cells.Views.Cell - { - BackColor = Color.SteelBlue, - ForeColor = Color.White, - TextAlignment = DevAge.Drawing.ContentAlignment.MiddleLeft - }; + Cell titleModel = new Cell + { + BackColor = Color.SteelBlue, + ForeColor = Color.White, + TextAlignment = DevAge.Drawing.ContentAlignment.MiddleLeft + }; grid1.Columns.Clear(); grid1.Rows.Clear(); @@ -67,25 +73,21 @@ private void SetupGrid() grid1.Columns[1].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize | SourceGrid.AutoSizeMode.EnableStretch; grid1.AutoStretchColumnsToFitWidth = true; - //Grid1->AutoSizeCells(); grid1.Columns.StretchToFit(); ////////////////////////////////////////////////////////////////////// // header row - SourceGrid.Cells.ColumnHeader h; - h = new SourceGrid.Cells.ColumnHeader("Name"); - h.AutomaticSortEnabled = false; + ColumnHeader h = new ColumnHeader("Name") { AutomaticSortEnabled = false }; grid1[0, 0] = h; grid1[0, 0].View = titleModel; - h = new SourceGrid.Cells.ColumnHeader("URL"); - h.AutomaticSortEnabled = false; + h = new SourceGrid.Cells.ColumnHeader("URL") { AutomaticSortEnabled = false }; grid1[0, 1] = h; grid1[0, 1].View = titleModel; } - public void AddNewRow() + private void AddNewRow() { int r = grid1.RowsCount; grid1.RowsCount = r + 1; @@ -94,17 +96,13 @@ public void AddNewRow() grid1[r, 1] = new SourceGrid.Cells.Cell("", typeof(string)); } - - - - - private void bnAdd_Click(object sender, System.EventArgs e) + private void bnAdd_Click(object sender, EventArgs e) { AddNewRow(); - grid1.Selection.Focus(new SourceGrid.Position(grid1.RowsCount - 1, 1), true); + grid1.Selection.Focus(new Position(grid1.RowsCount - 1, 1), true); } - private void bnDelete_Click(object sender, System.EventArgs e) + private void bnDelete_Click(object sender, EventArgs e) { // multiselection is off, so we can cheat... int[] rowsIndex = grid1.Selection.GetSelectionRegion().GetRowsIndex(); @@ -112,7 +110,7 @@ private void bnDelete_Click(object sender, System.EventArgs e) grid1.Rows.Remove(rowsIndex[0]); } - private void bnOK_Click(object sender, System.EventArgs e) + private void bnOK_Click(object sender, EventArgs e) { mSearchers.Clear(); for (int i = 1; i < grid1.RowsCount; i++) // skip header row @@ -124,7 +122,7 @@ private void bnOK_Click(object sender, System.EventArgs e) } } - private void bnTags_Click(object sender, System.EventArgs e) + private void bnTags_Click(object sender, EventArgs e) { cntfw = new CustomNameTagsFloatingWindow(sampleEpisode); cntfw.Show(this); diff --git a/TVRename/Forms/Preferences/CustomNameDesigner.cs b/TVRename/Forms/Preferences/CustomNameDesigner.cs index 8bd9f8fda..497a052aa 100644 --- a/TVRename/Forms/Preferences/CustomNameDesigner.cs +++ b/TVRename/Forms/Preferences/CustomNameDesigner.cs @@ -10,8 +10,6 @@ using System.Windows.Forms; using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; - - namespace TVRename { /// @@ -89,7 +87,6 @@ private void FillExamples() lvi.SubItems.Add(pre1 + ((seas != -1) ? seas.ToString() : "")); lvi.SubItems.Add(pre2 + ((ep != -1) ? ep.ToString() : "") + (maxEp != -1 ? "-" + maxEp : "")); - lvi.Tag = pe; diff --git a/TVRename/Forms/ShowPreferences/FolderBrowserDialogEx.cs b/TVRename/Forms/ShowPreferences/FolderBrowserDialogEx.cs index 3c90d7ef6..718a35eb0 100644 --- a/TVRename/Forms/ShowPreferences/FolderBrowserDialogEx.cs +++ b/TVRename/Forms/ShowPreferences/FolderBrowserDialogEx.cs @@ -577,7 +577,6 @@ public static bool ScreenToClient(IntPtr hWnd, ref RECT rc) [DllImport("user32.dll", SetLastError = true)] public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); - [DllImport("user32.dll", SetLastError = true)] public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow); diff --git a/TVRename/Forms/Supporting/CopyMoveProgress.Designer.cs b/TVRename/Forms/Supporting/CopyMoveProgress.Designer.cs index c6869be9a..843339196 100644 --- a/TVRename/Forms/Supporting/CopyMoveProgress.Designer.cs +++ b/TVRename/Forms/Supporting/CopyMoveProgress.Designer.cs @@ -6,7 +6,6 @@ // This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md // - namespace TVRename { partial class CopyMoveProgress diff --git a/TVRename/Forms/Supporting/CopyMoveProgress.cs b/TVRename/Forms/Supporting/CopyMoveProgress.cs index 791d936c9..1cd833927 100644 --- a/TVRename/Forms/Supporting/CopyMoveProgress.cs +++ b/TVRename/Forms/Supporting/CopyMoveProgress.cs @@ -45,8 +45,6 @@ public CopyMoveProgress(ActionEngine doc, ActionQueue[] todo) diskSpaceTimer.Start(); } - - private void SetPercentages(double file, double group) { if (file > 100) diff --git a/TVRename/Forms/Supporting/Filters.cs b/TVRename/Forms/Supporting/Filters.cs index dbc94aba5..6d22dd4d8 100644 --- a/TVRename/Forms/Supporting/Filters.cs +++ b/TVRename/Forms/Supporting/Filters.cs @@ -41,7 +41,6 @@ private void SetButtonStates() bool filterByShowNetwork = filter.ShowNetwork != null; cmbNetwork.SelectedItem = (filterByShowNetwork ? filter.ShowNetwork : ""); - //Filter By Genre foreach (string genre in filter.Genres) { @@ -103,4 +102,3 @@ private void bnReset_Click(object sender, EventArgs e) } } } - diff --git a/TVRename/Forms/Supporting/TVRenameSplash.cs b/TVRename/Forms/Supporting/TVRenameSplash.cs index 75e0e26a2..36d449586 100644 --- a/TVRename/Forms/Supporting/TVRenameSplash.cs +++ b/TVRename/Forms/Supporting/TVRenameSplash.cs @@ -13,7 +13,5 @@ public TVRenameSplash() public void UpdateStatus(string status) { lblStatus.Text = status; } public void UpdateProgress(int progress) { prgComplete.Value = progress; } public void UpdateInfo(string info) { lblInfo.Text = info; } - } } - diff --git a/TVRename/Forms/Tools/DupEpFinder.cs b/TVRename/Forms/Tools/DupEpFinder.cs index f2e9982ba..0c605b3fd 100644 --- a/TVRename/Forms/Tools/DupEpFinder.cs +++ b/TVRename/Forms/Tools/DupEpFinder.cs @@ -10,10 +10,10 @@ public partial class DupEpFinder : Form private List dupEps; private readonly TVDoc mDoc; private PossibleDuplicateEpisode mlastSelected; - private readonly UI mainUI; + private readonly UI mainUi; private ListViewItem mlastClicked; - public enum RightClickCommands + private enum RightClickCommands { none = 0, kEpisodeGuideForShow = 1, @@ -29,7 +29,7 @@ public DupEpFinder(List x, TVDoc doc, UI main) InitializeComponent(); dupEps = x; mDoc = doc; - mainUI = main; + mainUi = main; UpdateUI(); } @@ -165,27 +165,27 @@ private void duplicateRightClickMenu_ItemClicked(object sender, { case RightClickCommands.kEpisodeGuideForShow: // epguide if (mlastSelected != null) - mainUI.GotoEpguideFor(mlastSelected.Episode, true); + mainUi.GotoEpguideFor(mlastSelected.Episode, true); else { if (si != null) - mainUI.GotoEpguideFor(si, true); + mainUi.GotoEpguideFor(si, true); } Close(); break; case RightClickCommands.kForceRefreshSeries: if (si != null) - mainUI.ForceRefresh(new List {si}); + mainUi.ForceRefresh(new List {si}); Close(); break; case RightClickCommands.kEditShow: if (si != null) - mainUI.EditShow(si); + mainUi.EditShow(si); break; case RightClickCommands.kEditSeason: if (si != null) - mainUI.EditSeason(si, mlastSelected.SeasonNumber); + mainUi.EditSeason(si, mlastSelected.SeasonNumber); break; case RightClickCommands.kAddRule: if (mlastSelected != null) @@ -209,4 +209,3 @@ private void duplicateRightClickMenu_ItemClicked(object sender, } } } - diff --git a/TVRename/ItemsAndActions/ActionDownloadImage.cs b/TVRename/ItemsAndActions/ActionDownloadImage.cs index 1893588cf..2e92c2ea6 100644 --- a/TVRename/ItemsAndActions/ActionDownloadImage.cs +++ b/TVRename/ItemsAndActions/ActionDownloadImage.cs @@ -139,7 +139,6 @@ public override bool Go(ref bool pause, TVRenameStats stats) Done = true; return false; } - Done = true; return true; diff --git a/TVRename/ItemsAndActions/ActionMede8erXML.cs b/TVRename/ItemsAndActions/ActionMede8erXML.cs index 186fd39f4..d9197c8ea 100644 --- a/TVRename/ItemsAndActions/ActionMede8erXML.cs +++ b/TVRename/ItemsAndActions/ActionMede8erXML.cs @@ -45,7 +45,6 @@ public override bool Go(ref bool pause, TVRenameStats stats) Done = true; return true; - } catch (Exception e) { diff --git a/TVRename/ItemsAndActions/ActionWdtvMeta.cs b/TVRename/ItemsAndActions/ActionWdtvMeta.cs index 404cd2240..3f792c757 100644 --- a/TVRename/ItemsAndActions/ActionWdtvMeta.cs +++ b/TVRename/ItemsAndActions/ActionWdtvMeta.cs @@ -37,7 +37,6 @@ public override bool Go(ref bool pause, TVRenameStats stats) Error = true; Done = true; return false; - } if (Episode != null) return WriteEpisodeMetaDataFile(); diff --git a/TVRename/ItemsAndActions/ItemDownloading.cs b/TVRename/ItemsAndActions/ItemDownloading.cs index 913c6bc90..d9f60aef1 100644 --- a/TVRename/ItemsAndActions/ItemDownloading.cs +++ b/TVRename/ItemsAndActions/ItemDownloading.cs @@ -48,11 +48,19 @@ public override bool SameAs(Item o) public override int Compare(Item o) { if (!(o is ItemDownloading ut)) - { return 0;} + { + return 0; + } + if (Episode == null) - { return 1;} + { + return 1; + } + if (ut.Episode == null) - { return -1;} + { + return -1; + } return string.Compare((DesiredLocationNoExt), ut.DesiredLocationNoExt, StringComparison.Ordinal); } From 9a136ca6fe60c0ddbc7cc123a92510588959bac3 Mon Sep 17 00:00:00 2001 From: Chlorel Date: Tue, 16 Oct 2018 18:57:24 +0200 Subject: [PATCH 08/12] Conflit ? --- TVRename/Finders/RSSFinder.cs | 1 + TVRename/Forms/Preferences/AddEditSearchEngine.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/TVRename/Finders/RSSFinder.cs b/TVRename/Finders/RSSFinder.cs index 7d5a07c98..388626f8c 100644 --- a/TVRename/Finders/RSSFinder.cs +++ b/TVRename/Finders/RSSFinder.cs @@ -107,6 +107,7 @@ private static List FindDuplicates(ItemList newItems) } } } + return duplicateActionRss; } } diff --git a/TVRename/Forms/Preferences/AddEditSearchEngine.cs b/TVRename/Forms/Preferences/AddEditSearchEngine.cs index 84e560257..9febdbcfd 100644 --- a/TVRename/Forms/Preferences/AddEditSearchEngine.cs +++ b/TVRename/Forms/Preferences/AddEditSearchEngine.cs @@ -56,7 +56,7 @@ private void SetupGrid() { BackColor = Color.SteelBlue, ForeColor = Color.White, - TextAlignment = DevAge.Drawing.ContentAlignment.MiddleLeft + TextAlignment = ContentAlignment.MiddleLeft }; grid1.Columns.Clear(); grid1.Rows.Clear(); From 062d639a5203534209f347775d4168551f13aae9 Mon Sep 17 00:00:00 2001 From: Chlorel Date: Tue, 16 Oct 2018 18:59:34 +0200 Subject: [PATCH 09/12] Oops --- TVRename/Forms/Preferences/AddEditSearchEngine.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TVRename/Forms/Preferences/AddEditSearchEngine.cs b/TVRename/Forms/Preferences/AddEditSearchEngine.cs index 9febdbcfd..268610c44 100644 --- a/TVRename/Forms/Preferences/AddEditSearchEngine.cs +++ b/TVRename/Forms/Preferences/AddEditSearchEngine.cs @@ -82,7 +82,7 @@ private void SetupGrid() grid1[0, 0] = h; grid1[0, 0].View = titleModel; - h = new SourceGrid.Cells.ColumnHeader("URL") { AutomaticSortEnabled = false }; + h = new ColumnHeader("URL") { AutomaticSortEnabled = false }; grid1[0, 1] = h; grid1[0, 1].View = titleModel; } From 7397f761dde3812336339776327bcddb12cacd0d Mon Sep 17 00:00:00 2001 From: Chlorel Date: Tue, 16 Oct 2018 19:01:26 +0200 Subject: [PATCH 10/12] 4 spaces removing later .... --- TVRename/Forms/Preferences/AddEditSearchEngine.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TVRename/Forms/Preferences/AddEditSearchEngine.cs b/TVRename/Forms/Preferences/AddEditSearchEngine.cs index 268610c44..80fc976a0 100644 --- a/TVRename/Forms/Preferences/AddEditSearchEngine.cs +++ b/TVRename/Forms/Preferences/AddEditSearchEngine.cs @@ -78,11 +78,11 @@ private void SetupGrid() ////////////////////////////////////////////////////////////////////// // header row - ColumnHeader h = new ColumnHeader("Name") { AutomaticSortEnabled = false }; + ColumnHeader h = new ColumnHeader("Name") {AutomaticSortEnabled = false}; grid1[0, 0] = h; grid1[0, 0].View = titleModel; - h = new ColumnHeader("URL") { AutomaticSortEnabled = false }; + h = new ColumnHeader("URL") {AutomaticSortEnabled = false}; grid1[0, 1] = h; grid1[0, 1].View = titleModel; } From 99e2cb8b9ac1013fe19f1151cfa02a2c63227f90 Mon Sep 17 00:00:00 2001 From: Chlorel Date: Thu, 18 Oct 2018 13:11:30 +0200 Subject: [PATCH 11/12] Fix for https://groups.google.com/forum/#!topic/tvrename/sspgpyMLYpI --- TVRename/DownloadIdentifers/DownloadXBMCImages.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TVRename/DownloadIdentifers/DownloadXBMCImages.cs b/TVRename/DownloadIdentifers/DownloadXBMCImages.cs index dfe01e2a0..7fd94d5c6 100644 --- a/TVRename/DownloadIdentifers/DownloadXBMCImages.cs +++ b/TVRename/DownloadIdentifers/DownloadXBMCImages.cs @@ -126,7 +126,7 @@ public override ItemList ProcessSeason(ShowItem si, string folder, int snum, boo public override ItemList ProcessEpisode(ProcessedEpisode dbep, FileInfo filo, bool forceRefresh) { - if (TVSettings.Instance.EpTBNs || TVSettings.Instance.KODIImages) + if (TVSettings.Instance.EpTBNs) { ItemList theActionList = new ItemList(); if (dbep.Type == ProcessedEpisode.ProcessedEpisodeType.merged) From ba0234e4f631f4a45d962ca0fadfca7c4c528479 Mon Sep 17 00:00:00 2001 From: Chlorel Date: Sat, 27 Oct 2018 14:40:19 +0200 Subject: [PATCH 12/12] Up to last commit --- TVRename/Finders/DownloadFinder.cs | 49 + TVRename/Finders/FileFinder.cs | 78 +- TVRename/Finders/Finder.cs | 10 +- TVRename/Finders/JSONWebpageFinder.cs | 96 + TVRename/Finders/RSSFinder.cs | 55 +- TVRename/Finders/SABnzbdFinder.cs | 21 +- TVRename/Finders/TorrentFinder.cs | 29 +- TVRename/Finders/qBitTorrentFinder.cs | 4 +- TVRename/Finders/uTorrentFinder.cs | 4 +- .../Forms/Preferences/Preferences.Designer.cs | 4850 +++++++++-------- TVRename/Forms/Preferences/Preferences.cs | 54 +- TVRename/Forms/Preferences/Preferences.resx | 6 +- TVRename/Forms/ShowPreferences/AddEditShow.cs | 2 +- TVRename/Forms/UI.Designer.cs | 78 +- TVRename/Forms/UI.cs | 20 +- TVRename/Forms/UI.resx | 4 +- TVRename/Ipc/ActionWriteMetadata.cs | 42 + TVRename/ItemsAndActions/Action.cs | 45 + .../ItemsAndActions/ActionCopyMoveRename.cs | 6 + TVRename/ItemsAndActions/ActionDelete.cs | 133 +- .../ItemsAndActions/ActionDeleteDirectory.cs | 78 + TVRename/ItemsAndActions/ActionDeleteFile.cs | 69 + TVRename/ItemsAndActions/ActionDownload.cs | 14 + .../ItemsAndActions/ActionFileMetaData.cs | 14 + .../ItemsAndActions/ActionFileOperation.cs | 128 + TVRename/ItemsAndActions/ActionItem.cs | 283 - TVRename/ItemsAndActions/ActionItemSorter.cs | 2 +- .../ItemsAndActions/ActionMede8erViewXML.cs | 1 + TVRename/ItemsAndActions/ActionMede8erXML.cs | 1 + TVRename/ItemsAndActions/ActionQueue.cs | 20 + .../{ActionRSS.cs => ActionTDownload.cs} | 248 +- .../ItemsAndActions/ActionWriteMetadata.cs | 39 +- TVRename/ItemsAndActions/Item.cs | 60 + TVRename/ItemsAndActions/ItemDownloading.cs | 20 +- TVRename/ItemsAndActions/ItemList.cs | 31 + TVRename/ItemsAndActions/ItemMissing.cs | 5 + TVRename/Settings/CustomEpisodeName.cs | 8 + TVRename/Settings/CustomSeasonName.cs | 9 + TVRename/Settings/ProcessedEpisode.cs | 1 + TVRename/Settings/Searchers.cs | 2 +- TVRename/Settings/Settings.cs | 40 +- TVRename/TVRename.csproj | 15 +- TVRename/TVRename/ActionEngine.cs | 2 +- TVRename/TVRename/LVResults.cs | 6 +- TVRename/TVRename/TVDoc.cs | 341 +- TVRename/TheTVDB/Episode.cs | 22 +- TVRename/TheTVDB/Season.cs | 31 +- TVRename/TheTVDB/SeriesInfo.cs | 26 +- TVRename/Utility/BT.cs | 1 - TVRename/Utility/Helper/FileHelper.cs | 91 +- 50 files changed, 4016 insertions(+), 3178 deletions(-) create mode 100644 TVRename/Finders/DownloadFinder.cs create mode 100644 TVRename/Finders/JSONWebpageFinder.cs create mode 100644 TVRename/Ipc/ActionWriteMetadata.cs create mode 100644 TVRename/ItemsAndActions/Action.cs create mode 100644 TVRename/ItemsAndActions/ActionDeleteDirectory.cs create mode 100644 TVRename/ItemsAndActions/ActionDeleteFile.cs create mode 100644 TVRename/ItemsAndActions/ActionDownload.cs create mode 100644 TVRename/ItemsAndActions/ActionFileMetaData.cs create mode 100644 TVRename/ItemsAndActions/ActionFileOperation.cs delete mode 100644 TVRename/ItemsAndActions/ActionItem.cs create mode 100644 TVRename/ItemsAndActions/ActionQueue.cs rename TVRename/ItemsAndActions/{ActionRSS.cs => ActionTDownload.cs} (75%) create mode 100644 TVRename/ItemsAndActions/Item.cs create mode 100644 TVRename/ItemsAndActions/ItemList.cs diff --git a/TVRename/Finders/DownloadFinder.cs b/TVRename/Finders/DownloadFinder.cs new file mode 100644 index 000000000..3b3a84dd5 --- /dev/null +++ b/TVRename/Finders/DownloadFinder.cs @@ -0,0 +1,49 @@ +// +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// + +using System.Collections.Generic; + +namespace TVRename +{ + public abstract class DownloadFinder:Finder + { + protected DownloadFinder(TVDoc doc) : base(doc) + { + } + + protected static IEnumerable FindDuplicates(ItemList newItems) + { + //We now want to rationlise the newItems - just in case we've added duplicates + List duplicateActionRss = new List(); + + foreach (Item x in newItems) + { + if (!(x is ActionTDownload testActionRssOne)) + continue; + foreach (Item y in newItems) + { + if (!(y is ActionTDownload testActionRssTwo)) + continue; + if (x.Equals(y)) continue; + + string[] preferredTerms = TVSettings.Instance.PreferredRSSSearchTerms(); + + if (testActionRssOne.SourceName.ContainsOneOf(preferredTerms) && + !testActionRssTwo.SourceName.ContainsOneOf(preferredTerms)) + { + duplicateActionRss.Add(testActionRssTwo); + Logger.Info( + $"Removing {testActionRssTwo.Produces} as it is not as good a match as {testActionRssOne.Produces}"); + } + } + } + + return duplicateActionRss; + } + } +} diff --git a/TVRename/Finders/FileFinder.cs b/TVRename/Finders/FileFinder.cs index 52cb135b5..d5719ffb0 100644 --- a/TVRename/Finders/FileFinder.cs +++ b/TVRename/Finders/FileFinder.cs @@ -1,3 +1,11 @@ +// +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// + using System; using System.Collections.Generic; using System.Windows.Forms; @@ -37,15 +45,13 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) int currentItem = 0; int totalN = ActionList.Count; - foreach (Item action1 in ActionList) + foreach (ItemMissing me in ActionList.MissingItems()) { if (ActionCancel) return; prog.Invoke(startpct + ((totPct-startpct) * (++currentItem) / (totalN + 1))); - if (!(action1 is ItemMissing me)) continue; - ItemList thisRound = new ItemList(); List matchedFiles= new List(); @@ -60,19 +66,36 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) { if (!OtherActionsMatch(matchedFiles[0], me)) { - toRemove.Add(action1); + toRemove.Add(me); newList.AddRange(thisRound); } else { - Logger.Warn($"Ignoring potential match for {me.Episode.Show.ShowName} S{me.Episode.AppropriateSeasonNumber} E{action1.Episode.AppropriateEpNum}: with file {matchedFiles[0]?.TheFile.FullName} as there are multiple actions for that file"); + Logger.Warn($"Ignoring potential match for {me.Episode.Show.ShowName} S{me.Episode.AppropriateSeasonNumber} E{me.Episode.AppropriateEpNum}: with file {matchedFiles[0]?.TheFile.FullName} as there are multiple actions for that file"); + me.AddComment( + $"Ignoring potential match with file {matchedFiles[0]?.TheFile.FullName} as there are multiple actions for that file"); } } - else if (matchedFiles.Count > 1) + else if (matchedFiles.Count > 1) { - foreach (DirCacheEntry matchedFile in matchedFiles) + List bestMatchedFiles = IdentifyBestMatches(matchedFiles); + + if (bestMatchedFiles.Count == 1) { - Logger.Warn($"Ignoring potential match for {me.Episode.Show.ShowName} S{me.Episode.AppropriateSeasonNumber} E{action1.Episode.AppropriateEpNum}: with file {matchedFile?.TheFile.FullName} as there are multiple files for that action"); + //We have one file that is better, lets use it + toRemove.Add(me); + newList.AddRange(thisRound); + } + else + { + foreach (DirCacheEntry matchedFile in matchedFiles) + { + Logger.Warn( + $"Ignoring potential match for {me.Episode.Show.ShowName} S{me.Episode.AppropriateSeasonNumber} E{me.Episode.AppropriateEpNum}: with file {matchedFile?.TheFile.FullName} as there are multiple files for that action"); + + me.AddComment( + $"Ignoring potential match with file {matchedFile?.TheFile.FullName} as there are multiple files for that action"); + } } } } @@ -127,12 +150,34 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) ActionList.Add(i); } + private static List IdentifyBestMatches(List matchedFiles) + { + //See whether there are any of the matched files that stand out + List bestMatchedFiles = new List(); + foreach (DirCacheEntry matchedFile in matchedFiles) + { + //test first file against all the others + bool betterThanAllTheRest = true; + foreach (DirCacheEntry compareAgainst in matchedFiles) + { + if (matchedFile.TheFile.FullName == compareAgainst.TheFile.FullName) continue; + if (FileHelper.BetterQualityFile(matchedFile.TheFile, compareAgainst.TheFile) != + FileHelper.VideoComparison.FirstFileBetter) + { + betterThanAllTheRest = false; + } + } + if (betterThanAllTheRest) bestMatchedFiles.Add(matchedFile); + } + + return bestMatchedFiles; + } + private bool OtherActionsMatch(DirCacheEntry matchedFile, Item me) //This is used to check whether the selected file may match any other files we are looking for { - foreach (Item testAction in ActionList) + foreach (ItemMissing testMissingAction in ActionList.MissingItems()) { - if (!(testAction is ItemMissing testMissingAction)) continue; if (testMissingAction.SameAs(me)) continue; if (ReviewFile(testMissingAction, new ItemList(), matchedFile)) @@ -234,18 +279,7 @@ private static bool AlreadyHaveAction(ItemList actionlist, Item action) private static bool ActionListContains(ItemList actionlist, ActionCopyMoveRename newitem) { - foreach (Item ai2 in actionlist) - { - if (!(ai2 is ActionCopyMoveRename)) - continue; - - if (((ActionCopyMoveRename)(ai2)).SameSource(newitem)) - { - return true; - } - } - - return false; + return actionlist.CopyMoveItems().Any(cmAction => cmAction.SameSource(newitem)); } private bool ReviewFile(ItemMissing me, ItemList addTo, DirCacheEntry dce) diff --git a/TVRename/Finders/Finder.cs b/TVRename/Finders/Finder.cs index 328400ff8..79bf66b4a 100644 --- a/TVRename/Finders/Finder.cs +++ b/TVRename/Finders/Finder.cs @@ -2,14 +2,6 @@ namespace TVRename { public abstract class Finder { - public enum DownloadApp - { - // ReSharper disable once InconsistentNaming - SABnzbd, - uTorrent, - qBitTorrent - } - protected bool ActionCancel; protected readonly TVDoc Doc; protected static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger(); @@ -19,7 +11,7 @@ public enum DownloadApp protected Finder(TVDoc doc) => Doc = doc; // ReSharper disable once InconsistentNaming - public enum FinderDisplayType { local, downloading, rss} + public enum FinderDisplayType { local, downloading, search} public abstract void Check(SetProgressDelegate prog, int startpct, int totPct); diff --git a/TVRename/Finders/JSONWebpageFinder.cs b/TVRename/Finders/JSONWebpageFinder.cs new file mode 100644 index 000000000..d85966310 --- /dev/null +++ b/TVRename/Finders/JSONWebpageFinder.cs @@ -0,0 +1,96 @@ +// +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// + +using System; +using System.Net; +using Newtonsoft.Json.Linq; + +namespace TVRename +{ + // ReSharper disable once InconsistentNaming + internal class JSONFinder: DownloadFinder + { + public JSONFinder(TVDoc i) : base(i) { } + + public override bool Active() => TVSettings.Instance.SearchJSON; + + public override FinderDisplayType DisplayType() => FinderDisplayType.search; + + public override void Check(SetProgressDelegate prog, int startpct, int totPct) + { + int c = ActionList.Count + 2; + int n = 1; + prog.Invoke(startpct); + + ItemList newItems = new ItemList(); + ItemList toRemove = new ItemList(); + + foreach (ItemMissing action in ActionList.MissingItems()) + { + if (ActionCancel) + return; + + prog.Invoke(startpct + ((totPct - startpct) * (++n) / (c))); + + ProcessedEpisode pe = action.Episode; + string simpleShowName = Helpers.SimplifyName(action.Episode.Show.ShowName); + string simpleSeriesName = Helpers.SimplifyName(action.Episode.TheSeries.Name); + + string imdbId= action.Episode.TheSeries.GetImdbNumber(); + + + if (string.IsNullOrWhiteSpace(imdbId)) continue; + + try + { + WebClient client = new WebClient(); + client.Headers.Add("user-agent", + "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"); + string response = client.DownloadString($"{TVSettings.Instance.SearchJSONURL}{imdbId}"); + + JObject jsonResponse = JObject.Parse(response); + + foreach (JToken item in jsonResponse[TVSettings.Instance.SearchJSONRootNode]) + { + string itemName = (string)item[TVSettings.Instance.SearchJSONFilenameToken]; + string itemUrl = (string)item[TVSettings.Instance.SearchJSONURLToken]; + + if (!FileHelper.SimplifyAndCheckFilename(itemName, simpleShowName, true, false) && + !FileHelper.SimplifyAndCheckFilename(itemName, simpleSeriesName, true, false)) continue; + + if (!TVDoc.FindSeasEp(itemName, out int seas, out int ep, out int _, action.Episode.Show)) + continue; + + if (seas != pe.AppropriateSeasonNumber) continue; + if (ep != pe.AppropriateEpNum) continue; + + Logger.Info($"Adding {itemUrl} as it appears to be match for {pe.Show.ShowName} S{pe.AppropriateSeasonNumber}E{pe.AppropriateEpNum}"); + newItems.Add(new ActionTDownload(itemName, itemUrl, action.TheFileNoExt, pe)); + toRemove.Add(action); + } + + } + catch (NullReferenceException _) + { + //No entries for this show + } + } + + foreach (ActionTDownload x in FindDuplicates(newItems)) + newItems.Remove(x); + + foreach (Item i in toRemove) + ActionList.Remove(i); + + foreach (Item action in newItems) + ActionList.Add(action); + + prog.Invoke(totPct); + } + } +} diff --git a/TVRename/Finders/RSSFinder.cs b/TVRename/Finders/RSSFinder.cs index 388626f8c..4f7badf48 100644 --- a/TVRename/Finders/RSSFinder.cs +++ b/TVRename/Finders/RSSFinder.cs @@ -6,13 +6,13 @@ namespace TVRename { // ReSharper disable once InconsistentNaming - internal class RSSFinder:Finder + internal class RSSFinder: DownloadFinder { public RSSFinder(TVDoc i) : base(i) { } public override bool Active() => TVSettings.Instance.SearchRSS; - public override FinderDisplayType DisplayType() => FinderDisplayType.rss; + public override FinderDisplayType DisplayType() => FinderDisplayType.search; public override void Check(SetProgressDelegate prog, int startpct, int totPct) { @@ -27,16 +27,13 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) ItemList newItems = new ItemList(); ItemList toRemove = new ItemList(); - foreach (Item testItem in ActionList) + foreach (ItemMissing action in ActionList.MissingItems()) { if (ActionCancel) return; prog.Invoke(startpct + ((totPct - startpct) * (++n) / (c))); - if (!(testItem is ItemMissing action)) - continue; - ProcessedEpisode pe = action.Episode; string simpleShowName = Helpers.SimplifyName(pe.Show.ShowName); string simpleSeriesName = Helpers.SimplifyName(pe.TheSeries.Name); @@ -54,15 +51,13 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) if (rss.Season != pe.AppropriateSeasonNumber) continue; if (rss.Episode != pe.AppropriateEpNum) continue; - Logger.Info($"Adding {rss.URL} as it appears to be match for {testItem.Episode.Show.ShowName} S{testItem.Episode.AppropriateSeasonNumber}E{testItem.Episode.AppropriateEpNum}"); - newItems.Add(new ActionRSS(rss, action.TheFileNoExt, pe)); - toRemove.Add(testItem); + Logger.Info($"Adding {rss.URL} as it appears to be match for {action.Episode.Show.ShowName} S{action.Episode.AppropriateSeasonNumber}E{action.Episode.AppropriateEpNum}"); + newItems.Add(new ActionTDownload(rss, action.TheFileNoExt, pe)); + toRemove.Add(action); } } - List duplicateActionRss = FindDuplicates(newItems); - - foreach (ActionRSS x in duplicateActionRss) + foreach (ActionTDownload x in FindDuplicates(newItems)) newItems.Remove(x); foreach (Item i in toRemove) @@ -74,42 +69,6 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) prog.Invoke(totPct); } - private static List FindDuplicates(ItemList newItems) - { - //We now want to rationlise the newItems - just in case we've added duplicates - List duplicateActionRss = new List(); - - foreach (Item x in newItems) - { - if (!(x is ActionRSS testActionRssOne)) - continue; - foreach (Item y in newItems) - { - if (!(y is ActionRSS testActionRssTwo)) - continue; - if (x.Equals(y)) continue; - - string[] preferredTerms = TVSettings.Instance.PreferredRSSSearchTerms(); - - if (testActionRssOne.RSS.ShowName.ContainsOneOf(preferredTerms) && - !testActionRssTwo.RSS.ShowName.ContainsOneOf(preferredTerms)) - { - duplicateActionRss.Add(testActionRssTwo); - Logger.Info($"Removing {testActionRssTwo.RSS.URL} as it is not as good a match as {testActionRssOne.RSS.URL }"); - } - - if (testActionRssOne.RSS.Title.ContainsOneOf(preferredTerms) && - !testActionRssTwo.RSS.Title.ContainsOneOf(preferredTerms)) - { - duplicateActionRss.Add(testActionRssTwo); - Logger.Info( - $"Removing {testActionRssTwo.RSS.URL} as it is not as good a match as {testActionRssOne.RSS.URL}"); - } - } - } - - return duplicateActionRss; - } } // ReSharper disable once InconsistentNaming public class RSSItem diff --git a/TVRename/Finders/SABnzbdFinder.cs b/TVRename/Finders/SABnzbdFinder.cs index ab01c74a5..30b28da2f 100644 --- a/TVRename/Finders/SABnzbdFinder.cs +++ b/TVRename/Finders/SABnzbdFinder.cs @@ -1,3 +1,11 @@ +// +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// + using System; using System.Net; using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; @@ -5,14 +13,12 @@ namespace TVRename { // ReSharper disable once InconsistentNaming - class SABnzbdFinder :Finder + class SABnzbdFinder : DownloadingFinder { public SABnzbdFinder(TVDoc i) : base(i) { } public override bool Active() => TVSettings.Instance.CheckSABnzbd; - public override FinderDisplayType DisplayType() => FinderDisplayType.downloading; - public override void Check(SetProgressDelegate prog, int startpct, int totPct) { if (string.IsNullOrEmpty(TVSettings.Instance.SABAPIKey) || string.IsNullOrEmpty(TVSettings.Instance.SABHostPort)) @@ -72,18 +78,13 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) int c = ActionList.Count + 2; int n = 1; - foreach (Item action1 in ActionList) + foreach (ItemMissing action in ActionList.MissingItems()) { if (ActionCancel) return; prog.Invoke(startpct + ((totPct - startpct) * (++n) / (c))); - if (!(action1 is ItemMissing)) - continue; - - ItemMissing action = (ItemMissing)(action1); - string showname = Helpers.SimplifyName(action.Episode.Show.ShowName); foreach (SAB.QueueSlotsSlot te in sq.slots) @@ -93,7 +94,7 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) if (!FileHelper.SimplifyAndCheckFilename(file.FullName, showname, true, false)) continue; if (!TVDoc.FindSeasEp(file, out int seasF, out int epF, out int _, action.Episode.Show) || (seasF != action.Episode.AppropriateSeasonNumber) || (epF != action.Episode.AppropriateEpNum)) continue; - toRemove.Add(action1); + toRemove.Add(action); newList.Add(new ItemDownloading(te, action.Episode, action.TheFileNoExt, DownloadApp.SABnzbd)); break; } diff --git a/TVRename/Finders/TorrentFinder.cs b/TVRename/Finders/TorrentFinder.cs index 2493ce44f..2b6e90a96 100644 --- a/TVRename/Finders/TorrentFinder.cs +++ b/TVRename/Finders/TorrentFinder.cs @@ -1,30 +1,43 @@ +// +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// + using System.Collections.Generic; using System.Linq; using Alphaleonis.Win32.Filesystem; namespace TVRename { - internal abstract class TorrentFinder : Finder + public abstract class DownloadingFinder : Finder { + public enum DownloadApp + { + // ReSharper disable once InconsistentNaming + SABnzbd, + uTorrent, + qBitTorrent + } + public override FinderDisplayType DisplayType() => FinderDisplayType.downloading; - protected void SearchForAppropriateDownloads(SetProgressDelegate prog, int startpct, int totPct, List downloading, DownloadApp tApp) + protected void SearchForAppropriateDownloads(SetProgressDelegate prog, int startpct, int totPct, List downloading, DownloadingFinder.DownloadApp tApp) { ItemList newList = new ItemList(); ItemList toRemove = new ItemList(); int c = ActionList.Count + 2; int n = 1; prog.Invoke(startpct); - foreach (Item action1 in ActionList) + foreach (ItemMissing action in ActionList.MissingItems()) { if (ActionCancel) return; prog.Invoke(startpct + ((totPct - startpct) * (++n) / (c))); - if (!(action1 is ItemMissing action)) - continue; - foreach (TorrentEntry te in downloading) { FileInfo file = new FileInfo(te.DownloadingTo); @@ -38,7 +51,7 @@ protected void SearchForAppropriateDownloads(SetProgressDelegate prog, int start if (TVDoc.FindSeasEp(file, out int seasF, out int epF, out int _, action.Episode.Show) && (seasF == action.Episode.AppropriateSeasonNumber) && (epF == action.Episode.AppropriateEpNum)) { - toRemove.Add(action1); + toRemove.Add(action); newList.Add(new ItemDownloading(te, action.Episode, action.TheFileNoExt, tApp)); break; } @@ -54,7 +67,7 @@ protected void SearchForAppropriateDownloads(SetProgressDelegate prog, int start prog.Invoke(totPct); } - protected TorrentFinder(TVDoc doc) : base(doc) + protected DownloadingFinder(TVDoc doc) : base(doc) { } } diff --git a/TVRename/Finders/qBitTorrentFinder.cs b/TVRename/Finders/qBitTorrentFinder.cs index c7baff8bb..a05746789 100644 --- a/TVRename/Finders/qBitTorrentFinder.cs +++ b/TVRename/Finders/qBitTorrentFinder.cs @@ -7,7 +7,7 @@ namespace TVRename { // ReSharper disable once InconsistentNaming - internal class qBitTorrentFinder : TorrentFinder + internal class qBitTorrentFinder : DownloadingFinder { public qBitTorrentFinder(TVDoc i) : base(i) { } public override bool Active() => TVSettings.Instance.CheckqBitTorrent; @@ -15,7 +15,7 @@ public qBitTorrentFinder(TVDoc i) : base(i) { } public override void Check(SetProgressDelegate prog, int startpct, int totPct) { List downloading = GetqBitTorrentDownloads(); - SearchForAppropriateDownloads(prog, startpct, totPct, downloading, DownloadApp.qBitTorrent); + SearchForAppropriateDownloads(prog, startpct, totPct, downloading, DownloadingFinder.DownloadApp.qBitTorrent); } private static List GetqBitTorrentDownloads() diff --git a/TVRename/Finders/uTorrentFinder.cs b/TVRename/Finders/uTorrentFinder.cs index 115fdb68e..a06850916 100644 --- a/TVRename/Finders/uTorrentFinder.cs +++ b/TVRename/Finders/uTorrentFinder.cs @@ -4,7 +4,7 @@ namespace TVRename { // ReSharper disable once InconsistentNaming - internal class uTorrentFinder:TorrentFinder + internal class uTorrentFinder: DownloadingFinder { public uTorrentFinder(TVDoc i) : base(i) { } public override bool Active() => TVSettings.Instance.CheckuTorrent; @@ -22,7 +22,7 @@ public override void Check(SetProgressDelegate prog, int startpct, int totPct) List downloading = btr.AllFilesBeingDownloaded(); - SearchForAppropriateDownloads(prog, startpct, totPct, downloading, DownloadApp.uTorrent); + SearchForAppropriateDownloads(prog, startpct, totPct, downloading, DownloadingFinder.DownloadApp.uTorrent); } internal static void StartTorrentDownload(string torrentFileName, string directoryName = "") diff --git a/TVRename/Forms/Preferences/Preferences.Designer.cs b/TVRename/Forms/Preferences/Preferences.Designer.cs index 90ede532a..e9bd0e931 100644 --- a/TVRename/Forms/Preferences/Preferences.Designer.cs +++ b/TVRename/Forms/Preferences/Preferences.Designer.cs @@ -42,131 +42,112 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Preferences)); this.OKButton = new System.Windows.Forms.Button(); this.bnCancel = new System.Windows.Forms.Button(); - this.ReplacementsGrid = new SourceGrid.Grid(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.bnBrowseWTWICAL = new System.Windows.Forms.Button(); - this.txtWTWICAL = new System.Windows.Forms.TextBox(); - this.cbWTWICAL = new System.Windows.Forms.CheckBox(); - this.label4 = new System.Windows.Forms.Label(); - this.txtExportRSSDaysPast = new System.Windows.Forms.TextBox(); - this.bnBrowseWTWXML = new System.Windows.Forms.Button(); - this.txtWTWXML = new System.Windows.Forms.TextBox(); - this.cbWTWXML = new System.Windows.Forms.CheckBox(); - this.bnBrowseWTWRSS = new System.Windows.Forms.Button(); - this.txtWTWRSS = new System.Windows.Forms.TextBox(); - this.cbWTWRSS = new System.Windows.Forms.CheckBox(); - this.label17 = new System.Windows.Forms.Label(); - this.label16 = new System.Windows.Forms.Label(); - this.label15 = new System.Windows.Forms.Label(); - this.txtExportRSSMaxDays = new System.Windows.Forms.TextBox(); - this.txtExportRSSMaxShows = new System.Windows.Forms.TextBox(); this.saveFile = new System.Windows.Forms.SaveFileDialog(); - this.txtSpecialsFolderName = new System.Windows.Forms.TextBox(); - this.txtVideoExtensions = new System.Windows.Forms.TextBox(); - this.cbStartupTab = new System.Windows.Forms.ComboBox(); - this.cbShowEpisodePictures = new System.Windows.Forms.CheckBox(); - this.cbLeadingZero = new System.Windows.Forms.CheckBox(); - this.cbKeepTogether = new System.Windows.Forms.CheckBox(); - this.chkShowInTaskbar = new System.Windows.Forms.CheckBox(); - this.cbNotificationIcon = new System.Windows.Forms.CheckBox(); - this.txtWTWDays = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.label13 = new System.Windows.Forms.Label(); - this.label14 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tbGeneral = new System.Windows.Forms.TabPage(); - this.cbShowCollections = new System.Windows.Forms.CheckBox(); + this.folderBrowser = new System.Windows.Forms.FolderBrowserDialog(); + this.openFile = new System.Windows.Forms.OpenFileDialog(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.tbMovieTerms = new System.Windows.Forms.TextBox(); + this.tbIgnoreSuffixes = new System.Windows.Forms.TextBox(); + this.cbIgnoreNoVideoFolders = new System.Windows.Forms.CheckBox(); + this.cbIgnoreRecycleBin = new System.Windows.Forms.CheckBox(); + this.chkForceBulkAddToUseSettingsOnly = new System.Windows.Forms.CheckBox(); + this.cbMonitorFolder = new System.Windows.Forms.CheckBox(); + this.chkScanOnStartup = new System.Windows.Forms.CheckBox(); + this.chkScheduledScan = new System.Windows.Forms.CheckBox(); + this.txtEmptyIgnoreExtensions = new System.Windows.Forms.TextBox(); + this.txtEmptyIgnoreWords = new System.Windows.Forms.TextBox(); + this.colorDialog = new System.Windows.Forms.ColorDialog(); + this.cmDefaults = new System.Windows.Forms.ContextMenuStrip(this.components); + this.KODIToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.pyTivoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mede8erToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.noneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tpDisplay = new System.Windows.Forms.TabPage(); + this.txtSeasonFolderName = new System.Windows.Forms.TextBox(); + this.label35 = new System.Windows.Forms.Label(); this.chkHideWtWSpoilers = new System.Windows.Forms.CheckBox(); this.chkHideMyShowsSpoilers = new System.Windows.Forms.CheckBox(); - this.label37 = new System.Windows.Forms.Label(); - this.label38 = new System.Windows.Forms.Label(); - this.tbPercentDirty = new System.Windows.Forms.TextBox(); - this.cbMode = new System.Windows.Forms.ComboBox(); - this.label34 = new System.Windows.Forms.Label(); this.rbWTWScan = new System.Windows.Forms.RadioButton(); this.rbWTWSearch = new System.Windows.Forms.RadioButton(); - this.label10 = new System.Windows.Forms.Label(); - this.cbLookForAirdate = new System.Windows.Forms.CheckBox(); - this.cbLanguages = new System.Windows.Forms.ComboBox(); - this.label21 = new System.Windows.Forms.Label(); + this.cbStartupTab = new System.Windows.Forms.ComboBox(); this.cbAutoSelInMyShows = new System.Windows.Forms.CheckBox(); + this.cbShowEpisodePictures = new System.Windows.Forms.CheckBox(); this.label11 = new System.Windows.Forms.Label(); - this.label20 = new System.Windows.Forms.Label(); - this.txtParallelDownloads = new System.Windows.Forms.TextBox(); - this.tbFilesAndFolders = new System.Windows.Forms.TabPage(); - this.txtSeasonFormat = new System.Windows.Forms.TextBox(); - this.label47 = new System.Windows.Forms.Label(); - this.bnTags = new System.Windows.Forms.Button(); - this.txtKeepTogether = new System.Windows.Forms.TextBox(); - this.label39 = new System.Windows.Forms.Label(); - this.cbKeepTogetherMode = new System.Windows.Forms.ComboBox(); + this.label6 = new System.Windows.Forms.Label(); + this.chkShowInTaskbar = new System.Windows.Forms.CheckBox(); + this.cbNotificationIcon = new System.Windows.Forms.CheckBox(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.gbJSON = new System.Windows.Forms.GroupBox(); + this.label51 = new System.Windows.Forms.Label(); + this.tbJSONFilenameToken = new System.Windows.Forms.TextBox(); + this.label50 = new System.Windows.Forms.Label(); + this.tbJSONURLToken = new System.Windows.Forms.TextBox(); + this.label49 = new System.Windows.Forms.Label(); + this.tbJSONRootNode = new System.Windows.Forms.TextBox(); + this.label48 = new System.Windows.Forms.Label(); + this.tbJSONURL = new System.Windows.Forms.TextBox(); + this.gbRSS = new System.Windows.Forms.GroupBox(); + this.label45 = new System.Windows.Forms.Label(); + this.tbPreferredRSSTerms = new System.Windows.Forms.TextBox(); + this.RSSGrid = new SourceGrid.Grid(); + this.label25 = new System.Windows.Forms.Label(); + this.bnRSSRemove = new System.Windows.Forms.Button(); + this.bnRSSGo = new System.Windows.Forms.Button(); + this.bnRSSAdd = new System.Windows.Forms.Button(); + this.tpSubtitles = new System.Windows.Forms.TabPage(); + this.cbTxtToSub = new System.Windows.Forms.CheckBox(); + this.label46 = new System.Windows.Forms.Label(); + this.txtSubtitleExtensions = new System.Windows.Forms.TextBox(); + this.chkRetainLanguageSpecificSubtitles = new System.Windows.Forms.CheckBox(); + this.tpBulkAdd = new System.Windows.Forms.TabPage(); + this.groupBox9 = new System.Windows.Forms.GroupBox(); this.tbSeasonSearchTerms = new System.Windows.Forms.TextBox(); this.label36 = new System.Windows.Forms.Label(); - this.txtSeasonFolderName = new System.Windows.Forms.TextBox(); - this.label35 = new System.Windows.Forms.Label(); - this.bnReplaceRemove = new System.Windows.Forms.Button(); - this.bnReplaceAdd = new System.Windows.Forms.Button(); - this.label3 = new System.Windows.Forms.Label(); - this.label19 = new System.Windows.Forms.Label(); - this.txtMaxSampleSize = new System.Windows.Forms.TextBox(); - this.label22 = new System.Windows.Forms.Label(); - this.txtOtherExtensions = new System.Windows.Forms.TextBox(); - this.cbForceLower = new System.Windows.Forms.CheckBox(); - this.cbIgnoreSamples = new System.Windows.Forms.CheckBox(); - this.tbAutoExport = new System.Windows.Forms.TabPage(); - this.groupBox7 = new System.Windows.Forms.GroupBox(); - this.bnBrowseShowsHTML = new System.Windows.Forms.Button(); - this.cbShowsHTML = new System.Windows.Forms.CheckBox(); - this.txtShowsHTMLTo = new System.Windows.Forms.TextBox(); - this.bnBrowseShowsTXT = new System.Windows.Forms.Button(); - this.cbShowsTXT = new System.Windows.Forms.CheckBox(); - this.txtShowsTXTTo = new System.Windows.Forms.TextBox(); - this.groupBox5 = new System.Windows.Forms.GroupBox(); - this.bnBrowseFOXML = new System.Windows.Forms.Button(); - this.cbFOXML = new System.Windows.Forms.CheckBox(); - this.txtFOXML = new System.Windows.Forms.TextBox(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.bnBrowseRenamingXML = new System.Windows.Forms.Button(); - this.cbRenamingXML = new System.Windows.Forms.CheckBox(); - this.txtRenamingXML = new System.Windows.Forms.TextBox(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.bnBrowseMissingCSV = new System.Windows.Forms.Button(); - this.bnBrowseMissingXML = new System.Windows.Forms.Button(); - this.txtMissingCSV = new System.Windows.Forms.TextBox(); - this.cbMissingXML = new System.Windows.Forms.CheckBox(); - this.cbMissingCSV = new System.Windows.Forms.CheckBox(); - this.txtMissingXML = new System.Windows.Forms.TextBox(); - this.tpScanOptions = new System.Windows.Forms.TabPage(); - this.cbCheckqBitTorrent = new System.Windows.Forms.CheckBox(); - this.chkAutoMergeLibraryEpisodes = new System.Windows.Forms.CheckBox(); - this.chkAutoMergeDownloadEpisodes = new System.Windows.Forms.CheckBox(); - this.chkPreventMove = new System.Windows.Forms.CheckBox(); - this.label40 = new System.Windows.Forms.Label(); - this.cbxUpdateAirDate = new System.Windows.Forms.CheckBox(); - this.label33 = new System.Windows.Forms.Label(); - this.cbAutoCreateFolders = new System.Windows.Forms.CheckBox(); - this.label28 = new System.Windows.Forms.Label(); - this.cbSearchRSS = new System.Windows.Forms.CheckBox(); - this.cbRenameCheck = new System.Windows.Forms.CheckBox(); - this.cbMissing = new System.Windows.Forms.CheckBox(); - this.cbLeaveOriginals = new System.Windows.Forms.CheckBox(); - this.cbCheckSABnzbd = new System.Windows.Forms.CheckBox(); - this.cbCheckuTorrent = new System.Windows.Forms.CheckBox(); - this.cbSearchLocally = new System.Windows.Forms.CheckBox(); - this.tbFolderDeleting = new System.Windows.Forms.TabPage(); - this.cbCleanUpDownloadDir = new System.Windows.Forms.CheckBox(); - this.label32 = new System.Windows.Forms.Label(); - this.label30 = new System.Windows.Forms.Label(); - this.txtEmptyMaxSize = new System.Windows.Forms.TextBox(); - this.txtEmptyIgnoreWords = new System.Windows.Forms.TextBox(); - this.txtEmptyIgnoreExtensions = new System.Windows.Forms.TextBox(); - this.label31 = new System.Windows.Forms.Label(); - this.cbRecycleNotDelete = new System.Windows.Forms.CheckBox(); - this.cbEmptyMaxSize = new System.Windows.Forms.CheckBox(); - this.cbEmptyIgnoreWords = new System.Windows.Forms.CheckBox(); - this.cbEmptyIgnoreExtensions = new System.Windows.Forms.CheckBox(); - this.cbDeleteEmpty = new System.Windows.Forms.CheckBox(); + this.groupBox8 = new System.Windows.Forms.GroupBox(); + this.chkAutoSearchForDownloadedFiles = new System.Windows.Forms.CheckBox(); + this.label43 = new System.Windows.Forms.Label(); + this.label44 = new System.Windows.Forms.Label(); + this.tpTreeColoring = new System.Windows.Forms.TabPage(); + this.label7 = new System.Windows.Forms.Label(); + this.cboShowStatus = new System.Windows.Forms.ComboBox(); + this.label5 = new System.Windows.Forms.Label(); + this.txtShowStatusColor = new System.Windows.Forms.TextBox(); + this.btnSelectColor = new System.Windows.Forms.Button(); + this.bnRemoveDefinedColor = new System.Windows.Forms.Button(); + this.btnAddShowStatusColoring = new System.Windows.Forms.Button(); + this.lvwDefinedColors = new System.Windows.Forms.ListView(); + this.colShowStatus = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.colColor = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.tbuTorrentNZB = new System.Windows.Forms.TabPage(); + this.qBitTorrent = new System.Windows.Forms.GroupBox(); + this.tbqBitTorrentHost = new System.Windows.Forms.TextBox(); + this.tbqBitTorrentPort = new System.Windows.Forms.TextBox(); + this.label41 = new System.Windows.Forms.Label(); + this.label42 = new System.Windows.Forms.Label(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.txtSABHostPort = new System.Windows.Forms.TextBox(); + this.txtSABAPIKey = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.bnUTBrowseResumeDat = new System.Windows.Forms.Button(); + this.txtUTResumeDatPath = new System.Windows.Forms.TextBox(); + this.bnRSSBrowseuTorrent = new System.Windows.Forms.Button(); + this.label27 = new System.Windows.Forms.Label(); + this.label26 = new System.Windows.Forms.Label(); + this.txtRSSuTorrentPath = new System.Windows.Forms.TextBox(); + this.tbSearchFolders = new System.Windows.Forms.TabPage(); + this.label1 = new System.Windows.Forms.Label(); + this.domainUpDown1 = new System.Windows.Forms.DomainUpDown(); + this.lblScanAction = new System.Windows.Forms.Label(); + this.rdoQuickScan = new System.Windows.Forms.RadioButton(); + this.rdoRecentScan = new System.Windows.Forms.RadioButton(); + this.rdoFullScan = new System.Windows.Forms.RadioButton(); + this.bnOpenSearchFolder = new System.Windows.Forms.Button(); + this.bnRemoveSearchFolder = new System.Windows.Forms.Button(); + this.bnAddSearchFolder = new System.Windows.Forms.Button(); + this.lbSearchFolders = new System.Windows.Forms.ListBox(); + this.label23 = new System.Windows.Forms.Label(); this.tbMediaCenter = new System.Windows.Forms.TabPage(); this.cbWDLiveEpisodeFiles = new System.Windows.Forms.CheckBox(); this.cbNFOEpisodes = new System.Windows.Forms.CheckBox(); @@ -191,113 +172,155 @@ private void InitializeComponent() this.cbNFOShows = new System.Windows.Forms.CheckBox(); this.cbFantArtJpg = new System.Windows.Forms.CheckBox(); this.cbFolderJpg = new System.Windows.Forms.CheckBox(); - this.tbSearchFolders = new System.Windows.Forms.TabPage(); - this.label1 = new System.Windows.Forms.Label(); - this.domainUpDown1 = new System.Windows.Forms.DomainUpDown(); - this.chkScheduledScan = new System.Windows.Forms.CheckBox(); - this.chkScanOnStartup = new System.Windows.Forms.CheckBox(); - this.lblScanAction = new System.Windows.Forms.Label(); - this.rdoQuickScan = new System.Windows.Forms.RadioButton(); - this.rdoRecentScan = new System.Windows.Forms.RadioButton(); - this.rdoFullScan = new System.Windows.Forms.RadioButton(); - this.cbMonitorFolder = new System.Windows.Forms.CheckBox(); - this.bnOpenSearchFolder = new System.Windows.Forms.Button(); - this.bnRemoveSearchFolder = new System.Windows.Forms.Button(); - this.bnAddSearchFolder = new System.Windows.Forms.Button(); - this.lbSearchFolders = new System.Windows.Forms.ListBox(); - this.label23 = new System.Windows.Forms.Label(); - this.tbuTorrentNZB = new System.Windows.Forms.TabPage(); - this.qBitTorrent = new System.Windows.Forms.GroupBox(); - this.tbqBitTorrentHost = new System.Windows.Forms.TextBox(); - this.tbqBitTorrentPort = new System.Windows.Forms.TextBox(); - this.label41 = new System.Windows.Forms.Label(); - this.label42 = new System.Windows.Forms.Label(); - this.label45 = new System.Windows.Forms.Label(); - this.tbPreferredRSSTerms = new System.Windows.Forms.TextBox(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.txtSABHostPort = new System.Windows.Forms.TextBox(); - this.txtSABAPIKey = new System.Windows.Forms.TextBox(); - this.label8 = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); - this.groupBox6 = new System.Windows.Forms.GroupBox(); - this.bnUTBrowseResumeDat = new System.Windows.Forms.Button(); - this.txtUTResumeDatPath = new System.Windows.Forms.TextBox(); - this.bnRSSBrowseuTorrent = new System.Windows.Forms.Button(); - this.label27 = new System.Windows.Forms.Label(); - this.label26 = new System.Windows.Forms.Label(); - this.txtRSSuTorrentPath = new System.Windows.Forms.TextBox(); - this.RSSGrid = new SourceGrid.Grid(); - this.bnRSSRemove = new System.Windows.Forms.Button(); - this.bnRSSAdd = new System.Windows.Forms.Button(); - this.bnRSSGo = new System.Windows.Forms.Button(); - this.label25 = new System.Windows.Forms.Label(); - this.tpTreeColoring = new System.Windows.Forms.TabPage(); - this.label7 = new System.Windows.Forms.Label(); - this.cboShowStatus = new System.Windows.Forms.ComboBox(); - this.label5 = new System.Windows.Forms.Label(); - this.txtShowStatusColor = new System.Windows.Forms.TextBox(); - this.btnSelectColor = new System.Windows.Forms.Button(); - this.bnRemoveDefinedColor = new System.Windows.Forms.Button(); - this.btnAddShowStatusColoring = new System.Windows.Forms.Button(); - this.lvwDefinedColors = new System.Windows.Forms.ListView(); - this.colShowStatus = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.colColor = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.tpBulkAdd = new System.Windows.Forms.TabPage(); - this.groupBox9 = new System.Windows.Forms.GroupBox(); - this.chkForceBulkAddToUseSettingsOnly = new System.Windows.Forms.CheckBox(); - this.cbIgnoreRecycleBin = new System.Windows.Forms.CheckBox(); - this.cbIgnoreNoVideoFolders = new System.Windows.Forms.CheckBox(); - this.groupBox8 = new System.Windows.Forms.GroupBox(); - this.chkAutoSearchForDownloadedFiles = new System.Windows.Forms.CheckBox(); - this.label43 = new System.Windows.Forms.Label(); - this.label44 = new System.Windows.Forms.Label(); - this.tbIgnoreSuffixes = new System.Windows.Forms.TextBox(); - this.tbMovieTerms = new System.Windows.Forms.TextBox(); - this.tpSubtitles = new System.Windows.Forms.TabPage(); - this.cbTxtToSub = new System.Windows.Forms.CheckBox(); - this.label46 = new System.Windows.Forms.Label(); - this.txtSubtitleExtensions = new System.Windows.Forms.TextBox(); - this.chkRetainLanguageSpecificSubtitles = new System.Windows.Forms.CheckBox(); - this.folderBrowser = new System.Windows.Forms.FolderBrowserDialog(); - this.openFile = new System.Windows.Forms.OpenFileDialog(); - this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.colorDialog = new System.Windows.Forms.ColorDialog(); - this.cmDefaults = new System.Windows.Forms.ContextMenuStrip(this.components); - this.KODIToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.pyTivoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.mede8erToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.noneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.tbFolderDeleting = new System.Windows.Forms.TabPage(); + this.cbCleanUpDownloadDir = new System.Windows.Forms.CheckBox(); + this.label32 = new System.Windows.Forms.Label(); + this.label30 = new System.Windows.Forms.Label(); + this.txtEmptyMaxSize = new System.Windows.Forms.TextBox(); + this.label31 = new System.Windows.Forms.Label(); + this.cbRecycleNotDelete = new System.Windows.Forms.CheckBox(); + this.cbEmptyMaxSize = new System.Windows.Forms.CheckBox(); + this.cbEmptyIgnoreWords = new System.Windows.Forms.CheckBox(); + this.cbEmptyIgnoreExtensions = new System.Windows.Forms.CheckBox(); + this.cbDeleteEmpty = new System.Windows.Forms.CheckBox(); + this.tpScanOptions = new System.Windows.Forms.TabPage(); + this.cbHigherQuality = new System.Windows.Forms.CheckBox(); + this.cbSearchJSON = new System.Windows.Forms.CheckBox(); + this.cbCheckqBitTorrent = new System.Windows.Forms.CheckBox(); + this.chkAutoMergeLibraryEpisodes = new System.Windows.Forms.CheckBox(); + this.chkAutoMergeDownloadEpisodes = new System.Windows.Forms.CheckBox(); + this.chkPreventMove = new System.Windows.Forms.CheckBox(); + this.label40 = new System.Windows.Forms.Label(); + this.cbxUpdateAirDate = new System.Windows.Forms.CheckBox(); + this.label33 = new System.Windows.Forms.Label(); + this.cbAutoCreateFolders = new System.Windows.Forms.CheckBox(); + this.label28 = new System.Windows.Forms.Label(); + this.cbSearchRSS = new System.Windows.Forms.CheckBox(); + this.cbRenameCheck = new System.Windows.Forms.CheckBox(); + this.cbMissing = new System.Windows.Forms.CheckBox(); + this.cbLeaveOriginals = new System.Windows.Forms.CheckBox(); + this.cbCheckSABnzbd = new System.Windows.Forms.CheckBox(); + this.cbCheckuTorrent = new System.Windows.Forms.CheckBox(); + this.cbSearchLocally = new System.Windows.Forms.CheckBox(); + this.tbAutoExport = new System.Windows.Forms.TabPage(); + this.groupBox7 = new System.Windows.Forms.GroupBox(); + this.bnBrowseShowsHTML = new System.Windows.Forms.Button(); + this.cbShowsHTML = new System.Windows.Forms.CheckBox(); + this.txtShowsHTMLTo = new System.Windows.Forms.TextBox(); + this.bnBrowseShowsTXT = new System.Windows.Forms.Button(); + this.cbShowsTXT = new System.Windows.Forms.CheckBox(); + this.txtShowsTXTTo = new System.Windows.Forms.TextBox(); + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.bnBrowseFOXML = new System.Windows.Forms.Button(); + this.cbFOXML = new System.Windows.Forms.CheckBox(); + this.txtFOXML = new System.Windows.Forms.TextBox(); + this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.bnBrowseRenamingXML = new System.Windows.Forms.Button(); + this.cbRenamingXML = new System.Windows.Forms.CheckBox(); + this.txtRenamingXML = new System.Windows.Forms.TextBox(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.bnBrowseMissingCSV = new System.Windows.Forms.Button(); + this.bnBrowseMissingXML = new System.Windows.Forms.Button(); + this.txtMissingCSV = new System.Windows.Forms.TextBox(); + this.cbMissingXML = new System.Windows.Forms.CheckBox(); + this.cbMissingCSV = new System.Windows.Forms.CheckBox(); + this.txtMissingXML = new System.Windows.Forms.TextBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.bnBrowseWTWICAL = new System.Windows.Forms.Button(); + this.txtWTWICAL = new System.Windows.Forms.TextBox(); + this.cbWTWICAL = new System.Windows.Forms.CheckBox(); + this.label4 = new System.Windows.Forms.Label(); + this.txtExportRSSDaysPast = new System.Windows.Forms.TextBox(); + this.bnBrowseWTWXML = new System.Windows.Forms.Button(); + this.txtWTWXML = new System.Windows.Forms.TextBox(); + this.cbWTWXML = new System.Windows.Forms.CheckBox(); + this.bnBrowseWTWRSS = new System.Windows.Forms.Button(); + this.txtWTWRSS = new System.Windows.Forms.TextBox(); + this.cbWTWRSS = new System.Windows.Forms.CheckBox(); + this.label17 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.txtExportRSSMaxDays = new System.Windows.Forms.TextBox(); + this.txtExportRSSMaxShows = new System.Windows.Forms.TextBox(); + this.tbFilesAndFolders = new System.Windows.Forms.TabPage(); + this.label53 = new System.Windows.Forms.Label(); + this.label54 = new System.Windows.Forms.Label(); + this.tbPercentBetter = new System.Windows.Forms.TextBox(); + this.tbPriorityOverrideTerms = new System.Windows.Forms.TextBox(); + this.label52 = new System.Windows.Forms.Label(); + this.txtSeasonFormat = new System.Windows.Forms.TextBox(); + this.txtKeepTogether = new System.Windows.Forms.TextBox(); + this.txtMaxSampleSize = new System.Windows.Forms.TextBox(); + this.txtSpecialsFolderName = new System.Windows.Forms.TextBox(); + this.txtOtherExtensions = new System.Windows.Forms.TextBox(); + this.txtVideoExtensions = new System.Windows.Forms.TextBox(); + this.label47 = new System.Windows.Forms.Label(); + this.bnTags = new System.Windows.Forms.Button(); + this.label39 = new System.Windows.Forms.Label(); + this.cbKeepTogetherMode = new System.Windows.Forms.ComboBox(); + this.bnReplaceRemove = new System.Windows.Forms.Button(); + this.bnReplaceAdd = new System.Windows.Forms.Button(); + this.label3 = new System.Windows.Forms.Label(); + this.ReplacementsGrid = new SourceGrid.Grid(); + this.label19 = new System.Windows.Forms.Label(); + this.label22 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.cbKeepTogether = new System.Windows.Forms.CheckBox(); + this.cbForceLower = new System.Windows.Forms.CheckBox(); + this.cbIgnoreSamples = new System.Windows.Forms.CheckBox(); + this.cbLeadingZero = new System.Windows.Forms.CheckBox(); + this.tbGeneral = new System.Windows.Forms.TabPage(); + this.label37 = new System.Windows.Forms.Label(); + this.label38 = new System.Windows.Forms.Label(); + this.tbPercentDirty = new System.Windows.Forms.TextBox(); + this.txtParallelDownloads = new System.Windows.Forms.TextBox(); + this.txtWTWDays = new System.Windows.Forms.TextBox(); + this.cbMode = new System.Windows.Forms.ComboBox(); + this.label34 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.cbLookForAirdate = new System.Windows.Forms.CheckBox(); + this.cbLanguages = new System.Windows.Forms.ComboBox(); + this.label21 = new System.Windows.Forms.Label(); + this.label20 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.tpSearch = new System.Windows.Forms.TabControl(); + this.cbShowCollections = new System.Windows.Forms.CheckBox(); this.cbDeleteShowFromDisk = new System.Windows.Forms.CheckBox(); - this.groupBox2.SuspendLayout(); - this.tabControl1.SuspendLayout(); - this.tbGeneral.SuspendLayout(); - this.tbFilesAndFolders.SuspendLayout(); + this.cmDefaults.SuspendLayout(); + this.tpDisplay.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.gbJSON.SuspendLayout(); + this.gbRSS.SuspendLayout(); + this.tpSubtitles.SuspendLayout(); + this.tpBulkAdd.SuspendLayout(); + this.groupBox9.SuspendLayout(); + this.groupBox8.SuspendLayout(); + this.tpTreeColoring.SuspendLayout(); + this.tbuTorrentNZB.SuspendLayout(); + this.qBitTorrent.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.groupBox6.SuspendLayout(); + this.tbSearchFolders.SuspendLayout(); + this.tbMediaCenter.SuspendLayout(); + this.panel1.SuspendLayout(); + this.tbFolderDeleting.SuspendLayout(); + this.tpScanOptions.SuspendLayout(); this.tbAutoExport.SuspendLayout(); this.groupBox7.SuspendLayout(); this.groupBox5.SuspendLayout(); this.groupBox4.SuspendLayout(); this.groupBox3.SuspendLayout(); - this.tpScanOptions.SuspendLayout(); - this.tbFolderDeleting.SuspendLayout(); - this.tbMediaCenter.SuspendLayout(); - this.panel1.SuspendLayout(); - this.tbSearchFolders.SuspendLayout(); - this.tbuTorrentNZB.SuspendLayout(); - this.qBitTorrent.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.groupBox6.SuspendLayout(); - this.tpTreeColoring.SuspendLayout(); - this.tpBulkAdd.SuspendLayout(); - this.groupBox9.SuspendLayout(); - this.groupBox8.SuspendLayout(); - this.tpSubtitles.SuspendLayout(); - this.cmDefaults.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.tbFilesAndFolders.SuspendLayout(); + this.tbGeneral.SuspendLayout(); + this.tpSearch.SuspendLayout(); this.SuspendLayout(); // // OKButton // this.OKButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.OKButton.Location = new System.Drawing.Point(369, 554); + this.OKButton.Location = new System.Drawing.Point(389, 488); this.OKButton.Name = "OKButton"; this.OKButton.Size = new System.Drawing.Size(75, 23); this.OKButton.TabIndex = 0; @@ -309,7 +332,7 @@ private void InitializeComponent() // this.bnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.bnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.bnCancel.Location = new System.Drawing.Point(450, 554); + this.bnCancel.Location = new System.Drawing.Point(470, 488); this.bnCancel.Name = "bnCancel"; this.bnCancel.Size = new System.Drawing.Size(75, 23); this.bnCancel.TabIndex = 1; @@ -317,223 +340,253 @@ private void InitializeComponent() this.bnCancel.UseVisualStyleBackColor = true; this.bnCancel.Click += new System.EventHandler(this.CancelButton_Click); // - // ReplacementsGrid + // saveFile // - this.ReplacementsGrid.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.ReplacementsGrid.BackColor = System.Drawing.SystemColors.Window; - this.ReplacementsGrid.EnableSort = true; - this.ReplacementsGrid.Location = new System.Drawing.Point(6, 19); - this.ReplacementsGrid.Name = "ReplacementsGrid"; - this.ReplacementsGrid.OptimizeMode = SourceGrid.CellOptimizeMode.ForRows; - this.ReplacementsGrid.SelectionMode = SourceGrid.GridSelectionMode.Cell; - this.ReplacementsGrid.Size = new System.Drawing.Size(497, 62); - this.ReplacementsGrid.TabIndex = 1; - this.ReplacementsGrid.TabStop = true; - this.ReplacementsGrid.ToolTipText = ""; + this.saveFile.Filter = "RSS files (*.rss)|*.rss|XML files (*.xml)|*.xml|CSV files (*.csv)|*.csv|TXT files" + + " (*.txt)|*.txt|HTML files (*.html)|*.html|iCal files (*.ics)|*.ics|All files (*." + + "*)|*.*"; // - // groupBox2 + // folderBrowser // - this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox2.Controls.Add(this.bnBrowseWTWICAL); - this.groupBox2.Controls.Add(this.txtWTWICAL); - this.groupBox2.Controls.Add(this.cbWTWICAL); - this.groupBox2.Controls.Add(this.label4); - this.groupBox2.Controls.Add(this.txtExportRSSDaysPast); - this.groupBox2.Controls.Add(this.bnBrowseWTWXML); - this.groupBox2.Controls.Add(this.txtWTWXML); - this.groupBox2.Controls.Add(this.cbWTWXML); - this.groupBox2.Controls.Add(this.bnBrowseWTWRSS); - this.groupBox2.Controls.Add(this.txtWTWRSS); - this.groupBox2.Controls.Add(this.cbWTWRSS); - this.groupBox2.Controls.Add(this.label17); - this.groupBox2.Controls.Add(this.label16); - this.groupBox2.Controls.Add(this.label15); - this.groupBox2.Controls.Add(this.txtExportRSSMaxDays); - this.groupBox2.Controls.Add(this.txtExportRSSMaxShows); - this.groupBox2.Location = new System.Drawing.Point(6, 6); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(497, 135); - this.groupBox2.TabIndex = 0; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "When to Watch"; + this.folderBrowser.ShowNewFolderButton = false; // - // bnBrowseWTWICAL + // openFile // - this.bnBrowseWTWICAL.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.bnBrowseWTWICAL.Location = new System.Drawing.Point(414, 76); - this.bnBrowseWTWICAL.Name = "bnBrowseWTWICAL"; - this.bnBrowseWTWICAL.Size = new System.Drawing.Size(75, 23); - this.bnBrowseWTWICAL.TabIndex = 24; - this.bnBrowseWTWICAL.Text = "Browse..."; - this.bnBrowseWTWICAL.UseVisualStyleBackColor = true; - this.bnBrowseWTWICAL.Click += new System.EventHandler(this.bnBrowseWTWICAL_Click); + this.openFile.Filter = "Torrent files (*.torrent)|*.torrent|All files (*.*)|*.*"; // - // txtWTWICAL + // tbMovieTerms // - this.txtWTWICAL.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.tbMovieTerms.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txtWTWICAL.Location = new System.Drawing.Point(65, 78); - this.txtWTWICAL.Name = "txtWTWICAL"; - this.txtWTWICAL.Size = new System.Drawing.Size(342, 20); - this.txtWTWICAL.TabIndex = 23; - // - // cbWTWICAL - // - this.cbWTWICAL.AutoSize = true; - this.cbWTWICAL.Location = new System.Drawing.Point(8, 80); - this.cbWTWICAL.Name = "cbWTWICAL"; - this.cbWTWICAL.Size = new System.Drawing.Size(43, 17); - this.cbWTWICAL.TabIndex = 22; - this.cbWTWICAL.Text = "iCal"; - this.cbWTWICAL.UseVisualStyleBackColor = true; - this.cbWTWICAL.CheckedChanged += new System.EventHandler(this.EnableDisable); + this.tbMovieTerms.Location = new System.Drawing.Point(99, 40); + this.tbMovieTerms.Name = "tbMovieTerms"; + this.tbMovieTerms.Size = new System.Drawing.Size(415, 20); + this.tbMovieTerms.TabIndex = 13; + this.toolTip1.SetToolTip(this.tbMovieTerms, "If a filename contains any of these terms then it is assumed\r\nthat it is a Film a" + + "nd not a TV Show. Hence \'Auto Add\' is not\r\ninvoked for this file."); // - // label4 + // tbIgnoreSuffixes // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(330, 109); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(59, 13); - this.label4.TabIndex = 21; - this.label4.Text = "in the past."; + this.tbIgnoreSuffixes.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbIgnoreSuffixes.Location = new System.Drawing.Point(99, 66); + this.tbIgnoreSuffixes.Name = "tbIgnoreSuffixes"; + this.tbIgnoreSuffixes.Size = new System.Drawing.Size(415, 20); + this.tbIgnoreSuffixes.TabIndex = 15; + this.toolTip1.SetToolTip(this.tbIgnoreSuffixes, "These terms and any text after them will be ignored when\r\nsearching on TVDB for t" + + "he show title based on the filename."); // - // txtExportRSSDaysPast + // cbIgnoreNoVideoFolders // - this.txtExportRSSDaysPast.Location = new System.Drawing.Point(294, 106); - this.txtExportRSSDaysPast.Name = "txtExportRSSDaysPast"; - this.txtExportRSSDaysPast.Size = new System.Drawing.Size(28, 20); - this.txtExportRSSDaysPast.TabIndex = 20; + this.cbIgnoreNoVideoFolders.AutoSize = true; + this.cbIgnoreNoVideoFolders.Location = new System.Drawing.Point(6, 19); + this.cbIgnoreNoVideoFolders.Name = "cbIgnoreNoVideoFolders"; + this.cbIgnoreNoVideoFolders.Size = new System.Drawing.Size(225, 17); + this.cbIgnoreNoVideoFolders.TabIndex = 13; + this.cbIgnoreNoVideoFolders.Text = "&Only Include Folders containing Video files"; + this.toolTip1.SetToolTip(this.cbIgnoreNoVideoFolders, "If set then only folders that contain video files are considered for the \'Bulk Ad" + + "d\' feature"); + this.cbIgnoreNoVideoFolders.UseVisualStyleBackColor = true; // - // bnBrowseWTWXML + // cbIgnoreRecycleBin // - this.bnBrowseWTWXML.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.bnBrowseWTWXML.Location = new System.Drawing.Point(521, 47); - this.bnBrowseWTWXML.Name = "bnBrowseWTWXML"; - this.bnBrowseWTWXML.Size = new System.Drawing.Size(75, 23); - this.bnBrowseWTWXML.TabIndex = 19; - this.bnBrowseWTWXML.Text = "Browse..."; - this.bnBrowseWTWXML.UseVisualStyleBackColor = true; - this.bnBrowseWTWXML.Click += new System.EventHandler(this.bnBrowseWTWXML_Click); + this.cbIgnoreRecycleBin.AutoSize = true; + this.cbIgnoreRecycleBin.Location = new System.Drawing.Point(6, 42); + this.cbIgnoreRecycleBin.Name = "cbIgnoreRecycleBin"; + this.cbIgnoreRecycleBin.Size = new System.Drawing.Size(116, 17); + this.cbIgnoreRecycleBin.TabIndex = 14; + this.cbIgnoreRecycleBin.Text = "Ignore &Recycle Bin"; + this.toolTip1.SetToolTip(this.cbIgnoreRecycleBin, "If set then Bulk Add ignores all files in the Recycle Bin"); + this.cbIgnoreRecycleBin.UseVisualStyleBackColor = true; // - // txtWTWXML + // chkForceBulkAddToUseSettingsOnly // - this.txtWTWXML.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtWTWXML.Location = new System.Drawing.Point(65, 49); - this.txtWTWXML.Name = "txtWTWXML"; - this.txtWTWXML.Size = new System.Drawing.Size(423, 20); - this.txtWTWXML.TabIndex = 18; + this.chkForceBulkAddToUseSettingsOnly.AutoSize = true; + this.chkForceBulkAddToUseSettingsOnly.Location = new System.Drawing.Point(6, 65); + this.chkForceBulkAddToUseSettingsOnly.Name = "chkForceBulkAddToUseSettingsOnly"; + this.chkForceBulkAddToUseSettingsOnly.Size = new System.Drawing.Size(248, 17); + this.chkForceBulkAddToUseSettingsOnly.TabIndex = 15; + this.chkForceBulkAddToUseSettingsOnly.Text = "Force to Use Season Words from Settings Only"; + this.toolTip1.SetToolTip(this.chkForceBulkAddToUseSettingsOnly, "If set then Bulk Add just uses the season words from settings. If not set (recomm" + + "ended) then Bulk Add finds addition season words from each show\'s configuration." + + ""); + this.chkForceBulkAddToUseSettingsOnly.UseVisualStyleBackColor = true; // - // cbWTWXML + // cbMonitorFolder // - this.cbWTWXML.AutoSize = true; - this.cbWTWXML.Location = new System.Drawing.Point(8, 51); - this.cbWTWXML.Name = "cbWTWXML"; - this.cbWTWXML.Size = new System.Drawing.Size(48, 17); - this.cbWTWXML.TabIndex = 17; - this.cbWTWXML.Text = "XML"; - this.cbWTWXML.UseVisualStyleBackColor = true; - this.cbWTWXML.CheckedChanged += new System.EventHandler(this.EnableDisable); + this.cbMonitorFolder.AutoSize = true; + this.cbMonitorFolder.Location = new System.Drawing.Point(3, 111); + this.cbMonitorFolder.Name = "cbMonitorFolder"; + this.cbMonitorFolder.Size = new System.Drawing.Size(154, 17); + this.cbMonitorFolder.TabIndex = 5; + this.cbMonitorFolder.Text = "&Monitor folders for changes"; + this.toolTip1.SetToolTip(this.cbMonitorFolder, "If the contents of any of these folder change, then automatically do a \"Scan\" and" + + " \"Do\"."); + this.cbMonitorFolder.UseVisualStyleBackColor = true; // - // bnBrowseWTWRSS + // chkScanOnStartup // - this.bnBrowseWTWRSS.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.bnBrowseWTWRSS.Location = new System.Drawing.Point(520, 18); - this.bnBrowseWTWRSS.Name = "bnBrowseWTWRSS"; - this.bnBrowseWTWRSS.Size = new System.Drawing.Size(75, 23); - this.bnBrowseWTWRSS.TabIndex = 2; - this.bnBrowseWTWRSS.Text = "Browse..."; - this.bnBrowseWTWRSS.UseVisualStyleBackColor = true; - this.bnBrowseWTWRSS.Click += new System.EventHandler(this.bnBrowseWTWRSS_Click); + this.chkScanOnStartup.AutoSize = true; + this.chkScanOnStartup.Location = new System.Drawing.Point(3, 65); + this.chkScanOnStartup.Name = "chkScanOnStartup"; + this.chkScanOnStartup.Size = new System.Drawing.Size(103, 17); + this.chkScanOnStartup.TabIndex = 23; + this.chkScanOnStartup.Text = "&Scan on Startup"; + this.toolTip1.SetToolTip(this.chkScanOnStartup, "If checked the system will automatically scan and complete actions on startup"); + this.chkScanOnStartup.UseVisualStyleBackColor = true; // - // txtWTWRSS + // chkScheduledScan // - this.txtWTWRSS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtWTWRSS.Location = new System.Drawing.Point(64, 20); - this.txtWTWRSS.Name = "txtWTWRSS"; - this.txtWTWRSS.Size = new System.Drawing.Size(424, 20); - this.txtWTWRSS.TabIndex = 1; + this.chkScheduledScan.AutoSize = true; + this.chkScheduledScan.Location = new System.Drawing.Point(3, 88); + this.chkScheduledScan.Name = "chkScheduledScan"; + this.chkScheduledScan.Size = new System.Drawing.Size(135, 17); + this.chkScheduledScan.TabIndex = 24; + this.chkScheduledScan.Text = "Sc&heduled scan every "; + this.toolTip1.SetToolTip(this.chkScheduledScan, "If checked the system will automatically scan and complete actions on startup"); + this.chkScheduledScan.UseVisualStyleBackColor = true; // - // cbWTWRSS + // txtEmptyIgnoreExtensions // - this.cbWTWRSS.AutoSize = true; - this.cbWTWRSS.Location = new System.Drawing.Point(8, 22); - this.cbWTWRSS.Name = "cbWTWRSS"; - this.cbWTWRSS.Size = new System.Drawing.Size(48, 17); - this.cbWTWRSS.TabIndex = 0; - this.cbWTWRSS.Text = "RSS"; - this.cbWTWRSS.UseVisualStyleBackColor = true; - this.cbWTWRSS.CheckedChanged += new System.EventHandler(this.EnableDisable); + this.txtEmptyIgnoreExtensions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtEmptyIgnoreExtensions.Location = new System.Drawing.Point(95, 139); + this.txtEmptyIgnoreExtensions.Name = "txtEmptyIgnoreExtensions"; + this.txtEmptyIgnoreExtensions.Size = new System.Drawing.Size(428, 20); + this.txtEmptyIgnoreExtensions.TabIndex = 5; + this.toolTip1.SetToolTip(this.txtEmptyIgnoreExtensions, "For example \".par2;.nzb;.nfo\""); // - // label17 + // txtEmptyIgnoreWords // - this.label17.AutoSize = true; - this.label17.Location = new System.Drawing.Point(212, 109); - this.label17.Name = "label17"; - this.label17.Size = new System.Drawing.Size(79, 13); - this.label17.TabIndex = 7; - this.label17.Text = "days worth and"; + this.txtEmptyIgnoreWords.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtEmptyIgnoreWords.Location = new System.Drawing.Point(95, 89); + this.txtEmptyIgnoreWords.Name = "txtEmptyIgnoreWords"; + this.txtEmptyIgnoreWords.Size = new System.Drawing.Size(428, 20); + this.txtEmptyIgnoreWords.TabIndex = 3; + this.toolTip1.SetToolTip(this.txtEmptyIgnoreWords, "For example \"sample\""); // - // label16 + // cmDefaults // - this.label16.AutoSize = true; - this.label16.Location = new System.Drawing.Point(120, 109); - this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(52, 13); - this.label16.TabIndex = 5; - this.label16.Text = "shows, or"; + this.cmDefaults.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.KODIToolStripMenuItem, + this.pyTivoToolStripMenuItem, + this.mede8erToolStripMenuItem, + this.noneToolStripMenuItem}); + this.cmDefaults.Name = "cmDefaults"; + this.cmDefaults.Size = new System.Drawing.Size(121, 92); + this.cmDefaults.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.cmDefaults_ItemClicked); // - // label15 + // KODIToolStripMenuItem // - this.label15.AutoSize = true; - this.label15.Location = new System.Drawing.Point(9, 109); - this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(71, 13); - this.label15.TabIndex = 3; - this.label15.Text = "No more than"; + this.KODIToolStripMenuItem.Name = "KODIToolStripMenuItem"; + this.KODIToolStripMenuItem.Size = new System.Drawing.Size(120, 22); + this.KODIToolStripMenuItem.Tag = "1"; + this.KODIToolStripMenuItem.Text = "&KODI"; // - // txtExportRSSMaxDays + // pyTivoToolStripMenuItem // - this.txtExportRSSMaxDays.Location = new System.Drawing.Point(178, 106); - this.txtExportRSSMaxDays.Name = "txtExportRSSMaxDays"; - this.txtExportRSSMaxDays.Size = new System.Drawing.Size(28, 20); - this.txtExportRSSMaxDays.TabIndex = 6; - this.txtExportRSSMaxDays.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TxtNumberOnlyKeyPress); + this.pyTivoToolStripMenuItem.Name = "pyTivoToolStripMenuItem"; + this.pyTivoToolStripMenuItem.Size = new System.Drawing.Size(120, 22); + this.pyTivoToolStripMenuItem.Tag = "2"; + this.pyTivoToolStripMenuItem.Text = "&pyTivo"; // - // txtExportRSSMaxShows + // mede8erToolStripMenuItem // - this.txtExportRSSMaxShows.Location = new System.Drawing.Point(86, 106); - this.txtExportRSSMaxShows.Name = "txtExportRSSMaxShows"; - this.txtExportRSSMaxShows.Size = new System.Drawing.Size(28, 20); - this.txtExportRSSMaxShows.TabIndex = 4; - this.txtExportRSSMaxShows.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TxtNumberOnlyKeyPress); + this.mede8erToolStripMenuItem.Name = "mede8erToolStripMenuItem"; + this.mede8erToolStripMenuItem.Size = new System.Drawing.Size(120, 22); + this.mede8erToolStripMenuItem.Tag = "3"; + this.mede8erToolStripMenuItem.Text = "&Mede8er"; // - // saveFile + // noneToolStripMenuItem // - this.saveFile.Filter = "RSS files (*.rss)|*.rss|XML files (*.xml)|*.xml|CSV files (*.csv)|*.csv|TXT files" + - " (*.txt)|*.txt|HTML files (*.html)|*.html|iCal files (*.ics)|*.ics|All files (*." + - "*)|*.*"; + this.noneToolStripMenuItem.Name = "noneToolStripMenuItem"; + this.noneToolStripMenuItem.Size = new System.Drawing.Size(120, 22); + this.noneToolStripMenuItem.Tag = "4"; + this.noneToolStripMenuItem.Text = "&None"; // - // txtSpecialsFolderName + // tpDisplay + // + this.tpDisplay.Controls.Add(this.txtSeasonFolderName); + this.tpDisplay.Controls.Add(this.label35); + this.tpDisplay.Controls.Add(this.chkHideWtWSpoilers); + this.tpDisplay.Controls.Add(this.chkHideMyShowsSpoilers); + this.tpDisplay.Controls.Add(this.rbWTWScan); + this.tpDisplay.Controls.Add(this.rbWTWSearch); + this.tpDisplay.Controls.Add(this.cbStartupTab); + this.tpDisplay.Controls.Add(this.cbAutoSelInMyShows); + this.tpDisplay.Controls.Add(this.cbShowEpisodePictures); + this.tpDisplay.Controls.Add(this.label11); + this.tpDisplay.Controls.Add(this.label6); + this.tpDisplay.Controls.Add(this.chkShowInTaskbar); + this.tpDisplay.Controls.Add(this.cbNotificationIcon); + this.tpDisplay.Location = new System.Drawing.Point(4, 40); + this.tpDisplay.Name = "tpDisplay"; + this.tpDisplay.Padding = new System.Windows.Forms.Padding(3); + this.tpDisplay.Size = new System.Drawing.Size(529, 426); + this.tpDisplay.TabIndex = 13; + this.tpDisplay.Text = "Display"; + this.tpDisplay.UseVisualStyleBackColor = true; // - this.txtSpecialsFolderName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // txtSeasonFolderName + // + this.txtSeasonFolderName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txtSpecialsFolderName.Location = new System.Drawing.Point(113, 281); - this.txtSpecialsFolderName.Name = "txtSpecialsFolderName"; - this.txtSpecialsFolderName.Size = new System.Drawing.Size(492, 20); - this.txtSpecialsFolderName.TabIndex = 12; + this.txtSeasonFolderName.Location = new System.Drawing.Point(113, 212); + this.txtSeasonFolderName.Name = "txtSeasonFolderName"; + this.txtSeasonFolderName.Size = new System.Drawing.Size(410, 20); + this.txtSeasonFolderName.TabIndex = 37; // - // txtVideoExtensions + // label35 // - this.txtVideoExtensions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtVideoExtensions.Location = new System.Drawing.Point(99, 128); - this.txtVideoExtensions.Name = "txtVideoExtensions"; - this.txtVideoExtensions.Size = new System.Drawing.Size(506, 20); - this.txtVideoExtensions.TabIndex = 5; + this.label35.AutoSize = true; + this.label35.Location = new System.Drawing.Point(6, 215); + this.label35.Name = "label35"; + this.label35.Size = new System.Drawing.Size(80, 13); + this.label35.TabIndex = 36; + this.label35.Text = "&Seasons name:"; + // + // chkHideWtWSpoilers + // + this.chkHideWtWSpoilers.AutoSize = true; + this.chkHideWtWSpoilers.Location = new System.Drawing.Point(9, 166); + this.chkHideWtWSpoilers.Name = "chkHideWtWSpoilers"; + this.chkHideWtWSpoilers.Size = new System.Drawing.Size(182, 17); + this.chkHideWtWSpoilers.TabIndex = 35; + this.chkHideWtWSpoilers.Text = "Hide Spoilers in When To Watch"; + this.chkHideWtWSpoilers.UseVisualStyleBackColor = true; + // + // chkHideMyShowsSpoilers + // + this.chkHideMyShowsSpoilers.AutoSize = true; + this.chkHideMyShowsSpoilers.Location = new System.Drawing.Point(9, 143); + this.chkHideMyShowsSpoilers.Name = "chkHideMyShowsSpoilers"; + this.chkHideMyShowsSpoilers.Size = new System.Drawing.Size(151, 17); + this.chkHideMyShowsSpoilers.TabIndex = 34; + this.chkHideMyShowsSpoilers.Text = "Hide Spoilers in My Shows"; + this.chkHideMyShowsSpoilers.UseVisualStyleBackColor = true; + // + // rbWTWScan + // + this.rbWTWScan.AutoSize = true; + this.rbWTWScan.Location = new System.Drawing.Point(27, 48); + this.rbWTWScan.Name = "rbWTWScan"; + this.rbWTWScan.Size = new System.Drawing.Size(50, 17); + this.rbWTWScan.TabIndex = 27; + this.rbWTWScan.TabStop = true; + this.rbWTWScan.Text = "S&can"; + this.rbWTWScan.UseVisualStyleBackColor = true; + // + // rbWTWSearch + // + this.rbWTWSearch.AutoSize = true; + this.rbWTWSearch.Location = new System.Drawing.Point(27, 29); + this.rbWTWSearch.Name = "rbWTWSearch"; + this.rbWTWSearch.Size = new System.Drawing.Size(59, 17); + this.rbWTWSearch.TabIndex = 26; + this.rbWTWSearch.TabStop = true; + this.rbWTWSearch.Text = "S&earch"; + this.rbWTWSearch.UseVisualStyleBackColor = true; // // cbStartupTab // @@ -543,1016 +596,1119 @@ private void InitializeComponent() "My Shows", "Scan", "When to Watch"}); - this.cbStartupTab.Location = new System.Drawing.Point(74, 88); + this.cbStartupTab.Location = new System.Drawing.Point(74, 70); this.cbStartupTab.Name = "cbStartupTab"; this.cbStartupTab.Size = new System.Drawing.Size(135, 21); - this.cbStartupTab.TabIndex = 7; + this.cbStartupTab.TabIndex = 29; + // + // cbAutoSelInMyShows + // + this.cbAutoSelInMyShows.AutoSize = true; + this.cbAutoSelInMyShows.Location = new System.Drawing.Point(9, 189); + this.cbAutoSelInMyShows.Name = "cbAutoSelInMyShows"; + this.cbAutoSelInMyShows.Size = new System.Drawing.Size(268, 17); + this.cbAutoSelInMyShows.TabIndex = 33; + this.cbAutoSelInMyShows.Text = "&Automatically select show and season in My Shows"; + this.cbAutoSelInMyShows.UseVisualStyleBackColor = true; // // cbShowEpisodePictures // this.cbShowEpisodePictures.AutoSize = true; - this.cbShowEpisodePictures.Location = new System.Drawing.Point(9, 159); + this.cbShowEpisodePictures.Location = new System.Drawing.Point(9, 120); this.cbShowEpisodePictures.Name = "cbShowEpisodePictures"; this.cbShowEpisodePictures.Size = new System.Drawing.Size(218, 17); - this.cbShowEpisodePictures.TabIndex = 10; + this.cbShowEpisodePictures.TabIndex = 32; this.cbShowEpisodePictures.Text = "S&how episode pictures in episode guides"; this.cbShowEpisodePictures.UseVisualStyleBackColor = true; // - // cbLeadingZero - // - this.cbLeadingZero.AutoSize = true; - this.cbLeadingZero.Location = new System.Drawing.Point(6, 257); - this.cbLeadingZero.Name = "cbLeadingZero"; - this.cbLeadingZero.Size = new System.Drawing.Size(170, 17); - this.cbLeadingZero.TabIndex = 10; - this.cbLeadingZero.Text = "&Leading 0 on Season numbers"; - this.cbLeadingZero.UseVisualStyleBackColor = true; + // label11 // - // cbKeepTogether + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(6, 14); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(185, 13); + this.label11.TabIndex = 25; + this.label11.Text = "Double-click in When to Watch does:"; // - this.cbKeepTogether.AutoSize = true; - this.cbKeepTogether.Location = new System.Drawing.Point(6, 180); - this.cbKeepTogether.Name = "cbKeepTogether"; - this.cbKeepTogether.Size = new System.Drawing.Size(251, 17); - this.cbKeepTogether.TabIndex = 8; - this.cbKeepTogether.Text = "&Copy/Move files with same base name as video"; - this.cbKeepTogether.UseVisualStyleBackColor = true; - this.cbKeepTogether.CheckedChanged += new System.EventHandler(this.cbKeepTogether_CheckedChanged); + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(6, 73); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(62, 13); + this.label6.TabIndex = 28; + this.label6.Text = "&Startup tab:"; // // chkShowInTaskbar // this.chkShowInTaskbar.AutoSize = true; - this.chkShowInTaskbar.Location = new System.Drawing.Point(169, 136); + this.chkShowInTaskbar.Location = new System.Drawing.Point(169, 97); this.chkShowInTaskbar.Name = "chkShowInTaskbar"; this.chkShowInTaskbar.Size = new System.Drawing.Size(102, 17); - this.chkShowInTaskbar.TabIndex = 9; + this.chkShowInTaskbar.TabIndex = 31; this.chkShowInTaskbar.Text = "Show in &taskbar"; this.chkShowInTaskbar.UseVisualStyleBackColor = true; - this.chkShowInTaskbar.CheckedChanged += new System.EventHandler(this.chkShowInTaskbar_CheckedChanged); // // cbNotificationIcon // this.cbNotificationIcon.AutoSize = true; - this.cbNotificationIcon.Location = new System.Drawing.Point(9, 136); + this.cbNotificationIcon.Location = new System.Drawing.Point(9, 97); this.cbNotificationIcon.Name = "cbNotificationIcon"; this.cbNotificationIcon.Size = new System.Drawing.Size(154, 17); - this.cbNotificationIcon.TabIndex = 8; + this.cbNotificationIcon.TabIndex = 30; this.cbNotificationIcon.Text = "Show ¬ification area icon"; this.cbNotificationIcon.UseVisualStyleBackColor = true; - this.cbNotificationIcon.CheckedChanged += new System.EventHandler(this.cbNotificationIcon_CheckedChanged); // - // txtWTWDays + // tabPage1 // - this.txtWTWDays.Location = new System.Drawing.Point(13, 9); - this.txtWTWDays.Name = "txtWTWDays"; - this.txtWTWDays.Size = new System.Drawing.Size(28, 20); - this.txtWTWDays.TabIndex = 1; - this.txtWTWDays.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TxtNumberOnlyKeyPress); + this.tabPage1.Controls.Add(this.gbJSON); + this.tabPage1.Controls.Add(this.gbRSS); + this.tabPage1.Location = new System.Drawing.Point(4, 40); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(529, 426); + this.tabPage1.TabIndex = 12; + this.tabPage1.Text = "RSS/JSON Search"; + this.tabPage1.UseVisualStyleBackColor = true; // - // label2 + // gbJSON // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(47, 12); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(111, 13); - this.label2.TabIndex = 2; - this.label2.Text = "days counts as recent"; + this.gbJSON.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.gbJSON.Controls.Add(this.label51); + this.gbJSON.Controls.Add(this.tbJSONFilenameToken); + this.gbJSON.Controls.Add(this.label50); + this.gbJSON.Controls.Add(this.tbJSONURLToken); + this.gbJSON.Controls.Add(this.label49); + this.gbJSON.Controls.Add(this.tbJSONRootNode); + this.gbJSON.Controls.Add(this.label48); + this.gbJSON.Controls.Add(this.tbJSONURL); + this.gbJSON.Location = new System.Drawing.Point(3, 205); + this.gbJSON.Name = "gbJSON"; + this.gbJSON.Size = new System.Drawing.Size(520, 127); + this.gbJSON.TabIndex = 33; + this.gbJSON.TabStop = false; + this.gbJSON.Text = "JSON Search"; + // + // label51 + // + this.label51.AutoSize = true; + this.label51.Location = new System.Drawing.Point(7, 68); + this.label51.Name = "label51"; + this.label51.Size = new System.Drawing.Size(86, 13); + this.label51.TabIndex = 37; + this.label51.Text = "Filename Token:"; + // + // tbJSONFilenameToken + // + this.tbJSONFilenameToken.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbJSONFilenameToken.Location = new System.Drawing.Point(98, 65); + this.tbJSONFilenameToken.Name = "tbJSONFilenameToken"; + this.tbJSONFilenameToken.Size = new System.Drawing.Size(417, 20); + this.tbJSONFilenameToken.TabIndex = 36; // - // label13 + // label50 // - this.label13.AutoSize = true; - this.label13.Location = new System.Drawing.Point(6, 284); - this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(108, 13); - this.label13.TabIndex = 11; - this.label13.Text = "&Specials folder name:"; + this.label50.AutoSize = true; + this.label50.Location = new System.Drawing.Point(8, 94); + this.label50.Name = "label50"; + this.label50.Size = new System.Drawing.Size(66, 13); + this.label50.TabIndex = 35; + this.label50.Text = "URL Token:"; // - // label14 + // tbJSONURLToken // - this.label14.AutoSize = true; - this.label14.Location = new System.Drawing.Point(3, 131); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(90, 13); - this.label14.TabIndex = 4; - this.label14.Text = "&Video extensions:"; + this.tbJSONURLToken.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbJSONURLToken.Location = new System.Drawing.Point(99, 91); + this.tbJSONURLToken.Name = "tbJSONURLToken"; + this.tbJSONURLToken.Size = new System.Drawing.Size(417, 20); + this.tbJSONURLToken.TabIndex = 34; // - // label6 + // label49 // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(6, 91); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(62, 13); - this.label6.TabIndex = 6; - this.label6.Text = "&Startup tab:"; + this.label49.AutoSize = true; + this.label49.Location = new System.Drawing.Point(7, 42); + this.label49.Name = "label49"; + this.label49.Size = new System.Drawing.Size(62, 13); + this.label49.TabIndex = 33; + this.label49.Text = "Root Node:"; // - // tabControl1 + // tbJSONRootNode // - this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.tbJSONRootNode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.tabControl1.Controls.Add(this.tbGeneral); - this.tabControl1.Controls.Add(this.tbFilesAndFolders); - this.tabControl1.Controls.Add(this.tbAutoExport); - this.tabControl1.Controls.Add(this.tpScanOptions); - this.tabControl1.Controls.Add(this.tbFolderDeleting); - this.tabControl1.Controls.Add(this.tbMediaCenter); - this.tabControl1.Controls.Add(this.tbSearchFolders); - this.tabControl1.Controls.Add(this.tbuTorrentNZB); - this.tabControl1.Controls.Add(this.tpTreeColoring); - this.tabControl1.Controls.Add(this.tpBulkAdd); - this.tabControl1.Controls.Add(this.tpSubtitles); - this.tabControl1.Location = new System.Drawing.Point(12, 12); - this.tabControl1.Multiline = true; - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(517, 536); - this.tabControl1.TabIndex = 0; + this.tbJSONRootNode.Location = new System.Drawing.Point(98, 39); + this.tbJSONRootNode.Name = "tbJSONRootNode"; + this.tbJSONRootNode.Size = new System.Drawing.Size(417, 20); + this.tbJSONRootNode.TabIndex = 32; // - // tbGeneral + // label48 // - this.tbGeneral.Controls.Add(this.cbShowCollections); - this.tbGeneral.Controls.Add(this.chkHideWtWSpoilers); - this.tbGeneral.Controls.Add(this.chkHideMyShowsSpoilers); - this.tbGeneral.Controls.Add(this.label37); - this.tbGeneral.Controls.Add(this.label38); - this.tbGeneral.Controls.Add(this.tbPercentDirty); - this.tbGeneral.Controls.Add(this.cbMode); - this.tbGeneral.Controls.Add(this.label34); - this.tbGeneral.Controls.Add(this.rbWTWScan); - this.tbGeneral.Controls.Add(this.rbWTWSearch); - this.tbGeneral.Controls.Add(this.label10); - this.tbGeneral.Controls.Add(this.cbLookForAirdate); - this.tbGeneral.Controls.Add(this.cbLanguages); - this.tbGeneral.Controls.Add(this.cbStartupTab); - this.tbGeneral.Controls.Add(this.label21); - this.tbGeneral.Controls.Add(this.cbAutoSelInMyShows); - this.tbGeneral.Controls.Add(this.cbShowEpisodePictures); - this.tbGeneral.Controls.Add(this.label11); - this.tbGeneral.Controls.Add(this.label6); - this.tbGeneral.Controls.Add(this.chkShowInTaskbar); - this.tbGeneral.Controls.Add(this.label20); - this.tbGeneral.Controls.Add(this.label2); - this.tbGeneral.Controls.Add(this.cbNotificationIcon); - this.tbGeneral.Controls.Add(this.txtParallelDownloads); - this.tbGeneral.Controls.Add(this.txtWTWDays); - this.tbGeneral.Location = new System.Drawing.Point(4, 40); - this.tbGeneral.Name = "tbGeneral"; - this.tbGeneral.Padding = new System.Windows.Forms.Padding(3); - this.tbGeneral.Size = new System.Drawing.Size(509, 492); - this.tbGeneral.TabIndex = 0; - this.tbGeneral.Text = "General"; - this.tbGeneral.UseVisualStyleBackColor = true; + this.label48.AutoSize = true; + this.label48.Location = new System.Drawing.Point(6, 16); + this.label48.Name = "label48"; + this.label48.Size = new System.Drawing.Size(32, 13); + this.label48.TabIndex = 31; + this.label48.Text = "URL:"; // - // cbShowCollections + // tbJSONURL // - this.cbShowCollections.AutoSize = true; - this.cbShowCollections.Location = new System.Drawing.Point(9, 115); - this.cbShowCollections.Name = "cbShowCollections"; - this.cbShowCollections.Size = new System.Drawing.Size(145, 17); - this.cbShowCollections.TabIndex = 2; - this.cbShowCollections.Text = "Multiple Show collections"; - this.cbShowCollections.UseVisualStyleBackColor = true; + this.tbJSONURL.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbJSONURL.Location = new System.Drawing.Point(97, 13); + this.tbJSONURL.Name = "tbJSONURL"; + this.tbJSONURL.Size = new System.Drawing.Size(417, 20); + this.tbJSONURL.TabIndex = 30; // - // chkHideWtWSpoilers + // gbRSS // - this.chkHideWtWSpoilers.AutoSize = true; - this.chkHideWtWSpoilers.Location = new System.Drawing.Point(9, 205); - this.chkHideWtWSpoilers.Name = "chkHideWtWSpoilers"; - this.chkHideWtWSpoilers.Size = new System.Drawing.Size(182, 17); - this.chkHideWtWSpoilers.TabIndex = 24; - this.chkHideWtWSpoilers.Text = "Hide Spoilers in When To Watch"; - this.chkHideWtWSpoilers.UseVisualStyleBackColor = true; + this.gbRSS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.gbRSS.Controls.Add(this.label45); + this.gbRSS.Controls.Add(this.tbPreferredRSSTerms); + this.gbRSS.Controls.Add(this.RSSGrid); + this.gbRSS.Controls.Add(this.label25); + this.gbRSS.Controls.Add(this.bnRSSRemove); + this.gbRSS.Controls.Add(this.bnRSSGo); + this.gbRSS.Controls.Add(this.bnRSSAdd); + this.gbRSS.Location = new System.Drawing.Point(4, 6); + this.gbRSS.Name = "gbRSS"; + this.gbRSS.Size = new System.Drawing.Size(520, 193); + this.gbRSS.TabIndex = 32; + this.gbRSS.TabStop = false; + this.gbRSS.Text = "RSS Search"; // - // chkHideMyShowsSpoilers + // label45 // - this.chkHideMyShowsSpoilers.AutoSize = true; - this.chkHideMyShowsSpoilers.Location = new System.Drawing.Point(9, 182); - this.chkHideMyShowsSpoilers.Name = "chkHideMyShowsSpoilers"; - this.chkHideMyShowsSpoilers.Size = new System.Drawing.Size(151, 17); - this.chkHideMyShowsSpoilers.TabIndex = 23; - this.chkHideMyShowsSpoilers.Text = "Hide Spoilers in My Shows"; - this.chkHideMyShowsSpoilers.UseVisualStyleBackColor = true; + this.label45.AutoSize = true; + this.label45.Location = new System.Drawing.Point(6, 16); + this.label45.Name = "label45"; + this.label45.Size = new System.Drawing.Size(85, 13); + this.label45.TabIndex = 31; + this.label45.Text = "Preferred Terms:"; // - // label37 + // tbPreferredRSSTerms // - this.label37.AutoSize = true; - this.label37.Location = new System.Drawing.Point(6, 250); - this.label37.Name = "label37"; - this.label37.Size = new System.Drawing.Size(114, 13); - this.label37.TabIndex = 20; - this.label37.Text = "Refresh entire series if"; + this.tbPreferredRSSTerms.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbPreferredRSSTerms.Location = new System.Drawing.Point(97, 13); + this.tbPreferredRSSTerms.Name = "tbPreferredRSSTerms"; + this.tbPreferredRSSTerms.Size = new System.Drawing.Size(417, 20); + this.tbPreferredRSSTerms.TabIndex = 30; // - // label38 + // RSSGrid // - this.label38.AutoSize = true; - this.label38.Location = new System.Drawing.Point(158, 250); - this.label38.Name = "label38"; - this.label38.Size = new System.Drawing.Size(132, 13); - this.label38.TabIndex = 22; - this.label38.Text = "% of episodes are updated"; + this.RSSGrid.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.RSSGrid.BackColor = System.Drawing.SystemColors.Window; + this.RSSGrid.EnableSort = true; + this.RSSGrid.Location = new System.Drawing.Point(6, 59); + this.RSSGrid.Name = "RSSGrid"; + this.RSSGrid.OptimizeMode = SourceGrid.CellOptimizeMode.ForRows; + this.RSSGrid.SelectionMode = SourceGrid.GridSelectionMode.Cell; + this.RSSGrid.Size = new System.Drawing.Size(508, 91); + this.RSSGrid.TabIndex = 26; + this.RSSGrid.TabStop = true; + this.RSSGrid.ToolTipText = ""; // - // tbPercentDirty + // label25 // - this.tbPercentDirty.Location = new System.Drawing.Point(123, 247); - this.tbPercentDirty.Name = "tbPercentDirty"; - this.tbPercentDirty.Size = new System.Drawing.Size(28, 20); - this.tbPercentDirty.TabIndex = 21; + this.label25.AutoSize = true; + this.label25.Location = new System.Drawing.Point(6, 36); + this.label25.Name = "label25"; + this.label25.Size = new System.Drawing.Size(99, 13); + this.label25.TabIndex = 25; + this.label25.Text = "Torrent RSS URLs:"; // - // cbMode + // bnRSSRemove // - this.cbMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbMode.FormattingEnabled = true; - this.cbMode.Items.AddRange(new object[] { - "Beta", - "Production"}); - this.cbMode.Location = new System.Drawing.Point(112, 341); - this.cbMode.Name = "cbMode"; - this.cbMode.Size = new System.Drawing.Size(146, 21); - this.cbMode.Sorted = true; - this.cbMode.TabIndex = 19; + this.bnRSSRemove.Location = new System.Drawing.Point(87, 159); + this.bnRSSRemove.Name = "bnRSSRemove"; + this.bnRSSRemove.Size = new System.Drawing.Size(75, 23); + this.bnRSSRemove.TabIndex = 28; + this.bnRSSRemove.Text = "&Remove"; + this.bnRSSRemove.UseVisualStyleBackColor = true; // - // label34 + // bnRSSGo // - this.label34.AutoSize = true; - this.label34.Location = new System.Drawing.Point(6, 344); - this.label34.Name = "label34"; - this.label34.Size = new System.Drawing.Size(37, 13); - this.label34.TabIndex = 18; - this.label34.Text = "&Mode:"; + this.bnRSSGo.Location = new System.Drawing.Point(168, 159); + this.bnRSSGo.Name = "bnRSSGo"; + this.bnRSSGo.Size = new System.Drawing.Size(75, 23); + this.bnRSSGo.TabIndex = 29; + this.bnRSSGo.Text = "&Open"; + this.bnRSSGo.UseVisualStyleBackColor = true; // - // rbWTWScan + // bnRSSAdd // - this.rbWTWScan.AutoSize = true; - this.rbWTWScan.Location = new System.Drawing.Point(27, 66); - this.rbWTWScan.Name = "rbWTWScan"; - this.rbWTWScan.Size = new System.Drawing.Size(50, 17); - this.rbWTWScan.TabIndex = 5; - this.rbWTWScan.TabStop = true; - this.rbWTWScan.Text = "S&can"; - this.rbWTWScan.UseVisualStyleBackColor = true; + this.bnRSSAdd.Location = new System.Drawing.Point(6, 159); + this.bnRSSAdd.Name = "bnRSSAdd"; + this.bnRSSAdd.Size = new System.Drawing.Size(75, 23); + this.bnRSSAdd.TabIndex = 27; + this.bnRSSAdd.Text = "&Add"; + this.bnRSSAdd.UseVisualStyleBackColor = true; // - // rbWTWSearch + // tpSubtitles // - this.rbWTWSearch.AutoSize = true; - this.rbWTWSearch.Location = new System.Drawing.Point(27, 47); - this.rbWTWSearch.Name = "rbWTWSearch"; - this.rbWTWSearch.Size = new System.Drawing.Size(59, 17); - this.rbWTWSearch.TabIndex = 4; - this.rbWTWSearch.TabStop = true; - this.rbWTWSearch.Text = "S&earch"; - this.rbWTWSearch.UseVisualStyleBackColor = true; + this.tpSubtitles.Controls.Add(this.cbTxtToSub); + this.tpSubtitles.Controls.Add(this.label46); + this.tpSubtitles.Controls.Add(this.txtSubtitleExtensions); + this.tpSubtitles.Controls.Add(this.chkRetainLanguageSpecificSubtitles); + this.tpSubtitles.Location = new System.Drawing.Point(4, 40); + this.tpSubtitles.Name = "tpSubtitles"; + this.tpSubtitles.Padding = new System.Windows.Forms.Padding(3); + this.tpSubtitles.Size = new System.Drawing.Size(529, 426); + this.tpSubtitles.TabIndex = 11; + this.tpSubtitles.Text = "Subtitles"; + this.tpSubtitles.UseVisualStyleBackColor = true; // - // label10 + // cbTxtToSub // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(6, 320); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(100, 13); - this.label10.TabIndex = 16; - this.label10.Text = "&Preferred language:"; + this.cbTxtToSub.AutoSize = true; + this.cbTxtToSub.Location = new System.Drawing.Point(6, 38); + this.cbTxtToSub.Name = "cbTxtToSub"; + this.cbTxtToSub.Size = new System.Drawing.Size(118, 17); + this.cbTxtToSub.TabIndex = 28; + this.cbTxtToSub.Text = "&Rename .txt to .sub"; + this.cbTxtToSub.UseVisualStyleBackColor = true; // - // cbLookForAirdate + // label46 // - this.cbLookForAirdate.AutoSize = true; - this.cbLookForAirdate.Location = new System.Drawing.Point(9, 296); - this.cbLookForAirdate.Name = "cbLookForAirdate"; - this.cbLookForAirdate.Size = new System.Drawing.Size(158, 17); - this.cbLookForAirdate.TabIndex = 15; - this.cbLookForAirdate.Text = "&Look for airdate in filenames"; - this.cbLookForAirdate.UseVisualStyleBackColor = true; + this.label46.AutoSize = true; + this.label46.Location = new System.Drawing.Point(3, 66); + this.label46.Name = "label46"; + this.label46.Size = new System.Drawing.Size(98, 13); + this.label46.TabIndex = 26; + this.label46.Text = "&Subtitle extensions:"; // - // cbLanguages + // txtSubtitleExtensions // - this.cbLanguages.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbLanguages.FormattingEnabled = true; - this.cbLanguages.Items.AddRange(new object[] { - "My Shows", - "Scan", - "When to Watch"}); - this.cbLanguages.Location = new System.Drawing.Point(112, 317); - this.cbLanguages.Name = "cbLanguages"; - this.cbLanguages.Size = new System.Drawing.Size(146, 21); - this.cbLanguages.Sorted = true; - this.cbLanguages.TabIndex = 17; + this.txtSubtitleExtensions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtSubtitleExtensions.Location = new System.Drawing.Point(107, 63); + this.txtSubtitleExtensions.Name = "txtSubtitleExtensions"; + this.txtSubtitleExtensions.Size = new System.Drawing.Size(416, 20); + this.txtSubtitleExtensions.TabIndex = 27; // - // label21 + // chkRetainLanguageSpecificSubtitles // - this.label21.AutoSize = true; - this.label21.Location = new System.Drawing.Point(6, 226); - this.label21.Name = "label21"; - this.label21.Size = new System.Drawing.Size(82, 13); - this.label21.TabIndex = 11; - this.label21.Text = "&Download up to"; + this.chkRetainLanguageSpecificSubtitles.AutoSize = true; + this.chkRetainLanguageSpecificSubtitles.Location = new System.Drawing.Point(6, 15); + this.chkRetainLanguageSpecificSubtitles.Name = "chkRetainLanguageSpecificSubtitles"; + this.chkRetainLanguageSpecificSubtitles.Size = new System.Drawing.Size(192, 17); + this.chkRetainLanguageSpecificSubtitles.TabIndex = 25; + this.chkRetainLanguageSpecificSubtitles.Text = "Retain &Language Specific Subtitles"; + this.chkRetainLanguageSpecificSubtitles.UseVisualStyleBackColor = true; // - // cbAutoSelInMyShows + // tpBulkAdd // - this.cbAutoSelInMyShows.AutoSize = true; - this.cbAutoSelInMyShows.Location = new System.Drawing.Point(9, 273); - this.cbAutoSelInMyShows.Name = "cbAutoSelInMyShows"; - this.cbAutoSelInMyShows.Size = new System.Drawing.Size(268, 17); - this.cbAutoSelInMyShows.TabIndex = 14; - this.cbAutoSelInMyShows.Text = "&Automatically select show and season in My Shows"; - this.cbAutoSelInMyShows.UseVisualStyleBackColor = true; - // - // label11 - // - this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(6, 32); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(185, 13); - this.label11.TabIndex = 3; - this.label11.Text = "Double-click in When to Watch does:"; - // - // label20 - // - this.label20.AutoSize = true; - this.label20.Location = new System.Drawing.Point(126, 226); - this.label20.Name = "label20"; - this.label20.Size = new System.Drawing.Size(170, 13); - this.label20.TabIndex = 13; - this.label20.Text = "shows simultaneously from thetvdb"; - // - // txtParallelDownloads - // - this.txtParallelDownloads.Location = new System.Drawing.Point(92, 223); - this.txtParallelDownloads.Name = "txtParallelDownloads"; - this.txtParallelDownloads.Size = new System.Drawing.Size(28, 20); - this.txtParallelDownloads.TabIndex = 12; - this.txtParallelDownloads.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TxtNumberOnlyKeyPress); - // - // tbFilesAndFolders - // - this.tbFilesAndFolders.Controls.Add(this.txtSeasonFormat); - this.tbFilesAndFolders.Controls.Add(this.label47); - this.tbFilesAndFolders.Controls.Add(this.bnTags); - this.tbFilesAndFolders.Controls.Add(this.txtKeepTogether); - this.tbFilesAndFolders.Controls.Add(this.label39); - this.tbFilesAndFolders.Controls.Add(this.cbKeepTogetherMode); - this.tbFilesAndFolders.Controls.Add(this.tbSeasonSearchTerms); - this.tbFilesAndFolders.Controls.Add(this.label36); - this.tbFilesAndFolders.Controls.Add(this.txtSeasonFolderName); - this.tbFilesAndFolders.Controls.Add(this.label35); - this.tbFilesAndFolders.Controls.Add(this.bnReplaceRemove); - this.tbFilesAndFolders.Controls.Add(this.bnReplaceAdd); - this.tbFilesAndFolders.Controls.Add(this.label3); - this.tbFilesAndFolders.Controls.Add(this.ReplacementsGrid); - this.tbFilesAndFolders.Controls.Add(this.label19); - this.tbFilesAndFolders.Controls.Add(this.txtMaxSampleSize); - this.tbFilesAndFolders.Controls.Add(this.label22); - this.tbFilesAndFolders.Controls.Add(this.label14); - this.tbFilesAndFolders.Controls.Add(this.txtSpecialsFolderName); - this.tbFilesAndFolders.Controls.Add(this.label13); - this.tbFilesAndFolders.Controls.Add(this.txtOtherExtensions); - this.tbFilesAndFolders.Controls.Add(this.txtVideoExtensions); - this.tbFilesAndFolders.Controls.Add(this.cbKeepTogether); - this.tbFilesAndFolders.Controls.Add(this.cbForceLower); - this.tbFilesAndFolders.Controls.Add(this.cbIgnoreSamples); - this.tbFilesAndFolders.Controls.Add(this.cbLeadingZero); - this.tbFilesAndFolders.Location = new System.Drawing.Point(4, 40); - this.tbFilesAndFolders.Name = "tbFilesAndFolders"; - this.tbFilesAndFolders.Padding = new System.Windows.Forms.Padding(3); - this.tbFilesAndFolders.Size = new System.Drawing.Size(509, 489); - this.tbFilesAndFolders.TabIndex = 1; - this.tbFilesAndFolders.Text = "Files and Folders"; - this.tbFilesAndFolders.UseVisualStyleBackColor = true; - // - // txtSeasonFormat - // - this.txtSeasonFormat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtSeasonFormat.Location = new System.Drawing.Point(113, 330); - this.txtSeasonFormat.Name = "txtSeasonFormat"; - this.txtSeasonFormat.Size = new System.Drawing.Size(390, 20); - this.txtSeasonFormat.TabIndex = 26; - // - // label47 - // - this.label47.AutoSize = true; - this.label47.Location = new System.Drawing.Point(6, 333); - this.label47.Name = "label47"; - this.label47.Size = new System.Drawing.Size(112, 13); - this.label47.TabIndex = 25; - this.label47.Text = "&Seasons folder format:"; - // - // bnTags - // - this.bnTags.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.bnTags.Location = new System.Drawing.Point(548, 328); - this.bnTags.Name = "bnTags"; - this.bnTags.Size = new System.Drawing.Size(75, 23); - this.bnTags.TabIndex = 24; - this.bnTags.Text = "Tags..."; - this.bnTags.UseVisualStyleBackColor = true; - this.bnTags.Click += new System.EventHandler(this.bnTags_Click); + this.tpBulkAdd.Controls.Add(this.groupBox9); + this.tpBulkAdd.Controls.Add(this.groupBox8); + this.tpBulkAdd.Location = new System.Drawing.Point(4, 40); + this.tpBulkAdd.Name = "tpBulkAdd"; + this.tpBulkAdd.Padding = new System.Windows.Forms.Padding(3); + this.tpBulkAdd.Size = new System.Drawing.Size(529, 426); + this.tpBulkAdd.TabIndex = 10; + this.tpBulkAdd.Text = "Bulk/Auto Add"; + this.tpBulkAdd.UseVisualStyleBackColor = true; // - // txtKeepTogether + // groupBox9 // - this.txtKeepTogether.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.groupBox9.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txtKeepTogether.Location = new System.Drawing.Point(204, 206); - this.txtKeepTogether.Name = "txtKeepTogether"; - this.txtKeepTogether.Size = new System.Drawing.Size(299, 20); - this.txtKeepTogether.TabIndex = 23; - // - // label39 - // - this.label39.AutoSize = true; - this.label39.Location = new System.Drawing.Point(25, 210); - this.label39.Name = "label39"; - this.label39.Size = new System.Drawing.Size(21, 13); - this.label39.TabIndex = 22; - this.label39.Text = "Do"; - // - // cbKeepTogetherMode - // - this.cbKeepTogetherMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbKeepTogetherMode.FormattingEnabled = true; - this.cbKeepTogetherMode.Items.AddRange(new object[] { - "All", - "All but these", - "Just"}); - this.cbKeepTogetherMode.Location = new System.Drawing.Point(52, 207); - this.cbKeepTogetherMode.Name = "cbKeepTogetherMode"; - this.cbKeepTogetherMode.Size = new System.Drawing.Size(146, 21); - this.cbKeepTogetherMode.Sorted = true; - this.cbKeepTogetherMode.TabIndex = 21; - this.cbKeepTogetherMode.SelectedIndexChanged += new System.EventHandler(this.cbKeepTogetherMode_SelectedIndexChanged); + this.groupBox9.Controls.Add(this.tbSeasonSearchTerms); + this.groupBox9.Controls.Add(this.label36); + this.groupBox9.Controls.Add(this.chkForceBulkAddToUseSettingsOnly); + this.groupBox9.Controls.Add(this.cbIgnoreRecycleBin); + this.groupBox9.Controls.Add(this.cbIgnoreNoVideoFolders); + this.groupBox9.Location = new System.Drawing.Point(6, 10); + this.groupBox9.Name = "groupBox9"; + this.groupBox9.Size = new System.Drawing.Size(517, 111); + this.groupBox9.TabIndex = 16; + this.groupBox9.TabStop = false; + this.groupBox9.Text = "Bulk Add"; // // tbSeasonSearchTerms // this.tbSeasonSearchTerms.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.tbSeasonSearchTerms.Location = new System.Drawing.Point(113, 353); + this.tbSeasonSearchTerms.Location = new System.Drawing.Point(113, 85); this.tbSeasonSearchTerms.Name = "tbSeasonSearchTerms"; - this.tbSeasonSearchTerms.Size = new System.Drawing.Size(390, 20); - this.tbSeasonSearchTerms.TabIndex = 20; + this.tbSeasonSearchTerms.Size = new System.Drawing.Size(401, 20); + this.tbSeasonSearchTerms.TabIndex = 22; // // label36 // this.label36.AutoSize = true; - this.label36.Location = new System.Drawing.Point(6, 356); + this.label36.Location = new System.Drawing.Point(6, 88); this.label36.Name = "label36"; this.label36.Size = new System.Drawing.Size(109, 13); - this.label36.TabIndex = 19; + this.label36.TabIndex = 21; this.label36.Text = "Season search terms:"; // - // txtSeasonFolderName + // groupBox8 // - this.txtSeasonFolderName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.groupBox8.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txtSeasonFolderName.Location = new System.Drawing.Point(113, 307); - this.txtSeasonFolderName.Name = "txtSeasonFolderName"; - this.txtSeasonFolderName.Size = new System.Drawing.Size(390, 20); - this.txtSeasonFolderName.TabIndex = 18; - // - // label35 - // - this.label35.AutoSize = true; - this.label35.Location = new System.Drawing.Point(6, 310); - this.label35.Name = "label35"; - this.label35.Size = new System.Drawing.Size(80, 13); - this.label35.TabIndex = 17; - this.label35.Text = "&Seasons name:"; + this.groupBox8.Controls.Add(this.chkAutoSearchForDownloadedFiles); + this.groupBox8.Controls.Add(this.label43); + this.groupBox8.Controls.Add(this.label44); + this.groupBox8.Controls.Add(this.tbIgnoreSuffixes); + this.groupBox8.Controls.Add(this.tbMovieTerms); + this.groupBox8.Location = new System.Drawing.Point(6, 127); + this.groupBox8.Name = "groupBox8"; + this.groupBox8.Size = new System.Drawing.Size(517, 107); + this.groupBox8.TabIndex = 13; + this.groupBox8.TabStop = false; + this.groupBox8.Text = "Auto Add"; // - // bnReplaceRemove + // chkAutoSearchForDownloadedFiles // - this.bnReplaceRemove.Location = new System.Drawing.Point(90, 91); - this.bnReplaceRemove.Name = "bnReplaceRemove"; - this.bnReplaceRemove.Size = new System.Drawing.Size(75, 23); - this.bnReplaceRemove.TabIndex = 3; - this.bnReplaceRemove.Text = "&Remove"; - this.bnReplaceRemove.UseVisualStyleBackColor = true; - this.bnReplaceRemove.Click += new System.EventHandler(this.bnReplaceRemove_Click); + this.chkAutoSearchForDownloadedFiles.AutoSize = true; + this.chkAutoSearchForDownloadedFiles.Location = new System.Drawing.Point(6, 19); + this.chkAutoSearchForDownloadedFiles.Name = "chkAutoSearchForDownloadedFiles"; + this.chkAutoSearchForDownloadedFiles.Size = new System.Drawing.Size(186, 17); + this.chkAutoSearchForDownloadedFiles.TabIndex = 16; + this.chkAutoSearchForDownloadedFiles.Text = "Notify when new shows are found"; + this.chkAutoSearchForDownloadedFiles.UseVisualStyleBackColor = true; // - // bnReplaceAdd + // label43 // - this.bnReplaceAdd.Location = new System.Drawing.Point(9, 91); - this.bnReplaceAdd.Name = "bnReplaceAdd"; - this.bnReplaceAdd.Size = new System.Drawing.Size(75, 23); - this.bnReplaceAdd.TabIndex = 2; - this.bnReplaceAdd.Text = "&Add"; - this.bnReplaceAdd.UseVisualStyleBackColor = true; - this.bnReplaceAdd.Click += new System.EventHandler(this.bnReplaceAdd_Click); + this.label43.AutoSize = true; + this.label43.Location = new System.Drawing.Point(3, 69); + this.label43.Name = "label43"; + this.label43.Size = new System.Drawing.Size(78, 13); + this.label43.TabIndex = 14; + this.label43.Text = "&Ignore suffixes:"; // - // label3 + // label44 // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(3, 3); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(120, 13); - this.label3.TabIndex = 0; - this.label3.Text = "Filename Replacements"; + this.label44.AutoSize = true; + this.label44.Location = new System.Drawing.Point(3, 43); + this.label44.Name = "label44"; + this.label44.Size = new System.Drawing.Size(71, 13); + this.label44.TabIndex = 12; + this.label44.Text = "&Movie Terms:"; // - // label19 + // tpTreeColoring // - this.label19.AutoSize = true; - this.label19.Location = new System.Drawing.Point(228, 379); - this.label19.Name = "label19"; - this.label19.Size = new System.Drawing.Size(55, 13); - this.label19.TabIndex = 15; - this.label19.Text = "MB in size"; + this.tpTreeColoring.Controls.Add(this.label7); + this.tpTreeColoring.Controls.Add(this.cboShowStatus); + this.tpTreeColoring.Controls.Add(this.label5); + this.tpTreeColoring.Controls.Add(this.txtShowStatusColor); + this.tpTreeColoring.Controls.Add(this.btnSelectColor); + this.tpTreeColoring.Controls.Add(this.bnRemoveDefinedColor); + this.tpTreeColoring.Controls.Add(this.btnAddShowStatusColoring); + this.tpTreeColoring.Controls.Add(this.lvwDefinedColors); + this.tpTreeColoring.Location = new System.Drawing.Point(4, 40); + this.tpTreeColoring.Name = "tpTreeColoring"; + this.tpTreeColoring.Padding = new System.Windows.Forms.Padding(3); + this.tpTreeColoring.Size = new System.Drawing.Size(529, 426); + this.tpTreeColoring.TabIndex = 7; + this.tpTreeColoring.Text = "Tree Colouring"; + this.tpTreeColoring.UseVisualStyleBackColor = true; // - // txtMaxSampleSize + // label7 // - this.txtMaxSampleSize.Location = new System.Drawing.Point(172, 376); - this.txtMaxSampleSize.Name = "txtMaxSampleSize"; - this.txtMaxSampleSize.Size = new System.Drawing.Size(53, 20); - this.txtMaxSampleSize.TabIndex = 14; - this.txtMaxSampleSize.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TxtNumberOnlyKeyPress); + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(3, 328); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(40, 13); + this.label7.TabIndex = 8; + this.label7.Text = "&Status:"; // - // label22 + // cboShowStatus // - this.label22.AutoSize = true; - this.label22.Location = new System.Drawing.Point(3, 157); - this.label22.Name = "label22"; - this.label22.Size = new System.Drawing.Size(89, 13); - this.label22.TabIndex = 6; - this.label22.Text = "&Other extensions:"; + this.cboShowStatus.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.cboShowStatus.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cboShowStatus.FormattingEnabled = true; + this.cboShowStatus.Location = new System.Drawing.Point(51, 325); + this.cboShowStatus.Name = "cboShowStatus"; + this.cboShowStatus.Size = new System.Drawing.Size(472, 21); + this.cboShowStatus.TabIndex = 7; // - // txtOtherExtensions + // label5 // - this.txtOtherExtensions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtOtherExtensions.Location = new System.Drawing.Point(99, 154); - this.txtOtherExtensions.Name = "txtOtherExtensions"; - this.txtOtherExtensions.Size = new System.Drawing.Size(404, 20); - this.txtOtherExtensions.TabIndex = 7; + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(3, 360); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(58, 13); + this.label5.TabIndex = 6; + this.label5.Text = "&Text Color:"; // - // cbForceLower + // txtShowStatusColor // - this.cbForceLower.AutoSize = true; - this.cbForceLower.Location = new System.Drawing.Point(6, 401); - this.cbForceLower.Name = "cbForceLower"; - this.cbForceLower.Size = new System.Drawing.Size(167, 17); - this.cbForceLower.TabIndex = 16; - this.cbForceLower.Text = "&Make all filenames lower case"; - this.cbForceLower.UseVisualStyleBackColor = true; + this.txtShowStatusColor.Location = new System.Drawing.Point(67, 357); + this.txtShowStatusColor.Name = "txtShowStatusColor"; + this.txtShowStatusColor.Size = new System.Drawing.Size(100, 20); + this.txtShowStatusColor.TabIndex = 5; + this.txtShowStatusColor.TextChanged += new System.EventHandler(this.txtShowStatusColor_TextChanged); // - // cbIgnoreSamples + // btnSelectColor // - this.cbIgnoreSamples.AutoSize = true; - this.cbIgnoreSamples.Location = new System.Drawing.Point(6, 378); - this.cbIgnoreSamples.Name = "cbIgnoreSamples"; - this.cbIgnoreSamples.Size = new System.Drawing.Size(166, 17); - this.cbIgnoreSamples.TabIndex = 13; - this.cbIgnoreSamples.Text = "&Ignore \"sample\" videos, up to"; - this.cbIgnoreSamples.UseVisualStyleBackColor = true; + this.btnSelectColor.Location = new System.Drawing.Point(173, 355); + this.btnSelectColor.Name = "btnSelectColor"; + this.btnSelectColor.Size = new System.Drawing.Size(75, 23); + this.btnSelectColor.TabIndex = 4; + this.btnSelectColor.Text = "Select &Color"; + this.btnSelectColor.UseVisualStyleBackColor = true; + this.btnSelectColor.Click += new System.EventHandler(this.btnSelectColor_Click); // - // tbAutoExport + // bnRemoveDefinedColor // - this.tbAutoExport.Controls.Add(this.groupBox7); - this.tbAutoExport.Controls.Add(this.groupBox5); - this.tbAutoExport.Controls.Add(this.groupBox4); - this.tbAutoExport.Controls.Add(this.groupBox3); - this.tbAutoExport.Controls.Add(this.groupBox2); - this.tbAutoExport.Location = new System.Drawing.Point(4, 40); - this.tbAutoExport.Name = "tbAutoExport"; - this.tbAutoExport.Padding = new System.Windows.Forms.Padding(3); - this.tbAutoExport.Size = new System.Drawing.Size(509, 489); - this.tbAutoExport.TabIndex = 2; - this.tbAutoExport.Text = "Automatic Export"; - this.tbAutoExport.UseVisualStyleBackColor = true; + this.bnRemoveDefinedColor.Enabled = false; + this.bnRemoveDefinedColor.Location = new System.Drawing.Point(6, 296); + this.bnRemoveDefinedColor.Name = "bnRemoveDefinedColor"; + this.bnRemoveDefinedColor.Size = new System.Drawing.Size(75, 23); + this.bnRemoveDefinedColor.TabIndex = 3; + this.bnRemoveDefinedColor.Text = "&Remove"; + this.bnRemoveDefinedColor.UseVisualStyleBackColor = true; + this.bnRemoveDefinedColor.Click += new System.EventHandler(this.bnRemoveDefinedColor_Click); // - // groupBox7 + // btnAddShowStatusColoring // - this.groupBox7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox7.Controls.Add(this.bnBrowseShowsHTML); - this.groupBox7.Controls.Add(this.cbShowsHTML); - this.groupBox7.Controls.Add(this.txtShowsHTMLTo); - this.groupBox7.Controls.Add(this.bnBrowseShowsTXT); - this.groupBox7.Controls.Add(this.cbShowsTXT); - this.groupBox7.Controls.Add(this.txtShowsTXTTo); - this.groupBox7.Location = new System.Drawing.Point(7, 227); - this.groupBox7.Name = "groupBox7"; - this.groupBox7.Size = new System.Drawing.Size(496, 72); - this.groupBox7.TabIndex = 4; - this.groupBox7.TabStop = false; - this.groupBox7.Text = "All Shows"; + this.btnAddShowStatusColoring.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnAddShowStatusColoring.Location = new System.Drawing.Point(448, 352); + this.btnAddShowStatusColoring.Name = "btnAddShowStatusColoring"; + this.btnAddShowStatusColoring.Size = new System.Drawing.Size(75, 23); + this.btnAddShowStatusColoring.TabIndex = 3; + this.btnAddShowStatusColoring.Text = "&Add"; + this.btnAddShowStatusColoring.UseVisualStyleBackColor = true; + this.btnAddShowStatusColoring.Click += new System.EventHandler(this.btnAddShowStatusColoring_Click); // - // bnBrowseShowsHTML + // lvwDefinedColors // - this.bnBrowseShowsHTML.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.bnBrowseShowsHTML.Location = new System.Drawing.Point(413, 45); - this.bnBrowseShowsHTML.Name = "bnBrowseShowsHTML"; - this.bnBrowseShowsHTML.Size = new System.Drawing.Size(75, 23); - this.bnBrowseShowsHTML.TabIndex = 8; - this.bnBrowseShowsHTML.Text = "Browse..."; - this.bnBrowseShowsHTML.UseVisualStyleBackColor = true; - this.bnBrowseShowsHTML.Click += new System.EventHandler(this.bnBrowseShowsHTML_Click); + this.lvwDefinedColors.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lvwDefinedColors.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.colShowStatus, + this.colColor}); + this.lvwDefinedColors.GridLines = true; + this.lvwDefinedColors.Location = new System.Drawing.Point(6, 6); + this.lvwDefinedColors.MultiSelect = false; + this.lvwDefinedColors.Name = "lvwDefinedColors"; + this.lvwDefinedColors.Size = new System.Drawing.Size(517, 284); + this.lvwDefinedColors.TabIndex = 0; + this.lvwDefinedColors.UseCompatibleStateImageBehavior = false; + this.lvwDefinedColors.View = System.Windows.Forms.View.Details; + this.lvwDefinedColors.SelectedIndexChanged += new System.EventHandler(this.lvwDefinedColors_SelectedIndexChanged); + this.lvwDefinedColors.DoubleClick += new System.EventHandler(this.lvwDefinedColors_DoubleClick); // - // cbShowsHTML + // colShowStatus // - this.cbShowsHTML.AutoSize = true; - this.cbShowsHTML.Location = new System.Drawing.Point(8, 49); - this.cbShowsHTML.Name = "cbShowsHTML"; - this.cbShowsHTML.Size = new System.Drawing.Size(56, 17); - this.cbShowsHTML.TabIndex = 6; - this.cbShowsHTML.Text = "HTML"; - this.cbShowsHTML.UseVisualStyleBackColor = true; - this.cbShowsHTML.CheckedChanged += new System.EventHandler(this.EnableDisable); + this.colShowStatus.Text = "Show Status"; + this.colShowStatus.Width = 297; // - // txtShowsHTMLTo + // colColor // - this.txtShowsHTMLTo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtShowsHTMLTo.Location = new System.Drawing.Point(64, 47); - this.txtShowsHTMLTo.Name = "txtShowsHTMLTo"; - this.txtShowsHTMLTo.Size = new System.Drawing.Size(343, 20); - this.txtShowsHTMLTo.TabIndex = 7; + this.colColor.Text = "Color"; + this.colColor.Width = 92; // - // bnBrowseShowsTXT + // tbuTorrentNZB // - this.bnBrowseShowsTXT.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.bnBrowseShowsTXT.Location = new System.Drawing.Point(413, 21); - this.bnBrowseShowsTXT.Name = "bnBrowseShowsTXT"; - this.bnBrowseShowsTXT.Size = new System.Drawing.Size(75, 23); - this.bnBrowseShowsTXT.TabIndex = 5; - this.bnBrowseShowsTXT.Text = "Browse..."; - this.bnBrowseShowsTXT.UseVisualStyleBackColor = true; - this.bnBrowseShowsTXT.Click += new System.EventHandler(this.bnBrowseShowsTXT_Click); + this.tbuTorrentNZB.Controls.Add(this.qBitTorrent); + this.tbuTorrentNZB.Controls.Add(this.groupBox1); + this.tbuTorrentNZB.Controls.Add(this.groupBox6); + this.tbuTorrentNZB.Location = new System.Drawing.Point(4, 40); + this.tbuTorrentNZB.Name = "tbuTorrentNZB"; + this.tbuTorrentNZB.Padding = new System.Windows.Forms.Padding(3); + this.tbuTorrentNZB.Size = new System.Drawing.Size(529, 426); + this.tbuTorrentNZB.TabIndex = 4; + this.tbuTorrentNZB.Text = "Torrents / NZB"; + this.tbuTorrentNZB.UseVisualStyleBackColor = true; // - // cbShowsTXT + // qBitTorrent // - this.cbShowsTXT.AutoSize = true; - this.cbShowsTXT.Location = new System.Drawing.Point(8, 25); - this.cbShowsTXT.Name = "cbShowsTXT"; - this.cbShowsTXT.Size = new System.Drawing.Size(47, 17); - this.cbShowsTXT.TabIndex = 3; - this.cbShowsTXT.Text = "TXT"; - this.cbShowsTXT.UseVisualStyleBackColor = true; - this.cbShowsTXT.CheckedChanged += new System.EventHandler(this.EnableDisable); + this.qBitTorrent.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.qBitTorrent.Controls.Add(this.tbqBitTorrentHost); + this.qBitTorrent.Controls.Add(this.tbqBitTorrentPort); + this.qBitTorrent.Controls.Add(this.label41); + this.qBitTorrent.Controls.Add(this.label42); + this.qBitTorrent.Location = new System.Drawing.Point(6, 179); + this.qBitTorrent.Name = "qBitTorrent"; + this.qBitTorrent.Size = new System.Drawing.Size(520, 81); + this.qBitTorrent.TabIndex = 7; + this.qBitTorrent.TabStop = false; + this.qBitTorrent.Text = "qBitTorrent"; // - // txtShowsTXTTo + // tbqBitTorrentHost // - this.txtShowsTXTTo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.tbqBitTorrentHost.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txtShowsTXTTo.Location = new System.Drawing.Point(64, 23); - this.txtShowsTXTTo.Name = "txtShowsTXTTo"; - this.txtShowsTXTTo.Size = new System.Drawing.Size(342, 20); - this.txtShowsTXTTo.TabIndex = 4; + this.tbqBitTorrentHost.Location = new System.Drawing.Point(75, 19); + this.tbqBitTorrentHost.Name = "tbqBitTorrentHost"; + this.tbqBitTorrentHost.Size = new System.Drawing.Size(439, 20); + this.tbqBitTorrentHost.TabIndex = 1; // - // groupBox5 + // tbqBitTorrentPort // - this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.tbqBitTorrentPort.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox5.Controls.Add(this.bnBrowseFOXML); - this.groupBox5.Controls.Add(this.cbFOXML); - this.groupBox5.Controls.Add(this.txtFOXML); - this.groupBox5.Location = new System.Drawing.Point(6, 367); - this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(497, 55); - this.groupBox5.TabIndex = 3; - this.groupBox5.TabStop = false; - this.groupBox5.Text = "Finding and Organising"; + this.tbqBitTorrentPort.Location = new System.Drawing.Point(75, 48); + this.tbqBitTorrentPort.Name = "tbqBitTorrentPort"; + this.tbqBitTorrentPort.Size = new System.Drawing.Size(439, 20); + this.tbqBitTorrentPort.TabIndex = 4; // - // bnBrowseFOXML + // label41 // - this.bnBrowseFOXML.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.bnBrowseFOXML.Location = new System.Drawing.Point(413, 19); - this.bnBrowseFOXML.Name = "bnBrowseFOXML"; - this.bnBrowseFOXML.Size = new System.Drawing.Size(75, 23); - this.bnBrowseFOXML.TabIndex = 2; - this.bnBrowseFOXML.Text = "Browse..."; - this.bnBrowseFOXML.UseVisualStyleBackColor = true; - this.bnBrowseFOXML.Click += new System.EventHandler(this.bnBrowseFOXML_Click); + this.label41.AutoSize = true; + this.label41.Location = new System.Drawing.Point(11, 51); + this.label41.Name = "label41"; + this.label41.Size = new System.Drawing.Size(29, 13); + this.label41.TabIndex = 3; + this.label41.Text = "Port:"; // - // cbFOXML + // label42 // - this.cbFOXML.AutoSize = true; - this.cbFOXML.Location = new System.Drawing.Point(8, 23); - this.cbFOXML.Name = "cbFOXML"; - this.cbFOXML.Size = new System.Drawing.Size(48, 17); - this.cbFOXML.TabIndex = 0; - this.cbFOXML.Text = "XML"; - this.cbFOXML.UseVisualStyleBackColor = true; - this.cbFOXML.CheckedChanged += new System.EventHandler(this.EnableDisable); + this.label42.AutoSize = true; + this.label42.Location = new System.Drawing.Point(11, 22); + this.label42.Name = "label42"; + this.label42.Size = new System.Drawing.Size(32, 13); + this.label42.TabIndex = 0; + this.label42.Text = "Host:"; // - // txtFOXML + // groupBox1 // - this.txtFOXML.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txtFOXML.Location = new System.Drawing.Point(64, 21); - this.txtFOXML.Name = "txtFOXML"; - this.txtFOXML.Size = new System.Drawing.Size(343, 20); - this.txtFOXML.TabIndex = 1; + this.groupBox1.Controls.Add(this.txtSABHostPort); + this.groupBox1.Controls.Add(this.txtSABAPIKey); + this.groupBox1.Controls.Add(this.label8); + this.groupBox1.Controls.Add(this.label9); + this.groupBox1.Location = new System.Drawing.Point(6, 6); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(520, 81); + this.groupBox1.TabIndex = 6; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "SABnzbd"; // - // groupBox4 + // txtSABHostPort // - this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtSABHostPort.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox4.Controls.Add(this.bnBrowseRenamingXML); - this.groupBox4.Controls.Add(this.cbRenamingXML); - this.groupBox4.Controls.Add(this.txtRenamingXML); - this.groupBox4.Location = new System.Drawing.Point(6, 305); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(497, 57); - this.groupBox4.TabIndex = 2; - this.groupBox4.TabStop = false; - this.groupBox4.Text = "Renaming"; + this.txtSABHostPort.Location = new System.Drawing.Point(75, 19); + this.txtSABHostPort.Name = "txtSABHostPort"; + this.txtSABHostPort.Size = new System.Drawing.Size(439, 20); + this.txtSABHostPort.TabIndex = 1; // - // bnBrowseRenamingXML + // txtSABAPIKey // - this.bnBrowseRenamingXML.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.bnBrowseRenamingXML.Location = new System.Drawing.Point(413, 19); - this.bnBrowseRenamingXML.Name = "bnBrowseRenamingXML"; - this.bnBrowseRenamingXML.Size = new System.Drawing.Size(75, 23); - this.bnBrowseRenamingXML.TabIndex = 2; - this.bnBrowseRenamingXML.Text = "Browse..."; - this.bnBrowseRenamingXML.UseVisualStyleBackColor = true; - this.bnBrowseRenamingXML.Click += new System.EventHandler(this.bnBrowseRenamingXML_Click); + this.txtSABAPIKey.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtSABAPIKey.Location = new System.Drawing.Point(75, 48); + this.txtSABAPIKey.Name = "txtSABAPIKey"; + this.txtSABAPIKey.Size = new System.Drawing.Size(439, 20); + this.txtSABAPIKey.TabIndex = 4; // - // cbRenamingXML + // label8 // - this.cbRenamingXML.AutoSize = true; - this.cbRenamingXML.Location = new System.Drawing.Point(8, 23); - this.cbRenamingXML.Name = "cbRenamingXML"; - this.cbRenamingXML.Size = new System.Drawing.Size(48, 17); - this.cbRenamingXML.TabIndex = 0; - this.cbRenamingXML.Text = "XML"; - this.cbRenamingXML.UseVisualStyleBackColor = true; - this.cbRenamingXML.CheckedChanged += new System.EventHandler(this.EnableDisable); + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(11, 51); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(48, 13); + this.label8.TabIndex = 3; + this.label8.Text = "API Key:"; // - // txtRenamingXML + // label9 // - this.txtRenamingXML.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtRenamingXML.Location = new System.Drawing.Point(64, 21); - this.txtRenamingXML.Name = "txtRenamingXML"; - this.txtRenamingXML.Size = new System.Drawing.Size(343, 20); - this.txtRenamingXML.TabIndex = 1; + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(11, 22); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(51, 13); + this.label9.TabIndex = 0; + this.label9.Text = "Host:Port"; // - // groupBox3 + // groupBox6 // - this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox3.Controls.Add(this.bnBrowseMissingCSV); - this.groupBox3.Controls.Add(this.bnBrowseMissingXML); - this.groupBox3.Controls.Add(this.txtMissingCSV); - this.groupBox3.Controls.Add(this.cbMissingXML); - this.groupBox3.Controls.Add(this.cbMissingCSV); - this.groupBox3.Controls.Add(this.txtMissingXML); - this.groupBox3.Location = new System.Drawing.Point(6, 147); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(497, 79); - this.groupBox3.TabIndex = 1; - this.groupBox3.TabStop = false; - this.groupBox3.Text = "Missing"; + this.groupBox6.Controls.Add(this.bnUTBrowseResumeDat); + this.groupBox6.Controls.Add(this.txtUTResumeDatPath); + this.groupBox6.Controls.Add(this.bnRSSBrowseuTorrent); + this.groupBox6.Controls.Add(this.label27); + this.groupBox6.Controls.Add(this.label26); + this.groupBox6.Controls.Add(this.txtRSSuTorrentPath); + this.groupBox6.Location = new System.Drawing.Point(6, 93); + this.groupBox6.Name = "groupBox6"; + this.groupBox6.Size = new System.Drawing.Size(520, 80); + this.groupBox6.TabIndex = 5; + this.groupBox6.TabStop = false; + this.groupBox6.Text = "µTorrent"; // - // bnBrowseMissingCSV + // bnUTBrowseResumeDat // - this.bnBrowseMissingCSV.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.bnBrowseMissingCSV.Location = new System.Drawing.Point(413, 47); - this.bnBrowseMissingCSV.Name = "bnBrowseMissingCSV"; - this.bnBrowseMissingCSV.Size = new System.Drawing.Size(75, 23); - this.bnBrowseMissingCSV.TabIndex = 2; - this.bnBrowseMissingCSV.Text = "Browse..."; - this.bnBrowseMissingCSV.UseVisualStyleBackColor = true; - this.bnBrowseMissingCSV.Click += new System.EventHandler(this.bnBrowseMissingCSV_Click); + this.bnUTBrowseResumeDat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.bnUTBrowseResumeDat.Location = new System.Drawing.Point(439, 46); + this.bnUTBrowseResumeDat.Name = "bnUTBrowseResumeDat"; + this.bnUTBrowseResumeDat.Size = new System.Drawing.Size(75, 23); + this.bnUTBrowseResumeDat.TabIndex = 5; + this.bnUTBrowseResumeDat.Text = "Bro&wse..."; + this.bnUTBrowseResumeDat.UseVisualStyleBackColor = true; + this.bnUTBrowseResumeDat.Click += new System.EventHandler(this.bnUTBrowseResumeDat_Click); // - // bnBrowseMissingXML + // txtUTResumeDatPath // - this.bnBrowseMissingXML.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.bnBrowseMissingXML.Location = new System.Drawing.Point(414, 19); - this.bnBrowseMissingXML.Name = "bnBrowseMissingXML"; - this.bnBrowseMissingXML.Size = new System.Drawing.Size(75, 23); - this.bnBrowseMissingXML.TabIndex = 5; - this.bnBrowseMissingXML.Text = "Browse..."; - this.bnBrowseMissingXML.UseVisualStyleBackColor = true; - this.bnBrowseMissingXML.Click += new System.EventHandler(this.bnBrowseMissingXML_Click); + this.txtUTResumeDatPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtUTResumeDatPath.Location = new System.Drawing.Point(75, 48); + this.txtUTResumeDatPath.Name = "txtUTResumeDatPath"; + this.txtUTResumeDatPath.Size = new System.Drawing.Size(358, 20); + this.txtUTResumeDatPath.TabIndex = 4; // - // txtMissingCSV + // bnRSSBrowseuTorrent // - this.txtMissingCSV.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtMissingCSV.Location = new System.Drawing.Point(64, 48); - this.txtMissingCSV.Name = "txtMissingCSV"; - this.txtMissingCSV.Size = new System.Drawing.Size(343, 20); - this.txtMissingCSV.TabIndex = 1; + this.bnRSSBrowseuTorrent.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.bnRSSBrowseuTorrent.Location = new System.Drawing.Point(439, 16); + this.bnRSSBrowseuTorrent.Name = "bnRSSBrowseuTorrent"; + this.bnRSSBrowseuTorrent.Size = new System.Drawing.Size(75, 23); + this.bnRSSBrowseuTorrent.TabIndex = 2; + this.bnRSSBrowseuTorrent.Text = "&Browse..."; + this.bnRSSBrowseuTorrent.UseVisualStyleBackColor = true; + this.bnRSSBrowseuTorrent.Click += new System.EventHandler(this.bnRSSBrowseuTorrent_Click); // - // cbMissingXML + // label27 // - this.cbMissingXML.AutoSize = true; - this.cbMissingXML.Location = new System.Drawing.Point(8, 23); - this.cbMissingXML.Name = "cbMissingXML"; - this.cbMissingXML.Size = new System.Drawing.Size(48, 17); - this.cbMissingXML.TabIndex = 3; - this.cbMissingXML.Text = "XML"; - this.cbMissingXML.UseVisualStyleBackColor = true; - this.cbMissingXML.CheckedChanged += new System.EventHandler(this.EnableDisable); + this.label27.AutoSize = true; + this.label27.Location = new System.Drawing.Point(7, 22); + this.label27.Name = "label27"; + this.label27.Size = new System.Drawing.Size(62, 13); + this.label27.TabIndex = 0; + this.label27.Text = "A&pplication:"; // - // cbMissingCSV + // label26 // - this.cbMissingCSV.AutoSize = true; - this.cbMissingCSV.Location = new System.Drawing.Point(9, 48); - this.cbMissingCSV.Name = "cbMissingCSV"; - this.cbMissingCSV.Size = new System.Drawing.Size(47, 17); - this.cbMissingCSV.TabIndex = 0; - this.cbMissingCSV.Text = "CSV"; - this.cbMissingCSV.UseVisualStyleBackColor = true; - this.cbMissingCSV.CheckedChanged += new System.EventHandler(this.EnableDisable); + this.label26.AutoSize = true; + this.label26.Location = new System.Drawing.Point(7, 51); + this.label26.Name = "label26"; + this.label26.Size = new System.Drawing.Size(62, 13); + this.label26.TabIndex = 3; + this.label26.Text = "resume.&dat:"; // - // txtMissingXML + // txtRSSuTorrentPath // - this.txtMissingXML.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtRSSuTorrentPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txtMissingXML.Location = new System.Drawing.Point(64, 21); - this.txtMissingXML.Name = "txtMissingXML"; - this.txtMissingXML.Size = new System.Drawing.Size(343, 20); - this.txtMissingXML.TabIndex = 4; - // - // tpScanOptions + this.txtRSSuTorrentPath.Location = new System.Drawing.Point(75, 19); + this.txtRSSuTorrentPath.Name = "txtRSSuTorrentPath"; + this.txtRSSuTorrentPath.Size = new System.Drawing.Size(358, 20); + this.txtRSSuTorrentPath.TabIndex = 1; // - this.tpScanOptions.Controls.Add(this.cbCheckqBitTorrent); - this.tpScanOptions.Controls.Add(this.chkAutoMergeLibraryEpisodes); - this.tpScanOptions.Controls.Add(this.chkAutoMergeDownloadEpisodes); - this.tpScanOptions.Controls.Add(this.chkPreventMove); - this.tpScanOptions.Controls.Add(this.label40); - this.tpScanOptions.Controls.Add(this.cbxUpdateAirDate); - this.tpScanOptions.Controls.Add(this.label33); - this.tpScanOptions.Controls.Add(this.cbAutoCreateFolders); - this.tpScanOptions.Controls.Add(this.label28); - this.tpScanOptions.Controls.Add(this.cbSearchRSS); - this.tpScanOptions.Controls.Add(this.cbRenameCheck); - this.tpScanOptions.Controls.Add(this.cbMissing); - this.tpScanOptions.Controls.Add(this.cbLeaveOriginals); - this.tpScanOptions.Controls.Add(this.cbCheckSABnzbd); - this.tpScanOptions.Controls.Add(this.cbCheckuTorrent); - this.tpScanOptions.Controls.Add(this.cbSearchLocally); - this.tpScanOptions.Location = new System.Drawing.Point(4, 40); - this.tpScanOptions.Name = "tpScanOptions"; - this.tpScanOptions.Padding = new System.Windows.Forms.Padding(3); - this.tpScanOptions.Size = new System.Drawing.Size(509, 489); - this.tpScanOptions.TabIndex = 6; - this.tpScanOptions.Text = "Scan Options"; - this.tpScanOptions.UseVisualStyleBackColor = true; + // tbSearchFolders // - // cbCheckqBitTorrent + this.tbSearchFolders.Controls.Add(this.label1); + this.tbSearchFolders.Controls.Add(this.domainUpDown1); + this.tbSearchFolders.Controls.Add(this.chkScheduledScan); + this.tbSearchFolders.Controls.Add(this.chkScanOnStartup); + this.tbSearchFolders.Controls.Add(this.lblScanAction); + this.tbSearchFolders.Controls.Add(this.rdoQuickScan); + this.tbSearchFolders.Controls.Add(this.rdoRecentScan); + this.tbSearchFolders.Controls.Add(this.rdoFullScan); + this.tbSearchFolders.Controls.Add(this.cbMonitorFolder); + this.tbSearchFolders.Controls.Add(this.bnOpenSearchFolder); + this.tbSearchFolders.Controls.Add(this.bnRemoveSearchFolder); + this.tbSearchFolders.Controls.Add(this.bnAddSearchFolder); + this.tbSearchFolders.Controls.Add(this.lbSearchFolders); + this.tbSearchFolders.Controls.Add(this.label23); + this.tbSearchFolders.Location = new System.Drawing.Point(4, 40); + this.tbSearchFolders.Name = "tbSearchFolders"; + this.tbSearchFolders.Size = new System.Drawing.Size(529, 426); + this.tbSearchFolders.TabIndex = 3; + this.tbSearchFolders.Text = "Search Folders"; + this.tbSearchFolders.UseVisualStyleBackColor = true; // - this.cbCheckqBitTorrent.AutoSize = true; - this.cbCheckqBitTorrent.Location = new System.Drawing.Point(40, 190); - this.cbCheckqBitTorrent.Name = "cbCheckqBitTorrent"; - this.cbCheckqBitTorrent.Size = new System.Drawing.Size(145, 17); - this.cbCheckqBitTorrent.TabIndex = 16; - this.cbCheckqBitTorrent.Text = "Check &qBitTorrent queue"; - this.cbCheckqBitTorrent.UseVisualStyleBackColor = true; + // label1 // - // chkAutoMergeLibraryEpisodes + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(178, 89); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(33, 13); + this.label1.TabIndex = 26; + this.label1.Text = "hours"; // - this.chkAutoMergeLibraryEpisodes.AutoSize = true; - this.chkAutoMergeLibraryEpisodes.Location = new System.Drawing.Point(9, 351); - this.chkAutoMergeLibraryEpisodes.Name = "chkAutoMergeLibraryEpisodes"; - this.chkAutoMergeLibraryEpisodes.Size = new System.Drawing.Size(306, 17); - this.chkAutoMergeLibraryEpisodes.TabIndex = 15; - this.chkAutoMergeLibraryEpisodes.Text = "Automatically create merge rules for merged library episodes"; - this.chkAutoMergeLibraryEpisodes.UseVisualStyleBackColor = true; + // domainUpDown1 // - // chkAutoMergeDownloadEpisodes + this.domainUpDown1.Items.Add("1"); + this.domainUpDown1.Items.Add("2"); + this.domainUpDown1.Items.Add("3"); + this.domainUpDown1.Items.Add("4"); + this.domainUpDown1.Items.Add("5"); + this.domainUpDown1.Items.Add("6"); + this.domainUpDown1.Items.Add("8"); + this.domainUpDown1.Items.Add("12"); + this.domainUpDown1.Items.Add("24"); + this.domainUpDown1.Items.Add("48"); + this.domainUpDown1.Items.Add("96"); + this.domainUpDown1.Location = new System.Drawing.Point(134, 87); + this.domainUpDown1.Name = "domainUpDown1"; + this.domainUpDown1.Size = new System.Drawing.Size(40, 20); + this.domainUpDown1.TabIndex = 25; + this.domainUpDown1.Text = "1"; + this.domainUpDown1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.domainUpDown1_KeyDown); // - this.chkAutoMergeDownloadEpisodes.AutoSize = true; - this.chkAutoMergeDownloadEpisodes.Location = new System.Drawing.Point(9, 329); - this.chkAutoMergeDownloadEpisodes.Name = "chkAutoMergeDownloadEpisodes"; - this.chkAutoMergeDownloadEpisodes.Size = new System.Drawing.Size(337, 17); - this.chkAutoMergeDownloadEpisodes.TabIndex = 13; - this.chkAutoMergeDownloadEpisodes.Text = "Automatically create merge rules for merged downloaded episodes"; - this.chkAutoMergeDownloadEpisodes.UseVisualStyleBackColor = true; + // lblScanAction // - // chkPreventMove + this.lblScanAction.AutoSize = true; + this.lblScanAction.Location = new System.Drawing.Point(2, 12); + this.lblScanAction.Name = "lblScanAction"; + this.lblScanAction.Size = new System.Drawing.Size(59, 13); + this.lblScanAction.TabIndex = 22; + this.lblScanAction.Text = "&Scan Type"; // - this.chkPreventMove.AutoSize = true; - this.chkPreventMove.Location = new System.Drawing.Point(40, 56); - this.chkPreventMove.Name = "chkPreventMove"; - this.chkPreventMove.Size = new System.Drawing.Size(188, 17); - this.chkPreventMove.TabIndex = 12; - this.chkPreventMove.Text = "Pre&vent move of files (just rename)"; - this.chkPreventMove.UseVisualStyleBackColor = true; + // rdoQuickScan // - // label40 + this.rdoQuickScan.AutoSize = true; + this.rdoQuickScan.Location = new System.Drawing.Point(134, 28); + this.rdoQuickScan.Name = "rdoQuickScan"; + this.rdoQuickScan.Size = new System.Drawing.Size(53, 17); + this.rdoQuickScan.TabIndex = 20; + this.rdoQuickScan.TabStop = true; + this.rdoQuickScan.Text = "&Quick"; + this.rdoQuickScan.UseVisualStyleBackColor = true; // - this.label40.AutoSize = true; - this.label40.Location = new System.Drawing.Point(6, 290); - this.label40.Name = "label40"; - this.label40.Size = new System.Drawing.Size(94, 13); - this.label40.TabIndex = 11; - this.label40.Text = "Additional Actions:"; + // rdoRecentScan // - // cbxUpdateAirDate + this.rdoRecentScan.AutoSize = true; + this.rdoRecentScan.Location = new System.Drawing.Point(68, 28); + this.rdoRecentScan.Name = "rdoRecentScan"; + this.rdoRecentScan.Size = new System.Drawing.Size(60, 17); + this.rdoRecentScan.TabIndex = 19; + this.rdoRecentScan.TabStop = true; + this.rdoRecentScan.Text = "&Recent"; + this.rdoRecentScan.UseVisualStyleBackColor = true; // - this.cbxUpdateAirDate.AutoSize = true; - this.cbxUpdateAirDate.Location = new System.Drawing.Point(9, 306); - this.cbxUpdateAirDate.Name = "cbxUpdateAirDate"; - this.cbxUpdateAirDate.Size = new System.Drawing.Size(197, 17); - this.cbxUpdateAirDate.TabIndex = 10; - this.cbxUpdateAirDate.Text = "Update files and folders with air date"; - this.cbxUpdateAirDate.UseVisualStyleBackColor = true; + // rdoFullScan // - // label33 + this.rdoFullScan.AutoSize = true; + this.rdoFullScan.Location = new System.Drawing.Point(21, 28); + this.rdoFullScan.Name = "rdoFullScan"; + this.rdoFullScan.Size = new System.Drawing.Size(41, 17); + this.rdoFullScan.TabIndex = 18; + this.rdoFullScan.TabStop = true; + this.rdoFullScan.Text = "&Full"; + this.rdoFullScan.UseVisualStyleBackColor = true; // - this.label33.AutoSize = true; - this.label33.Location = new System.Drawing.Point(6, 243); - this.label33.Name = "label33"; - this.label33.Size = new System.Drawing.Size(80, 13); - this.label33.TabIndex = 9; - this.label33.Text = "Folder creation:"; + // bnOpenSearchFolder // - // cbAutoCreateFolders + this.bnOpenSearchFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.bnOpenSearchFolder.Location = new System.Drawing.Point(165, 395); + this.bnOpenSearchFolder.Name = "bnOpenSearchFolder"; + this.bnOpenSearchFolder.Size = new System.Drawing.Size(75, 23); + this.bnOpenSearchFolder.TabIndex = 4; + this.bnOpenSearchFolder.Text = "&Open"; + this.bnOpenSearchFolder.UseVisualStyleBackColor = true; + this.bnOpenSearchFolder.Click += new System.EventHandler(this.bnOpenSearchFolder_Click); // - this.cbAutoCreateFolders.AutoSize = true; - this.cbAutoCreateFolders.Location = new System.Drawing.Point(9, 259); - this.cbAutoCreateFolders.Name = "cbAutoCreateFolders"; - this.cbAutoCreateFolders.Size = new System.Drawing.Size(192, 17); - this.cbAutoCreateFolders.TabIndex = 8; - this.cbAutoCreateFolders.Text = "&Automatically create missing folders"; - this.cbAutoCreateFolders.UseVisualStyleBackColor = true; + // bnRemoveSearchFolder // - // label28 + this.bnRemoveSearchFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.bnRemoveSearchFolder.Location = new System.Drawing.Point(84, 395); + this.bnRemoveSearchFolder.Name = "bnRemoveSearchFolder"; + this.bnRemoveSearchFolder.Size = new System.Drawing.Size(75, 23); + this.bnRemoveSearchFolder.TabIndex = 3; + this.bnRemoveSearchFolder.Text = "&Remove"; + this.bnRemoveSearchFolder.UseVisualStyleBackColor = true; + this.bnRemoveSearchFolder.Click += new System.EventHandler(this.bnRemoveSearchFolder_Click); // - this.label28.AutoSize = true; - this.label28.Location = new System.Drawing.Point(6, 13); - this.label28.Name = "label28"; - this.label28.Size = new System.Drawing.Size(141, 13); - this.label28.TabIndex = 0; - this.label28.Text = "\"Scan\" checks and actions:"; + // bnAddSearchFolder // - // cbSearchRSS + this.bnAddSearchFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.bnAddSearchFolder.Location = new System.Drawing.Point(3, 395); + this.bnAddSearchFolder.Name = "bnAddSearchFolder"; + this.bnAddSearchFolder.Size = new System.Drawing.Size(75, 23); + this.bnAddSearchFolder.TabIndex = 2; + this.bnAddSearchFolder.Text = "&Add"; + this.bnAddSearchFolder.UseVisualStyleBackColor = true; + this.bnAddSearchFolder.Click += new System.EventHandler(this.bnAddSearchFolder_Click); // - this.cbSearchRSS.AutoSize = true; - this.cbSearchRSS.Location = new System.Drawing.Point(40, 211); - this.cbSearchRSS.Name = "cbSearchRSS"; - this.cbSearchRSS.Size = new System.Drawing.Size(158, 17); - this.cbSearchRSS.TabIndex = 7; - this.cbSearchRSS.Text = "&Search RSS for missing files"; - this.cbSearchRSS.UseVisualStyleBackColor = true; + // lbSearchFolders // - // cbRenameCheck + this.lbSearchFolders.AllowDrop = true; + this.lbSearchFolders.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lbSearchFolders.FormattingEnabled = true; + this.lbSearchFolders.Location = new System.Drawing.Point(3, 153); + this.lbSearchFolders.Name = "lbSearchFolders"; + this.lbSearchFolders.ScrollAlwaysVisible = true; + this.lbSearchFolders.Size = new System.Drawing.Size(523, 225); + this.lbSearchFolders.TabIndex = 1; + this.lbSearchFolders.DragDrop += new System.Windows.Forms.DragEventHandler(this.lbSearchFolders_DragDrop); + this.lbSearchFolders.DragOver += new System.Windows.Forms.DragEventHandler(this.lbSearchFolders_DragOver); + this.lbSearchFolders.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lbSearchFolders_KeyDown); // - this.cbRenameCheck.AutoSize = true; - this.cbRenameCheck.Checked = true; - this.cbRenameCheck.CheckState = System.Windows.Forms.CheckState.Checked; - this.cbRenameCheck.Location = new System.Drawing.Point(20, 33); - this.cbRenameCheck.Name = "cbRenameCheck"; - this.cbRenameCheck.Size = new System.Drawing.Size(100, 17); - this.cbRenameCheck.TabIndex = 1; - this.cbRenameCheck.Text = "&Rename Check"; - this.cbRenameCheck.UseVisualStyleBackColor = true; + // label23 // - // cbMissing + this.label23.AutoSize = true; + this.label23.Location = new System.Drawing.Point(5, 131); + this.label23.Name = "label23"; + this.label23.Size = new System.Drawing.Size(78, 13); + this.label23.TabIndex = 0; + this.label23.Text = "&Search Folders"; // - this.cbMissing.AutoSize = true; - this.cbMissing.Checked = true; - this.cbMissing.CheckState = System.Windows.Forms.CheckState.Checked; - this.cbMissing.Location = new System.Drawing.Point(20, 79); - this.cbMissing.Name = "cbMissing"; - this.cbMissing.Size = new System.Drawing.Size(95, 17); - this.cbMissing.TabIndex = 2; - this.cbMissing.Text = "&Missing Check"; - this.cbMissing.UseVisualStyleBackColor = true; - this.cbMissing.CheckedChanged += new System.EventHandler(this.cbMissing_CheckedChanged); + // tbMediaCenter // - // cbLeaveOriginals + this.tbMediaCenter.Controls.Add(this.cbWDLiveEpisodeFiles); + this.tbMediaCenter.Controls.Add(this.cbNFOEpisodes); + this.tbMediaCenter.Controls.Add(this.panel1); + this.tbMediaCenter.Controls.Add(this.cbKODIImages); + this.tbMediaCenter.Controls.Add(this.bnMCPresets); + this.tbMediaCenter.Controls.Add(this.cbShrinkLarge); + this.tbMediaCenter.Controls.Add(this.cbEpThumbJpg); + this.tbMediaCenter.Controls.Add(this.label29); + this.tbMediaCenter.Controls.Add(this.label24); + this.tbMediaCenter.Controls.Add(this.label18); + this.tbMediaCenter.Controls.Add(this.label12); + this.tbMediaCenter.Controls.Add(this.cbMetaSubfolder); + this.tbMediaCenter.Controls.Add(this.cbMeta); + this.tbMediaCenter.Controls.Add(this.cbEpTBNs); + this.tbMediaCenter.Controls.Add(this.cbSeriesJpg); + this.tbMediaCenter.Controls.Add(this.cbXMLFiles); + this.tbMediaCenter.Controls.Add(this.cbNFOShows); + this.tbMediaCenter.Controls.Add(this.cbFantArtJpg); + this.tbMediaCenter.Controls.Add(this.cbFolderJpg); + this.tbMediaCenter.Location = new System.Drawing.Point(4, 40); + this.tbMediaCenter.Name = "tbMediaCenter"; + this.tbMediaCenter.Padding = new System.Windows.Forms.Padding(3); + this.tbMediaCenter.Size = new System.Drawing.Size(529, 426); + this.tbMediaCenter.TabIndex = 8; + this.tbMediaCenter.Text = "Media Centres"; + this.tbMediaCenter.UseVisualStyleBackColor = true; // - this.cbLeaveOriginals.AutoSize = true; - this.cbLeaveOriginals.Location = new System.Drawing.Point(60, 125); - this.cbLeaveOriginals.Name = "cbLeaveOriginals"; - this.cbLeaveOriginals.Size = new System.Drawing.Size(129, 17); - this.cbLeaveOriginals.TabIndex = 4; - this.cbLeaveOriginals.Text = "&Copy files, don\'t move"; - this.cbLeaveOriginals.UseVisualStyleBackColor = true; + // cbWDLiveEpisodeFiles // - // cbCheckSABnzbd + this.cbWDLiveEpisodeFiles.AutoSize = true; + this.cbWDLiveEpisodeFiles.Location = new System.Drawing.Point(38, 399); + this.cbWDLiveEpisodeFiles.Name = "cbWDLiveEpisodeFiles"; + this.cbWDLiveEpisodeFiles.Size = new System.Drawing.Size(200, 17); + this.cbWDLiveEpisodeFiles.TabIndex = 25; + this.cbWDLiveEpisodeFiles.Text = "WD TV Live Hub Episode Files (.xml)"; + this.cbWDLiveEpisodeFiles.UseVisualStyleBackColor = true; // - this.cbCheckSABnzbd.AutoSize = true; - this.cbCheckSABnzbd.Location = new System.Drawing.Point(40, 171); - this.cbCheckSABnzbd.Name = "cbCheckSABnzbd"; - this.cbCheckSABnzbd.Size = new System.Drawing.Size(137, 17); - this.cbCheckSABnzbd.TabIndex = 6; - this.cbCheckSABnzbd.Text = "Check SA&Bnzbd queue"; - this.cbCheckSABnzbd.UseVisualStyleBackColor = true; - this.cbCheckSABnzbd.CheckedChanged += new System.EventHandler(this.cbSearchLocally_CheckedChanged); + // cbNFOEpisodes // - // cbCheckuTorrent + this.cbNFOEpisodes.AutoSize = true; + this.cbNFOEpisodes.Location = new System.Drawing.Point(38, 73); + this.cbNFOEpisodes.Name = "cbNFOEpisodes"; + this.cbNFOEpisodes.Size = new System.Drawing.Size(129, 17); + this.cbNFOEpisodes.TabIndex = 24; + this.cbNFOEpisodes.Text = "&NFO files for episodes"; + this.cbNFOEpisodes.UseVisualStyleBackColor = true; // - this.cbCheckuTorrent.AutoSize = true; - this.cbCheckuTorrent.Location = new System.Drawing.Point(40, 148); - this.cbCheckuTorrent.Name = "cbCheckuTorrent"; - this.cbCheckuTorrent.Size = new System.Drawing.Size(133, 17); - this.cbCheckuTorrent.TabIndex = 5; - this.cbCheckuTorrent.Text = "C&heck µTorrent queue"; - this.cbCheckuTorrent.UseVisualStyleBackColor = true; - this.cbCheckuTorrent.CheckedChanged += new System.EventHandler(this.cbSearchLocally_CheckedChanged); + // panel1 // - // cbSearchLocally + this.panel1.Controls.Add(this.rbFolderBanner); + this.panel1.Controls.Add(this.rbFolderPoster); + this.panel1.Controls.Add(this.rbFolderFanArt); + this.panel1.Controls.Add(this.rbFolderSeasonPoster); + this.panel1.Location = new System.Drawing.Point(59, 323); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(280, 24); + this.panel1.TabIndex = 22; // - this.cbSearchLocally.AutoSize = true; - this.cbSearchLocally.Checked = true; - this.cbSearchLocally.CheckState = System.Windows.Forms.CheckState.Checked; - this.cbSearchLocally.Location = new System.Drawing.Point(40, 102); - this.cbSearchLocally.Name = "cbSearchLocally"; - this.cbSearchLocally.Size = new System.Drawing.Size(218, 17); - this.cbSearchLocally.TabIndex = 3; - this.cbSearchLocally.Text = "&Look in \"Search Folders\" for missing files"; - this.cbSearchLocally.UseVisualStyleBackColor = true; - this.cbSearchLocally.CheckedChanged += new System.EventHandler(this.cbSearchLocally_CheckedChanged); + // rbFolderBanner + // + this.rbFolderBanner.AutoSize = true; + this.rbFolderBanner.Location = new System.Drawing.Point(0, 7); + this.rbFolderBanner.Name = "rbFolderBanner"; + this.rbFolderBanner.Size = new System.Drawing.Size(59, 17); + this.rbFolderBanner.TabIndex = 12; + this.rbFolderBanner.TabStop = true; + this.rbFolderBanner.Text = "&Banner"; + this.rbFolderBanner.UseVisualStyleBackColor = true; + // + // rbFolderPoster + // + this.rbFolderPoster.AutoSize = true; + this.rbFolderPoster.Location = new System.Drawing.Point(60, 7); + this.rbFolderPoster.Name = "rbFolderPoster"; + this.rbFolderPoster.Size = new System.Drawing.Size(55, 17); + this.rbFolderPoster.TabIndex = 13; + this.rbFolderPoster.TabStop = true; + this.rbFolderPoster.Text = "&Poster"; + this.rbFolderPoster.UseVisualStyleBackColor = true; + // + // rbFolderFanArt + // + this.rbFolderFanArt.AutoSize = true; + this.rbFolderFanArt.Location = new System.Drawing.Point(121, 7); + this.rbFolderFanArt.Name = "rbFolderFanArt"; + this.rbFolderFanArt.Size = new System.Drawing.Size(59, 17); + this.rbFolderFanArt.TabIndex = 14; + this.rbFolderFanArt.TabStop = true; + this.rbFolderFanArt.Text = "Fan A&rt"; + this.rbFolderFanArt.UseVisualStyleBackColor = true; + // + // rbFolderSeasonPoster + // + this.rbFolderSeasonPoster.AutoSize = true; + this.rbFolderSeasonPoster.Location = new System.Drawing.Point(186, 7); + this.rbFolderSeasonPoster.Name = "rbFolderSeasonPoster"; + this.rbFolderSeasonPoster.Size = new System.Drawing.Size(94, 17); + this.rbFolderSeasonPoster.TabIndex = 16; + this.rbFolderSeasonPoster.TabStop = true; + this.rbFolderSeasonPoster.Text = "Seaso&n Poster"; + this.rbFolderSeasonPoster.UseVisualStyleBackColor = true; + // + // cbKODIImages + // + this.cbKODIImages.AutoSize = true; + this.cbKODIImages.Location = new System.Drawing.Point(38, 93); + this.cbKODIImages.Name = "cbKODIImages"; + this.cbKODIImages.Size = new System.Drawing.Size(271, 17); + this.cbKODIImages.TabIndex = 17; + this.cbKODIImages.Text = "Download XMBC &Images (fanart, poster, banner.jpg)"; + this.cbKODIImages.UseVisualStyleBackColor = true; + // + // bnMCPresets + // + this.bnMCPresets.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.bnMCPresets.Location = new System.Drawing.Point(448, 399); + this.bnMCPresets.Name = "bnMCPresets"; + this.bnMCPresets.Size = new System.Drawing.Size(75, 23); + this.bnMCPresets.TabIndex = 16; + this.bnMCPresets.Text = "Pre&sets..."; + this.bnMCPresets.UseVisualStyleBackColor = true; + this.bnMCPresets.Click += new System.EventHandler(this.bnMCPresets_Click); + // + // cbShrinkLarge + // + this.cbShrinkLarge.AutoSize = true; + this.cbShrinkLarge.Location = new System.Drawing.Point(38, 260); + this.cbShrinkLarge.Name = "cbShrinkLarge"; + this.cbShrinkLarge.Size = new System.Drawing.Size(300, 17); + this.cbShrinkLarge.TabIndex = 9; + this.cbShrinkLarge.Text = "S&hrink large series and episode images to 156 x 232 pixels"; + this.cbShrinkLarge.UseVisualStyleBackColor = true; + // + // cbEpThumbJpg + // + this.cbEpThumbJpg.AutoSize = true; + this.cbEpThumbJpg.Location = new System.Drawing.Point(38, 376); + this.cbEpThumbJpg.Name = "cbEpThumbJpg"; + this.cbEpThumbJpg.Size = new System.Drawing.Size(147, 17); + this.cbEpThumbJpg.TabIndex = 16; + this.cbEpThumbJpg.Text = "Episode Thumbnails (.&jpg)"; + this.cbEpThumbJpg.UseVisualStyleBackColor = true; + // + // label29 + // + this.label29.AutoSize = true; + this.label29.Location = new System.Drawing.Point(17, 194); + this.label29.Name = "label29"; + this.label29.Size = new System.Drawing.Size(49, 13); + this.label29.TabIndex = 6; + this.label29.Text = "Mede8er"; + // + // label24 + // + this.label24.AutoSize = true; + this.label24.Location = new System.Drawing.Point(17, 289); + this.label24.Name = "label24"; + this.label24.Size = new System.Drawing.Size(44, 13); + this.label24.TabIndex = 10; + this.label24.Text = "General"; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(17, 123); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(39, 13); + this.label18.TabIndex = 3; + this.label18.Text = "pyTivo"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(17, 15); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(33, 13); + this.label12.TabIndex = 0; + this.label12.Text = "KODI"; + // + // cbMetaSubfolder + // + this.cbMetaSubfolder.AutoSize = true; + this.cbMetaSubfolder.Location = new System.Drawing.Point(38, 165); + this.cbMetaSubfolder.Name = "cbMetaSubfolder"; + this.cbMetaSubfolder.Size = new System.Drawing.Size(187, 17); + this.cbMetaSubfolder.TabIndex = 5; + this.cbMetaSubfolder.Text = "Pl&ace Meta files in .meta subfolder"; + this.cbMetaSubfolder.UseVisualStyleBackColor = true; + // + // cbMeta + // + this.cbMeta.AutoSize = true; + this.cbMeta.Location = new System.Drawing.Point(38, 142); + this.cbMeta.Name = "cbMeta"; + this.cbMeta.Size = new System.Drawing.Size(154, 17); + this.cbMeta.TabIndex = 4; + this.cbMeta.Text = "&Meta files for episodes (.txt)"; + this.cbMeta.UseVisualStyleBackColor = true; + this.cbMeta.CheckedChanged += new System.EventHandler(this.cbMeta_CheckedChanged); + // + // cbEpTBNs + // + this.cbEpTBNs.AutoSize = true; + this.cbEpTBNs.Location = new System.Drawing.Point(38, 34); + this.cbEpTBNs.Name = "cbEpTBNs"; + this.cbEpTBNs.Size = new System.Drawing.Size(148, 17); + this.cbEpTBNs.TabIndex = 1; + this.cbEpTBNs.Text = "&Episode Thumbnails (.tbn)"; + this.cbEpTBNs.UseVisualStyleBackColor = true; + // + // cbSeriesJpg + // + this.cbSeriesJpg.AutoSize = true; + this.cbSeriesJpg.Location = new System.Drawing.Point(38, 214); + this.cbSeriesJpg.Name = "cbSeriesJpg"; + this.cbSeriesJpg.Size = new System.Drawing.Size(172, 17); + this.cbSeriesJpg.TabIndex = 7; + this.cbSeriesJpg.Text = "&Create series poster (series.jpg)"; + this.cbSeriesJpg.UseVisualStyleBackColor = true; + // + // cbXMLFiles + // + this.cbXMLFiles.AutoSize = true; + this.cbXMLFiles.Location = new System.Drawing.Point(38, 237); + this.cbXMLFiles.Name = "cbXMLFiles"; + this.cbXMLFiles.Size = new System.Drawing.Size(183, 17); + this.cbXMLFiles.TabIndex = 8; + this.cbXMLFiles.Text = "&XML files for shows and episodes"; + this.cbXMLFiles.UseVisualStyleBackColor = true; + // + // cbNFOShows + // + this.cbNFOShows.AutoSize = true; + this.cbNFOShows.Location = new System.Drawing.Point(38, 55); + this.cbNFOShows.Name = "cbNFOShows"; + this.cbNFOShows.Size = new System.Drawing.Size(117, 17); + this.cbNFOShows.TabIndex = 2; + this.cbNFOShows.Text = "&NFO files for shows"; + this.cbNFOShows.UseVisualStyleBackColor = true; + // + // cbFantArtJpg + // + this.cbFantArtJpg.AutoSize = true; + this.cbFantArtJpg.Location = new System.Drawing.Point(38, 353); + this.cbFantArtJpg.Name = "cbFantArtJpg"; + this.cbFantArtJpg.Size = new System.Drawing.Size(141, 17); + this.cbFantArtJpg.TabIndex = 15; + this.cbFantArtJpg.Text = "Fanar&t Image (fanart.jpg)"; + this.cbFantArtJpg.UseVisualStyleBackColor = true; + // + // cbFolderJpg + // + this.cbFolderJpg.AutoSize = true; + this.cbFolderJpg.Location = new System.Drawing.Point(38, 310); + this.cbFolderJpg.Name = "cbFolderJpg"; + this.cbFolderJpg.Size = new System.Drawing.Size(138, 17); + this.cbFolderJpg.TabIndex = 11; + this.cbFolderJpg.Text = "&Folder image (folder.jpg)"; + this.cbFolderJpg.UseVisualStyleBackColor = true; // // tbFolderDeleting // @@ -1572,7 +1728,7 @@ private void InitializeComponent() this.tbFolderDeleting.Location = new System.Drawing.Point(4, 40); this.tbFolderDeleting.Name = "tbFolderDeleting"; this.tbFolderDeleting.Padding = new System.Windows.Forms.Padding(3); - this.tbFolderDeleting.Size = new System.Drawing.Size(509, 492); + this.tbFolderDeleting.Size = new System.Drawing.Size(529, 426); this.tbFolderDeleting.TabIndex = 9; this.tbFolderDeleting.Text = "Folder Deleting"; this.tbFolderDeleting.UseVisualStyleBackColor = true; @@ -1610,26 +1766,6 @@ private void InitializeComponent() this.txtEmptyMaxSize.Size = new System.Drawing.Size(55, 20); this.txtEmptyMaxSize.TabIndex = 8; // - // txtEmptyIgnoreWords - // - this.txtEmptyIgnoreWords.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtEmptyIgnoreWords.Location = new System.Drawing.Point(95, 89); - this.txtEmptyIgnoreWords.Name = "txtEmptyIgnoreWords"; - this.txtEmptyIgnoreWords.Size = new System.Drawing.Size(408, 20); - this.txtEmptyIgnoreWords.TabIndex = 3; - this.toolTip1.SetToolTip(this.txtEmptyIgnoreWords, "For example \"sample\""); - // - // txtEmptyIgnoreExtensions - // - this.txtEmptyIgnoreExtensions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtEmptyIgnoreExtensions.Location = new System.Drawing.Point(95, 139); - this.txtEmptyIgnoreExtensions.Name = "txtEmptyIgnoreExtensions"; - this.txtEmptyIgnoreExtensions.Size = new System.Drawing.Size(408, 20); - this.txtEmptyIgnoreExtensions.TabIndex = 5; - this.toolTip1.SetToolTip(this.txtEmptyIgnoreExtensions, "For example \".par2;.nzb;.nfo\""); - // // label31 // this.label31.AutoSize = true; @@ -1688,1064 +1824,1144 @@ private void InitializeComponent() this.cbDeleteEmpty.Text = "&Delete empty folders after moving files"; this.cbDeleteEmpty.UseVisualStyleBackColor = true; // - // tbMediaCenter + // tpScanOptions // - this.tbMediaCenter.Controls.Add(this.cbWDLiveEpisodeFiles); - this.tbMediaCenter.Controls.Add(this.cbNFOEpisodes); - this.tbMediaCenter.Controls.Add(this.panel1); - this.tbMediaCenter.Controls.Add(this.cbKODIImages); - this.tbMediaCenter.Controls.Add(this.bnMCPresets); - this.tbMediaCenter.Controls.Add(this.cbShrinkLarge); - this.tbMediaCenter.Controls.Add(this.cbEpThumbJpg); - this.tbMediaCenter.Controls.Add(this.label29); - this.tbMediaCenter.Controls.Add(this.label24); - this.tbMediaCenter.Controls.Add(this.label18); - this.tbMediaCenter.Controls.Add(this.label12); - this.tbMediaCenter.Controls.Add(this.cbMetaSubfolder); - this.tbMediaCenter.Controls.Add(this.cbMeta); - this.tbMediaCenter.Controls.Add(this.cbEpTBNs); - this.tbMediaCenter.Controls.Add(this.cbSeriesJpg); - this.tbMediaCenter.Controls.Add(this.cbXMLFiles); - this.tbMediaCenter.Controls.Add(this.cbNFOShows); - this.tbMediaCenter.Controls.Add(this.cbFantArtJpg); - this.tbMediaCenter.Controls.Add(this.cbFolderJpg); - this.tbMediaCenter.Location = new System.Drawing.Point(4, 40); - this.tbMediaCenter.Name = "tbMediaCenter"; - this.tbMediaCenter.Padding = new System.Windows.Forms.Padding(3); - this.tbMediaCenter.Size = new System.Drawing.Size(509, 489); - this.tbMediaCenter.TabIndex = 8; - this.tbMediaCenter.Text = "Media Centres"; - this.tbMediaCenter.UseVisualStyleBackColor = true; + this.tpScanOptions.Controls.Add(this.cbHigherQuality); + this.tpScanOptions.Controls.Add(this.cbSearchJSON); + this.tpScanOptions.Controls.Add(this.cbCheckqBitTorrent); + this.tpScanOptions.Controls.Add(this.chkAutoMergeLibraryEpisodes); + this.tpScanOptions.Controls.Add(this.chkAutoMergeDownloadEpisodes); + this.tpScanOptions.Controls.Add(this.chkPreventMove); + this.tpScanOptions.Controls.Add(this.label40); + this.tpScanOptions.Controls.Add(this.cbxUpdateAirDate); + this.tpScanOptions.Controls.Add(this.label33); + this.tpScanOptions.Controls.Add(this.cbAutoCreateFolders); + this.tpScanOptions.Controls.Add(this.label28); + this.tpScanOptions.Controls.Add(this.cbSearchRSS); + this.tpScanOptions.Controls.Add(this.cbRenameCheck); + this.tpScanOptions.Controls.Add(this.cbMissing); + this.tpScanOptions.Controls.Add(this.cbLeaveOriginals); + this.tpScanOptions.Controls.Add(this.cbCheckSABnzbd); + this.tpScanOptions.Controls.Add(this.cbCheckuTorrent); + this.tpScanOptions.Controls.Add(this.cbSearchLocally); + this.tpScanOptions.Location = new System.Drawing.Point(4, 40); + this.tpScanOptions.Name = "tpScanOptions"; + this.tpScanOptions.Padding = new System.Windows.Forms.Padding(3); + this.tpScanOptions.Size = new System.Drawing.Size(529, 426); + this.tpScanOptions.TabIndex = 6; + this.tpScanOptions.Text = "Scan Options"; + this.tpScanOptions.UseVisualStyleBackColor = true; // - // cbWDLiveEpisodeFiles + // cbHigherQuality // - this.cbWDLiveEpisodeFiles.AutoSize = true; - this.cbWDLiveEpisodeFiles.Location = new System.Drawing.Point(38, 399); - this.cbWDLiveEpisodeFiles.Name = "cbWDLiveEpisodeFiles"; - this.cbWDLiveEpisodeFiles.Size = new System.Drawing.Size(200, 17); - this.cbWDLiveEpisodeFiles.TabIndex = 25; - this.cbWDLiveEpisodeFiles.Text = "WD TV Live Hub Episode Files (.xml)"; - this.cbWDLiveEpisodeFiles.UseVisualStyleBackColor = true; + this.cbHigherQuality.AutoSize = true; + this.cbHigherQuality.Location = new System.Drawing.Point(9, 394); + this.cbHigherQuality.Name = "cbHigherQuality"; + this.cbHigherQuality.Size = new System.Drawing.Size(256, 17); + this.cbHigherQuality.TabIndex = 18; + this.cbHigherQuality.Text = "Update episodes when higher-quality ones found"; + this.cbHigherQuality.UseVisualStyleBackColor = true; // - // cbNFOEpisodes + // cbSearchJSON // - this.cbNFOEpisodes.AutoSize = true; - this.cbNFOEpisodes.Location = new System.Drawing.Point(38, 73); - this.cbNFOEpisodes.Name = "cbNFOEpisodes"; - this.cbNFOEpisodes.Size = new System.Drawing.Size(129, 17); - this.cbNFOEpisodes.TabIndex = 24; - this.cbNFOEpisodes.Text = "&NFO files for episodes"; - this.cbNFOEpisodes.UseVisualStyleBackColor = true; + this.cbSearchJSON.AutoSize = true; + this.cbSearchJSON.Location = new System.Drawing.Point(40, 234); + this.cbSearchJSON.Name = "cbSearchJSON"; + this.cbSearchJSON.Size = new System.Drawing.Size(164, 17); + this.cbSearchJSON.TabIndex = 17; + this.cbSearchJSON.Text = "Search &JSON for missing files"; + this.cbSearchJSON.UseVisualStyleBackColor = true; + this.cbSearchJSON.CheckedChanged += new System.EventHandler(this.cbSearchJSON_CheckedChanged); // - // panel1 + // cbCheckqBitTorrent // - this.panel1.Controls.Add(this.rbFolderBanner); - this.panel1.Controls.Add(this.rbFolderPoster); - this.panel1.Controls.Add(this.rbFolderFanArt); - this.panel1.Controls.Add(this.rbFolderSeasonPoster); - this.panel1.Location = new System.Drawing.Point(59, 323); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(280, 24); - this.panel1.TabIndex = 22; + this.cbCheckqBitTorrent.AutoSize = true; + this.cbCheckqBitTorrent.Location = new System.Drawing.Point(40, 190); + this.cbCheckqBitTorrent.Name = "cbCheckqBitTorrent"; + this.cbCheckqBitTorrent.Size = new System.Drawing.Size(145, 17); + this.cbCheckqBitTorrent.TabIndex = 16; + this.cbCheckqBitTorrent.Text = "Check &qBitTorrent queue"; + this.cbCheckqBitTorrent.UseVisualStyleBackColor = true; // - // rbFolderBanner + // chkAutoMergeLibraryEpisodes // - this.rbFolderBanner.AutoSize = true; - this.rbFolderBanner.Location = new System.Drawing.Point(0, 7); - this.rbFolderBanner.Name = "rbFolderBanner"; - this.rbFolderBanner.Size = new System.Drawing.Size(59, 17); - this.rbFolderBanner.TabIndex = 12; - this.rbFolderBanner.TabStop = true; - this.rbFolderBanner.Text = "&Banner"; - this.rbFolderBanner.UseVisualStyleBackColor = true; + this.chkAutoMergeLibraryEpisodes.AutoSize = true; + this.chkAutoMergeLibraryEpisodes.Location = new System.Drawing.Point(9, 371); + this.chkAutoMergeLibraryEpisodes.Name = "chkAutoMergeLibraryEpisodes"; + this.chkAutoMergeLibraryEpisodes.Size = new System.Drawing.Size(306, 17); + this.chkAutoMergeLibraryEpisodes.TabIndex = 15; + this.chkAutoMergeLibraryEpisodes.Text = "Automatically create merge rules for merged library episodes"; + this.chkAutoMergeLibraryEpisodes.UseVisualStyleBackColor = true; // - // rbFolderPoster + // chkAutoMergeDownloadEpisodes // - this.rbFolderPoster.AutoSize = true; - this.rbFolderPoster.Location = new System.Drawing.Point(60, 7); - this.rbFolderPoster.Name = "rbFolderPoster"; - this.rbFolderPoster.Size = new System.Drawing.Size(55, 17); - this.rbFolderPoster.TabIndex = 13; - this.rbFolderPoster.TabStop = true; - this.rbFolderPoster.Text = "&Poster"; - this.rbFolderPoster.UseVisualStyleBackColor = true; + this.chkAutoMergeDownloadEpisodes.AutoSize = true; + this.chkAutoMergeDownloadEpisodes.Location = new System.Drawing.Point(9, 349); + this.chkAutoMergeDownloadEpisodes.Name = "chkAutoMergeDownloadEpisodes"; + this.chkAutoMergeDownloadEpisodes.Size = new System.Drawing.Size(337, 17); + this.chkAutoMergeDownloadEpisodes.TabIndex = 13; + this.chkAutoMergeDownloadEpisodes.Text = "Automatically create merge rules for merged downloaded episodes"; + this.chkAutoMergeDownloadEpisodes.UseVisualStyleBackColor = true; // - // rbFolderFanArt + // chkPreventMove // - this.rbFolderFanArt.AutoSize = true; - this.rbFolderFanArt.Location = new System.Drawing.Point(121, 7); - this.rbFolderFanArt.Name = "rbFolderFanArt"; - this.rbFolderFanArt.Size = new System.Drawing.Size(59, 17); - this.rbFolderFanArt.TabIndex = 14; - this.rbFolderFanArt.TabStop = true; - this.rbFolderFanArt.Text = "Fan A&rt"; - this.rbFolderFanArt.UseVisualStyleBackColor = true; + this.chkPreventMove.AutoSize = true; + this.chkPreventMove.Location = new System.Drawing.Point(40, 56); + this.chkPreventMove.Name = "chkPreventMove"; + this.chkPreventMove.Size = new System.Drawing.Size(188, 17); + this.chkPreventMove.TabIndex = 12; + this.chkPreventMove.Text = "Pre&vent move of files (just rename)"; + this.chkPreventMove.UseVisualStyleBackColor = true; // - // rbFolderSeasonPoster + // label40 // - this.rbFolderSeasonPoster.AutoSize = true; - this.rbFolderSeasonPoster.Location = new System.Drawing.Point(186, 7); - this.rbFolderSeasonPoster.Name = "rbFolderSeasonPoster"; - this.rbFolderSeasonPoster.Size = new System.Drawing.Size(94, 17); - this.rbFolderSeasonPoster.TabIndex = 16; - this.rbFolderSeasonPoster.TabStop = true; - this.rbFolderSeasonPoster.Text = "Seaso&n Poster"; - this.rbFolderSeasonPoster.UseVisualStyleBackColor = true; + this.label40.AutoSize = true; + this.label40.Location = new System.Drawing.Point(6, 310); + this.label40.Name = "label40"; + this.label40.Size = new System.Drawing.Size(94, 13); + this.label40.TabIndex = 11; + this.label40.Text = "Additional Actions:"; // - // cbKODIImages + // cbxUpdateAirDate // - this.cbKODIImages.AutoSize = true; - this.cbKODIImages.Location = new System.Drawing.Point(38, 93); - this.cbKODIImages.Name = "cbKODIImages"; - this.cbKODIImages.Size = new System.Drawing.Size(271, 17); - this.cbKODIImages.TabIndex = 17; - this.cbKODIImages.Text = "Download XMBC &Images (fanart, poster, banner.jpg)"; - this.cbKODIImages.UseVisualStyleBackColor = true; + this.cbxUpdateAirDate.AutoSize = true; + this.cbxUpdateAirDate.Location = new System.Drawing.Point(9, 326); + this.cbxUpdateAirDate.Name = "cbxUpdateAirDate"; + this.cbxUpdateAirDate.Size = new System.Drawing.Size(197, 17); + this.cbxUpdateAirDate.TabIndex = 10; + this.cbxUpdateAirDate.Text = "Update files and folders with air date"; + this.cbxUpdateAirDate.UseVisualStyleBackColor = true; // - // bnMCPresets + // label33 // - this.bnMCPresets.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.bnMCPresets.Location = new System.Drawing.Point(428, 399); - this.bnMCPresets.Name = "bnMCPresets"; - this.bnMCPresets.Size = new System.Drawing.Size(75, 23); - this.bnMCPresets.TabIndex = 16; - this.bnMCPresets.Text = "Pre&sets..."; - this.bnMCPresets.UseVisualStyleBackColor = true; - this.bnMCPresets.Click += new System.EventHandler(this.bnMCPresets_Click); + this.label33.AutoSize = true; + this.label33.Location = new System.Drawing.Point(6, 263); + this.label33.Name = "label33"; + this.label33.Size = new System.Drawing.Size(80, 13); + this.label33.TabIndex = 9; + this.label33.Text = "Folder creation:"; // - // cbShrinkLarge + // cbAutoCreateFolders // - this.cbShrinkLarge.AutoSize = true; - this.cbShrinkLarge.Location = new System.Drawing.Point(38, 260); - this.cbShrinkLarge.Name = "cbShrinkLarge"; - this.cbShrinkLarge.Size = new System.Drawing.Size(300, 17); - this.cbShrinkLarge.TabIndex = 9; - this.cbShrinkLarge.Text = "S&hrink large series and episode images to 156 x 232 pixels"; - this.cbShrinkLarge.UseVisualStyleBackColor = true; + this.cbAutoCreateFolders.AutoSize = true; + this.cbAutoCreateFolders.Location = new System.Drawing.Point(9, 279); + this.cbAutoCreateFolders.Name = "cbAutoCreateFolders"; + this.cbAutoCreateFolders.Size = new System.Drawing.Size(192, 17); + this.cbAutoCreateFolders.TabIndex = 8; + this.cbAutoCreateFolders.Text = "&Automatically create missing folders"; + this.cbAutoCreateFolders.UseVisualStyleBackColor = true; // - // cbEpThumbJpg + // label28 // - this.cbEpThumbJpg.AutoSize = true; - this.cbEpThumbJpg.Location = new System.Drawing.Point(38, 376); - this.cbEpThumbJpg.Name = "cbEpThumbJpg"; - this.cbEpThumbJpg.Size = new System.Drawing.Size(147, 17); - this.cbEpThumbJpg.TabIndex = 16; - this.cbEpThumbJpg.Text = "Episode Thumbnails (.&jpg)"; - this.cbEpThumbJpg.UseVisualStyleBackColor = true; + this.label28.AutoSize = true; + this.label28.Location = new System.Drawing.Point(6, 13); + this.label28.Name = "label28"; + this.label28.Size = new System.Drawing.Size(141, 13); + this.label28.TabIndex = 0; + this.label28.Text = "\"Scan\" checks and actions:"; // - // label29 + // cbSearchRSS // - this.label29.AutoSize = true; - this.label29.Location = new System.Drawing.Point(17, 194); - this.label29.Name = "label29"; - this.label29.Size = new System.Drawing.Size(49, 13); - this.label29.TabIndex = 6; - this.label29.Text = "Mede8er"; + this.cbSearchRSS.AutoSize = true; + this.cbSearchRSS.Location = new System.Drawing.Point(40, 211); + this.cbSearchRSS.Name = "cbSearchRSS"; + this.cbSearchRSS.Size = new System.Drawing.Size(158, 17); + this.cbSearchRSS.TabIndex = 7; + this.cbSearchRSS.Text = "&Search RSS for missing files"; + this.cbSearchRSS.UseVisualStyleBackColor = true; + this.cbSearchRSS.CheckedChanged += new System.EventHandler(this.cbSearchRSS_CheckedChanged); // - // label24 + // cbRenameCheck // - this.label24.AutoSize = true; - this.label24.Location = new System.Drawing.Point(17, 289); - this.label24.Name = "label24"; - this.label24.Size = new System.Drawing.Size(44, 13); - this.label24.TabIndex = 10; - this.label24.Text = "General"; + this.cbRenameCheck.AutoSize = true; + this.cbRenameCheck.Checked = true; + this.cbRenameCheck.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbRenameCheck.Location = new System.Drawing.Point(20, 33); + this.cbRenameCheck.Name = "cbRenameCheck"; + this.cbRenameCheck.Size = new System.Drawing.Size(100, 17); + this.cbRenameCheck.TabIndex = 1; + this.cbRenameCheck.Text = "&Rename Check"; + this.cbRenameCheck.UseVisualStyleBackColor = true; // - // label18 + // cbMissing // - this.label18.AutoSize = true; - this.label18.Location = new System.Drawing.Point(17, 123); - this.label18.Name = "label18"; - this.label18.Size = new System.Drawing.Size(39, 13); - this.label18.TabIndex = 3; - this.label18.Text = "pyTivo"; + this.cbMissing.AutoSize = true; + this.cbMissing.Checked = true; + this.cbMissing.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbMissing.Location = new System.Drawing.Point(20, 79); + this.cbMissing.Name = "cbMissing"; + this.cbMissing.Size = new System.Drawing.Size(95, 17); + this.cbMissing.TabIndex = 2; + this.cbMissing.Text = "&Missing Check"; + this.cbMissing.UseVisualStyleBackColor = true; + this.cbMissing.CheckedChanged += new System.EventHandler(this.cbMissing_CheckedChanged); // - // label12 + // cbLeaveOriginals // - this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(17, 15); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(33, 13); - this.label12.TabIndex = 0; - this.label12.Text = "KODI"; + this.cbLeaveOriginals.AutoSize = true; + this.cbLeaveOriginals.Location = new System.Drawing.Point(60, 125); + this.cbLeaveOriginals.Name = "cbLeaveOriginals"; + this.cbLeaveOriginals.Size = new System.Drawing.Size(129, 17); + this.cbLeaveOriginals.TabIndex = 4; + this.cbLeaveOriginals.Text = "&Copy files, don\'t move"; + this.cbLeaveOriginals.UseVisualStyleBackColor = true; // - // cbMetaSubfolder + // cbCheckSABnzbd // - this.cbMetaSubfolder.AutoSize = true; - this.cbMetaSubfolder.Location = new System.Drawing.Point(38, 165); - this.cbMetaSubfolder.Name = "cbMetaSubfolder"; - this.cbMetaSubfolder.Size = new System.Drawing.Size(187, 17); - this.cbMetaSubfolder.TabIndex = 5; - this.cbMetaSubfolder.Text = "Pl&ace Meta files in .meta subfolder"; - this.cbMetaSubfolder.UseVisualStyleBackColor = true; + this.cbCheckSABnzbd.AutoSize = true; + this.cbCheckSABnzbd.Location = new System.Drawing.Point(40, 171); + this.cbCheckSABnzbd.Name = "cbCheckSABnzbd"; + this.cbCheckSABnzbd.Size = new System.Drawing.Size(137, 17); + this.cbCheckSABnzbd.TabIndex = 6; + this.cbCheckSABnzbd.Text = "Check SA&Bnzbd queue"; + this.cbCheckSABnzbd.UseVisualStyleBackColor = true; + this.cbCheckSABnzbd.CheckedChanged += new System.EventHandler(this.cbSearchLocally_CheckedChanged); // - // cbMeta + // cbCheckuTorrent // - this.cbMeta.AutoSize = true; - this.cbMeta.Location = new System.Drawing.Point(38, 142); - this.cbMeta.Name = "cbMeta"; - this.cbMeta.Size = new System.Drawing.Size(154, 17); - this.cbMeta.TabIndex = 4; - this.cbMeta.Text = "&Meta files for episodes (.txt)"; - this.cbMeta.UseVisualStyleBackColor = true; - this.cbMeta.CheckedChanged += new System.EventHandler(this.cbMeta_CheckedChanged); + this.cbCheckuTorrent.AutoSize = true; + this.cbCheckuTorrent.Location = new System.Drawing.Point(40, 148); + this.cbCheckuTorrent.Name = "cbCheckuTorrent"; + this.cbCheckuTorrent.Size = new System.Drawing.Size(133, 17); + this.cbCheckuTorrent.TabIndex = 5; + this.cbCheckuTorrent.Text = "C&heck µTorrent queue"; + this.cbCheckuTorrent.UseVisualStyleBackColor = true; + this.cbCheckuTorrent.CheckedChanged += new System.EventHandler(this.cbSearchLocally_CheckedChanged); // - // cbEpTBNs + // cbSearchLocally // - this.cbEpTBNs.AutoSize = true; - this.cbEpTBNs.Location = new System.Drawing.Point(38, 34); - this.cbEpTBNs.Name = "cbEpTBNs"; - this.cbEpTBNs.Size = new System.Drawing.Size(148, 17); - this.cbEpTBNs.TabIndex = 1; - this.cbEpTBNs.Text = "&Episode Thumbnails (.tbn)"; - this.cbEpTBNs.UseVisualStyleBackColor = true; + this.cbSearchLocally.AutoSize = true; + this.cbSearchLocally.Checked = true; + this.cbSearchLocally.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbSearchLocally.Location = new System.Drawing.Point(40, 102); + this.cbSearchLocally.Name = "cbSearchLocally"; + this.cbSearchLocally.Size = new System.Drawing.Size(218, 17); + this.cbSearchLocally.TabIndex = 3; + this.cbSearchLocally.Text = "&Look in \"Search Folders\" for missing files"; + this.cbSearchLocally.UseVisualStyleBackColor = true; + this.cbSearchLocally.CheckedChanged += new System.EventHandler(this.cbSearchLocally_CheckedChanged); // - // cbSeriesJpg + // tbAutoExport // - this.cbSeriesJpg.AutoSize = true; - this.cbSeriesJpg.Location = new System.Drawing.Point(38, 214); - this.cbSeriesJpg.Name = "cbSeriesJpg"; - this.cbSeriesJpg.Size = new System.Drawing.Size(172, 17); - this.cbSeriesJpg.TabIndex = 7; - this.cbSeriesJpg.Text = "&Create series poster (series.jpg)"; - this.cbSeriesJpg.UseVisualStyleBackColor = true; + this.tbAutoExport.Controls.Add(this.groupBox7); + this.tbAutoExport.Controls.Add(this.groupBox5); + this.tbAutoExport.Controls.Add(this.groupBox4); + this.tbAutoExport.Controls.Add(this.groupBox3); + this.tbAutoExport.Controls.Add(this.groupBox2); + this.tbAutoExport.Location = new System.Drawing.Point(4, 40); + this.tbAutoExport.Name = "tbAutoExport"; + this.tbAutoExport.Padding = new System.Windows.Forms.Padding(3); + this.tbAutoExport.Size = new System.Drawing.Size(529, 426); + this.tbAutoExport.TabIndex = 2; + this.tbAutoExport.Text = "Automatic Export"; + this.tbAutoExport.UseVisualStyleBackColor = true; // - // cbXMLFiles + // groupBox7 // - this.cbXMLFiles.AutoSize = true; - this.cbXMLFiles.Location = new System.Drawing.Point(38, 237); - this.cbXMLFiles.Name = "cbXMLFiles"; - this.cbXMLFiles.Size = new System.Drawing.Size(183, 17); - this.cbXMLFiles.TabIndex = 8; - this.cbXMLFiles.Text = "&XML files for shows and episodes"; - this.cbXMLFiles.UseVisualStyleBackColor = true; + this.groupBox7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox7.Controls.Add(this.bnBrowseShowsHTML); + this.groupBox7.Controls.Add(this.cbShowsHTML); + this.groupBox7.Controls.Add(this.txtShowsHTMLTo); + this.groupBox7.Controls.Add(this.bnBrowseShowsTXT); + this.groupBox7.Controls.Add(this.cbShowsTXT); + this.groupBox7.Controls.Add(this.txtShowsTXTTo); + this.groupBox7.Location = new System.Drawing.Point(7, 227); + this.groupBox7.Name = "groupBox7"; + this.groupBox7.Size = new System.Drawing.Size(516, 72); + this.groupBox7.TabIndex = 4; + this.groupBox7.TabStop = false; + this.groupBox7.Text = "All Shows"; // - // cbNFOShows + // bnBrowseShowsHTML // - this.cbNFOShows.AutoSize = true; - this.cbNFOShows.Location = new System.Drawing.Point(38, 55); - this.cbNFOShows.Name = "cbNFOShows"; - this.cbNFOShows.Size = new System.Drawing.Size(117, 17); - this.cbNFOShows.TabIndex = 2; - this.cbNFOShows.Text = "&NFO files for shows"; - this.cbNFOShows.UseVisualStyleBackColor = true; + this.bnBrowseShowsHTML.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.bnBrowseShowsHTML.Location = new System.Drawing.Point(433, 45); + this.bnBrowseShowsHTML.Name = "bnBrowseShowsHTML"; + this.bnBrowseShowsHTML.Size = new System.Drawing.Size(75, 23); + this.bnBrowseShowsHTML.TabIndex = 8; + this.bnBrowseShowsHTML.Text = "Browse..."; + this.bnBrowseShowsHTML.UseVisualStyleBackColor = true; + this.bnBrowseShowsHTML.Click += new System.EventHandler(this.bnBrowseShowsHTML_Click); // - // cbFantArtJpg + // cbShowsHTML // - this.cbFantArtJpg.AutoSize = true; - this.cbFantArtJpg.Location = new System.Drawing.Point(38, 353); - this.cbFantArtJpg.Name = "cbFantArtJpg"; - this.cbFantArtJpg.Size = new System.Drawing.Size(141, 17); - this.cbFantArtJpg.TabIndex = 15; - this.cbFantArtJpg.Text = "Fanar&t Image (fanart.jpg)"; - this.cbFantArtJpg.UseVisualStyleBackColor = true; + this.cbShowsHTML.AutoSize = true; + this.cbShowsHTML.Location = new System.Drawing.Point(8, 49); + this.cbShowsHTML.Name = "cbShowsHTML"; + this.cbShowsHTML.Size = new System.Drawing.Size(56, 17); + this.cbShowsHTML.TabIndex = 6; + this.cbShowsHTML.Text = "HTML"; + this.cbShowsHTML.UseVisualStyleBackColor = true; + this.cbShowsHTML.CheckedChanged += new System.EventHandler(this.EnableDisable); // - // cbFolderJpg + // txtShowsHTMLTo // - this.cbFolderJpg.AutoSize = true; - this.cbFolderJpg.Location = new System.Drawing.Point(38, 310); - this.cbFolderJpg.Name = "cbFolderJpg"; - this.cbFolderJpg.Size = new System.Drawing.Size(138, 17); - this.cbFolderJpg.TabIndex = 11; - this.cbFolderJpg.Text = "&Folder image (folder.jpg)"; - this.cbFolderJpg.UseVisualStyleBackColor = true; + this.txtShowsHTMLTo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtShowsHTMLTo.Location = new System.Drawing.Point(64, 47); + this.txtShowsHTMLTo.Name = "txtShowsHTMLTo"; + this.txtShowsHTMLTo.Size = new System.Drawing.Size(363, 20); + this.txtShowsHTMLTo.TabIndex = 7; // - // tbSearchFolders + // bnBrowseShowsTXT // - this.tbSearchFolders.Controls.Add(this.label1); - this.tbSearchFolders.Controls.Add(this.domainUpDown1); - this.tbSearchFolders.Controls.Add(this.chkScheduledScan); - this.tbSearchFolders.Controls.Add(this.chkScanOnStartup); - this.tbSearchFolders.Controls.Add(this.lblScanAction); - this.tbSearchFolders.Controls.Add(this.rdoQuickScan); - this.tbSearchFolders.Controls.Add(this.rdoRecentScan); - this.tbSearchFolders.Controls.Add(this.rdoFullScan); - this.tbSearchFolders.Controls.Add(this.cbMonitorFolder); - this.tbSearchFolders.Controls.Add(this.bnOpenSearchFolder); - this.tbSearchFolders.Controls.Add(this.bnRemoveSearchFolder); - this.tbSearchFolders.Controls.Add(this.bnAddSearchFolder); - this.tbSearchFolders.Controls.Add(this.lbSearchFolders); - this.tbSearchFolders.Controls.Add(this.label23); - this.tbSearchFolders.Location = new System.Drawing.Point(4, 40); - this.tbSearchFolders.Name = "tbSearchFolders"; - this.tbSearchFolders.Size = new System.Drawing.Size(509, 489); - this.tbSearchFolders.TabIndex = 3; - this.tbSearchFolders.Text = "Search Folders"; - this.tbSearchFolders.UseVisualStyleBackColor = true; + this.bnBrowseShowsTXT.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.bnBrowseShowsTXT.Location = new System.Drawing.Point(433, 21); + this.bnBrowseShowsTXT.Name = "bnBrowseShowsTXT"; + this.bnBrowseShowsTXT.Size = new System.Drawing.Size(75, 23); + this.bnBrowseShowsTXT.TabIndex = 5; + this.bnBrowseShowsTXT.Text = "Browse..."; + this.bnBrowseShowsTXT.UseVisualStyleBackColor = true; + this.bnBrowseShowsTXT.Click += new System.EventHandler(this.bnBrowseShowsTXT_Click); // - // label1 + // cbShowsTXT // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(178, 89); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(33, 13); - this.label1.TabIndex = 26; - this.label1.Text = "hours"; + this.cbShowsTXT.AutoSize = true; + this.cbShowsTXT.Location = new System.Drawing.Point(8, 25); + this.cbShowsTXT.Name = "cbShowsTXT"; + this.cbShowsTXT.Size = new System.Drawing.Size(47, 17); + this.cbShowsTXT.TabIndex = 3; + this.cbShowsTXT.Text = "TXT"; + this.cbShowsTXT.UseVisualStyleBackColor = true; + this.cbShowsTXT.CheckedChanged += new System.EventHandler(this.EnableDisable); // - // domainUpDown1 + // txtShowsTXTTo // - this.domainUpDown1.Items.Add("1"); - this.domainUpDown1.Items.Add("2"); - this.domainUpDown1.Items.Add("3"); - this.domainUpDown1.Items.Add("4"); - this.domainUpDown1.Items.Add("5"); - this.domainUpDown1.Items.Add("6"); - this.domainUpDown1.Items.Add("8"); - this.domainUpDown1.Items.Add("12"); - this.domainUpDown1.Items.Add("24"); - this.domainUpDown1.Items.Add("48"); - this.domainUpDown1.Items.Add("96"); - this.domainUpDown1.Location = new System.Drawing.Point(134, 87); - this.domainUpDown1.Name = "domainUpDown1"; - this.domainUpDown1.Size = new System.Drawing.Size(40, 20); - this.domainUpDown1.TabIndex = 25; - this.domainUpDown1.Text = "1"; - this.domainUpDown1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.domainUpDown1_KeyDown); + this.txtShowsTXTTo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtShowsTXTTo.Location = new System.Drawing.Point(64, 23); + this.txtShowsTXTTo.Name = "txtShowsTXTTo"; + this.txtShowsTXTTo.Size = new System.Drawing.Size(362, 20); + this.txtShowsTXTTo.TabIndex = 4; + // + // groupBox5 + // + this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox5.Controls.Add(this.bnBrowseFOXML); + this.groupBox5.Controls.Add(this.cbFOXML); + this.groupBox5.Controls.Add(this.txtFOXML); + this.groupBox5.Location = new System.Drawing.Point(6, 367); + this.groupBox5.Name = "groupBox5"; + this.groupBox5.Size = new System.Drawing.Size(517, 55); + this.groupBox5.TabIndex = 3; + this.groupBox5.TabStop = false; + this.groupBox5.Text = "Finding and Organising"; // - // chkScheduledScan + // bnBrowseFOXML // - this.chkScheduledScan.AutoSize = true; - this.chkScheduledScan.Location = new System.Drawing.Point(3, 88); - this.chkScheduledScan.Name = "chkScheduledScan"; - this.chkScheduledScan.Size = new System.Drawing.Size(135, 17); - this.chkScheduledScan.TabIndex = 24; - this.chkScheduledScan.Text = "Sc&heduled scan every "; - this.toolTip1.SetToolTip(this.chkScheduledScan, "If checked the system will automatically scan and complete actions on startup"); - this.chkScheduledScan.UseVisualStyleBackColor = true; + this.bnBrowseFOXML.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.bnBrowseFOXML.Location = new System.Drawing.Point(433, 19); + this.bnBrowseFOXML.Name = "bnBrowseFOXML"; + this.bnBrowseFOXML.Size = new System.Drawing.Size(75, 23); + this.bnBrowseFOXML.TabIndex = 2; + this.bnBrowseFOXML.Text = "Browse..."; + this.bnBrowseFOXML.UseVisualStyleBackColor = true; + this.bnBrowseFOXML.Click += new System.EventHandler(this.bnBrowseFOXML_Click); // - // chkScanOnStartup + // cbFOXML // - this.chkScanOnStartup.AutoSize = true; - this.chkScanOnStartup.Location = new System.Drawing.Point(3, 65); - this.chkScanOnStartup.Name = "chkScanOnStartup"; - this.chkScanOnStartup.Size = new System.Drawing.Size(103, 17); - this.chkScanOnStartup.TabIndex = 23; - this.chkScanOnStartup.Text = "&Scan on Startup"; - this.toolTip1.SetToolTip(this.chkScanOnStartup, "If checked the system will automatically scan and complete actions on startup"); - this.chkScanOnStartup.UseVisualStyleBackColor = true; + this.cbFOXML.AutoSize = true; + this.cbFOXML.Location = new System.Drawing.Point(8, 23); + this.cbFOXML.Name = "cbFOXML"; + this.cbFOXML.Size = new System.Drawing.Size(48, 17); + this.cbFOXML.TabIndex = 0; + this.cbFOXML.Text = "XML"; + this.cbFOXML.UseVisualStyleBackColor = true; + this.cbFOXML.CheckedChanged += new System.EventHandler(this.EnableDisable); // - // lblScanAction + // txtFOXML // - this.lblScanAction.AutoSize = true; - this.lblScanAction.Location = new System.Drawing.Point(2, 12); - this.lblScanAction.Name = "lblScanAction"; - this.lblScanAction.Size = new System.Drawing.Size(59, 13); - this.lblScanAction.TabIndex = 22; - this.lblScanAction.Text = "&Scan Type"; + this.txtFOXML.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtFOXML.Location = new System.Drawing.Point(64, 21); + this.txtFOXML.Name = "txtFOXML"; + this.txtFOXML.Size = new System.Drawing.Size(363, 20); + this.txtFOXML.TabIndex = 1; // - // rdoQuickScan + // groupBox4 // - this.rdoQuickScan.AutoSize = true; - this.rdoQuickScan.Location = new System.Drawing.Point(134, 28); - this.rdoQuickScan.Name = "rdoQuickScan"; - this.rdoQuickScan.Size = new System.Drawing.Size(53, 17); - this.rdoQuickScan.TabIndex = 20; - this.rdoQuickScan.TabStop = true; - this.rdoQuickScan.Text = "&Quick"; - this.rdoQuickScan.UseVisualStyleBackColor = true; + this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox4.Controls.Add(this.bnBrowseRenamingXML); + this.groupBox4.Controls.Add(this.cbRenamingXML); + this.groupBox4.Controls.Add(this.txtRenamingXML); + this.groupBox4.Location = new System.Drawing.Point(6, 305); + this.groupBox4.Name = "groupBox4"; + this.groupBox4.Size = new System.Drawing.Size(517, 57); + this.groupBox4.TabIndex = 2; + this.groupBox4.TabStop = false; + this.groupBox4.Text = "Renaming"; // - // rdoRecentScan + // bnBrowseRenamingXML // - this.rdoRecentScan.AutoSize = true; - this.rdoRecentScan.Location = new System.Drawing.Point(68, 28); - this.rdoRecentScan.Name = "rdoRecentScan"; - this.rdoRecentScan.Size = new System.Drawing.Size(60, 17); - this.rdoRecentScan.TabIndex = 19; - this.rdoRecentScan.TabStop = true; - this.rdoRecentScan.Text = "&Recent"; - this.rdoRecentScan.UseVisualStyleBackColor = true; + this.bnBrowseRenamingXML.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.bnBrowseRenamingXML.Location = new System.Drawing.Point(433, 19); + this.bnBrowseRenamingXML.Name = "bnBrowseRenamingXML"; + this.bnBrowseRenamingXML.Size = new System.Drawing.Size(75, 23); + this.bnBrowseRenamingXML.TabIndex = 2; + this.bnBrowseRenamingXML.Text = "Browse..."; + this.bnBrowseRenamingXML.UseVisualStyleBackColor = true; + this.bnBrowseRenamingXML.Click += new System.EventHandler(this.bnBrowseRenamingXML_Click); // - // rdoFullScan + // cbRenamingXML // - this.rdoFullScan.AutoSize = true; - this.rdoFullScan.Location = new System.Drawing.Point(21, 28); - this.rdoFullScan.Name = "rdoFullScan"; - this.rdoFullScan.Size = new System.Drawing.Size(41, 17); - this.rdoFullScan.TabIndex = 18; - this.rdoFullScan.TabStop = true; - this.rdoFullScan.Text = "&Full"; - this.rdoFullScan.UseVisualStyleBackColor = true; + this.cbRenamingXML.AutoSize = true; + this.cbRenamingXML.Location = new System.Drawing.Point(8, 23); + this.cbRenamingXML.Name = "cbRenamingXML"; + this.cbRenamingXML.Size = new System.Drawing.Size(48, 17); + this.cbRenamingXML.TabIndex = 0; + this.cbRenamingXML.Text = "XML"; + this.cbRenamingXML.UseVisualStyleBackColor = true; + this.cbRenamingXML.CheckedChanged += new System.EventHandler(this.EnableDisable); // - // cbMonitorFolder + // txtRenamingXML // - this.cbMonitorFolder.AutoSize = true; - this.cbMonitorFolder.Location = new System.Drawing.Point(3, 111); - this.cbMonitorFolder.Name = "cbMonitorFolder"; - this.cbMonitorFolder.Size = new System.Drawing.Size(154, 17); - this.cbMonitorFolder.TabIndex = 5; - this.cbMonitorFolder.Text = "&Monitor folders for changes"; - this.toolTip1.SetToolTip(this.cbMonitorFolder, "If the contents of any of these folder change, then automatically do a \"Scan\" and" + - " \"Do\"."); - this.cbMonitorFolder.UseVisualStyleBackColor = true; + this.txtRenamingXML.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtRenamingXML.Location = new System.Drawing.Point(64, 21); + this.txtRenamingXML.Name = "txtRenamingXML"; + this.txtRenamingXML.Size = new System.Drawing.Size(363, 20); + this.txtRenamingXML.TabIndex = 1; // - // bnOpenSearchFolder + // groupBox3 // - this.bnOpenSearchFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.bnOpenSearchFolder.Location = new System.Drawing.Point(165, 458); - this.bnOpenSearchFolder.Name = "bnOpenSearchFolder"; - this.bnOpenSearchFolder.Size = new System.Drawing.Size(75, 23); - this.bnOpenSearchFolder.TabIndex = 4; - this.bnOpenSearchFolder.Text = "&Open"; - this.bnOpenSearchFolder.UseVisualStyleBackColor = true; - this.bnOpenSearchFolder.Click += new System.EventHandler(this.bnOpenSearchFolder_Click); + this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox3.Controls.Add(this.bnBrowseMissingCSV); + this.groupBox3.Controls.Add(this.bnBrowseMissingXML); + this.groupBox3.Controls.Add(this.txtMissingCSV); + this.groupBox3.Controls.Add(this.cbMissingXML); + this.groupBox3.Controls.Add(this.cbMissingCSV); + this.groupBox3.Controls.Add(this.txtMissingXML); + this.groupBox3.Location = new System.Drawing.Point(6, 147); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(517, 79); + this.groupBox3.TabIndex = 1; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Missing"; // - // bnRemoveSearchFolder + // bnBrowseMissingCSV // - this.bnRemoveSearchFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.bnRemoveSearchFolder.Location = new System.Drawing.Point(84, 458); - this.bnRemoveSearchFolder.Name = "bnRemoveSearchFolder"; - this.bnRemoveSearchFolder.Size = new System.Drawing.Size(75, 23); - this.bnRemoveSearchFolder.TabIndex = 3; - this.bnRemoveSearchFolder.Text = "&Remove"; - this.bnRemoveSearchFolder.UseVisualStyleBackColor = true; - this.bnRemoveSearchFolder.Click += new System.EventHandler(this.bnRemoveSearchFolder_Click); + this.bnBrowseMissingCSV.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.bnBrowseMissingCSV.Location = new System.Drawing.Point(433, 47); + this.bnBrowseMissingCSV.Name = "bnBrowseMissingCSV"; + this.bnBrowseMissingCSV.Size = new System.Drawing.Size(75, 23); + this.bnBrowseMissingCSV.TabIndex = 2; + this.bnBrowseMissingCSV.Text = "Browse..."; + this.bnBrowseMissingCSV.UseVisualStyleBackColor = true; + this.bnBrowseMissingCSV.Click += new System.EventHandler(this.bnBrowseMissingCSV_Click); // - // bnAddSearchFolder + // bnBrowseMissingXML // - this.bnAddSearchFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.bnAddSearchFolder.Location = new System.Drawing.Point(3, 458); - this.bnAddSearchFolder.Name = "bnAddSearchFolder"; - this.bnAddSearchFolder.Size = new System.Drawing.Size(75, 23); - this.bnAddSearchFolder.TabIndex = 2; - this.bnAddSearchFolder.Text = "&Add"; - this.bnAddSearchFolder.UseVisualStyleBackColor = true; - this.bnAddSearchFolder.Click += new System.EventHandler(this.bnAddSearchFolder_Click); + this.bnBrowseMissingXML.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.bnBrowseMissingXML.Location = new System.Drawing.Point(434, 19); + this.bnBrowseMissingXML.Name = "bnBrowseMissingXML"; + this.bnBrowseMissingXML.Size = new System.Drawing.Size(75, 23); + this.bnBrowseMissingXML.TabIndex = 5; + this.bnBrowseMissingXML.Text = "Browse..."; + this.bnBrowseMissingXML.UseVisualStyleBackColor = true; + this.bnBrowseMissingXML.Click += new System.EventHandler(this.bnBrowseMissingXML_Click); // - // lbSearchFolders + // txtMissingCSV // - this.lbSearchFolders.AllowDrop = true; - this.lbSearchFolders.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.txtMissingCSV.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.lbSearchFolders.FormattingEnabled = true; - this.lbSearchFolders.Location = new System.Drawing.Point(3, 153); - this.lbSearchFolders.Name = "lbSearchFolders"; - this.lbSearchFolders.ScrollAlwaysVisible = true; - this.lbSearchFolders.Size = new System.Drawing.Size(503, 290); - this.lbSearchFolders.TabIndex = 1; - this.lbSearchFolders.DragDrop += new System.Windows.Forms.DragEventHandler(this.lbSearchFolders_DragDrop); - this.lbSearchFolders.DragOver += new System.Windows.Forms.DragEventHandler(this.lbSearchFolders_DragOver); - this.lbSearchFolders.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lbSearchFolders_KeyDown); + this.txtMissingCSV.Location = new System.Drawing.Point(64, 48); + this.txtMissingCSV.Name = "txtMissingCSV"; + this.txtMissingCSV.Size = new System.Drawing.Size(363, 20); + this.txtMissingCSV.TabIndex = 1; // - // label23 + // cbMissingXML // - this.label23.AutoSize = true; - this.label23.Location = new System.Drawing.Point(5, 131); - this.label23.Name = "label23"; - this.label23.Size = new System.Drawing.Size(78, 13); - this.label23.TabIndex = 0; - this.label23.Text = "&Search Folders"; + this.cbMissingXML.AutoSize = true; + this.cbMissingXML.Location = new System.Drawing.Point(8, 23); + this.cbMissingXML.Name = "cbMissingXML"; + this.cbMissingXML.Size = new System.Drawing.Size(48, 17); + this.cbMissingXML.TabIndex = 3; + this.cbMissingXML.Text = "XML"; + this.cbMissingXML.UseVisualStyleBackColor = true; + this.cbMissingXML.CheckedChanged += new System.EventHandler(this.EnableDisable); // - // tbuTorrentNZB + // cbMissingCSV // - this.tbuTorrentNZB.Controls.Add(this.qBitTorrent); - this.tbuTorrentNZB.Controls.Add(this.label45); - this.tbuTorrentNZB.Controls.Add(this.tbPreferredRSSTerms); - this.tbuTorrentNZB.Controls.Add(this.groupBox1); - this.tbuTorrentNZB.Controls.Add(this.groupBox6); - this.tbuTorrentNZB.Controls.Add(this.RSSGrid); - this.tbuTorrentNZB.Controls.Add(this.bnRSSRemove); - this.tbuTorrentNZB.Controls.Add(this.bnRSSAdd); - this.tbuTorrentNZB.Controls.Add(this.bnRSSGo); - this.tbuTorrentNZB.Controls.Add(this.label25); - this.tbuTorrentNZB.Location = new System.Drawing.Point(4, 40); - this.tbuTorrentNZB.Name = "tbuTorrentNZB"; - this.tbuTorrentNZB.Padding = new System.Windows.Forms.Padding(3); - this.tbuTorrentNZB.Size = new System.Drawing.Size(509, 489); - this.tbuTorrentNZB.TabIndex = 4; - this.tbuTorrentNZB.Text = "Torrents / NZB"; - this.tbuTorrentNZB.UseVisualStyleBackColor = true; + this.cbMissingCSV.AutoSize = true; + this.cbMissingCSV.Location = new System.Drawing.Point(9, 48); + this.cbMissingCSV.Name = "cbMissingCSV"; + this.cbMissingCSV.Size = new System.Drawing.Size(47, 17); + this.cbMissingCSV.TabIndex = 0; + this.cbMissingCSV.Text = "CSV"; + this.cbMissingCSV.UseVisualStyleBackColor = true; + this.cbMissingCSV.CheckedChanged += new System.EventHandler(this.EnableDisable); + // + // txtMissingXML + // + this.txtMissingXML.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtMissingXML.Location = new System.Drawing.Point(64, 21); + this.txtMissingXML.Name = "txtMissingXML"; + this.txtMissingXML.Size = new System.Drawing.Size(363, 20); + this.txtMissingXML.TabIndex = 4; + // + // groupBox2 + // + this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox2.Controls.Add(this.bnBrowseWTWICAL); + this.groupBox2.Controls.Add(this.txtWTWICAL); + this.groupBox2.Controls.Add(this.cbWTWICAL); + this.groupBox2.Controls.Add(this.label4); + this.groupBox2.Controls.Add(this.txtExportRSSDaysPast); + this.groupBox2.Controls.Add(this.bnBrowseWTWXML); + this.groupBox2.Controls.Add(this.txtWTWXML); + this.groupBox2.Controls.Add(this.cbWTWXML); + this.groupBox2.Controls.Add(this.bnBrowseWTWRSS); + this.groupBox2.Controls.Add(this.txtWTWRSS); + this.groupBox2.Controls.Add(this.cbWTWRSS); + this.groupBox2.Controls.Add(this.label17); + this.groupBox2.Controls.Add(this.label16); + this.groupBox2.Controls.Add(this.label15); + this.groupBox2.Controls.Add(this.txtExportRSSMaxDays); + this.groupBox2.Controls.Add(this.txtExportRSSMaxShows); + this.groupBox2.Location = new System.Drawing.Point(6, 6); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(517, 135); + this.groupBox2.TabIndex = 0; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "When to Watch"; // - // qBitTorrent + // bnBrowseWTWICAL // - this.qBitTorrent.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.qBitTorrent.Controls.Add(this.tbqBitTorrentHost); - this.qBitTorrent.Controls.Add(this.tbqBitTorrentPort); - this.qBitTorrent.Controls.Add(this.label41); - this.qBitTorrent.Controls.Add(this.label42); - this.qBitTorrent.Location = new System.Drawing.Point(3, 336); - this.qBitTorrent.Name = "qBitTorrent"; - this.qBitTorrent.Size = new System.Drawing.Size(500, 81); - this.qBitTorrent.TabIndex = 7; - this.qBitTorrent.TabStop = false; - this.qBitTorrent.Text = "qBitTorrent"; + this.bnBrowseWTWICAL.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.bnBrowseWTWICAL.Location = new System.Drawing.Point(434, 76); + this.bnBrowseWTWICAL.Name = "bnBrowseWTWICAL"; + this.bnBrowseWTWICAL.Size = new System.Drawing.Size(75, 23); + this.bnBrowseWTWICAL.TabIndex = 24; + this.bnBrowseWTWICAL.Text = "Browse..."; + this.bnBrowseWTWICAL.UseVisualStyleBackColor = true; + this.bnBrowseWTWICAL.Click += new System.EventHandler(this.bnBrowseWTWICAL_Click); // - // tbqBitTorrentHost + // txtWTWICAL // - this.tbqBitTorrentHost.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtWTWICAL.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.tbqBitTorrentHost.Location = new System.Drawing.Point(75, 19); - this.tbqBitTorrentHost.Name = "tbqBitTorrentHost"; - this.tbqBitTorrentHost.Size = new System.Drawing.Size(419, 20); - this.tbqBitTorrentHost.TabIndex = 1; + this.txtWTWICAL.Location = new System.Drawing.Point(65, 78); + this.txtWTWICAL.Name = "txtWTWICAL"; + this.txtWTWICAL.Size = new System.Drawing.Size(362, 20); + this.txtWTWICAL.TabIndex = 23; // - // tbqBitTorrentPort + // cbWTWICAL // - this.tbqBitTorrentPort.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tbqBitTorrentPort.Location = new System.Drawing.Point(75, 48); - this.tbqBitTorrentPort.Name = "tbqBitTorrentPort"; - this.tbqBitTorrentPort.Size = new System.Drawing.Size(419, 20); - this.tbqBitTorrentPort.TabIndex = 4; + this.cbWTWICAL.AutoSize = true; + this.cbWTWICAL.Location = new System.Drawing.Point(8, 80); + this.cbWTWICAL.Name = "cbWTWICAL"; + this.cbWTWICAL.Size = new System.Drawing.Size(43, 17); + this.cbWTWICAL.TabIndex = 22; + this.cbWTWICAL.Text = "iCal"; + this.cbWTWICAL.UseVisualStyleBackColor = true; + this.cbWTWICAL.CheckedChanged += new System.EventHandler(this.EnableDisable); // - // label41 + // label4 // - this.label41.AutoSize = true; - this.label41.Location = new System.Drawing.Point(11, 51); - this.label41.Name = "label41"; - this.label41.Size = new System.Drawing.Size(29, 13); - this.label41.TabIndex = 3; - this.label41.Text = "Port:"; + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(330, 109); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(59, 13); + this.label4.TabIndex = 21; + this.label4.Text = "in the past."; // - // label42 + // txtExportRSSDaysPast // - this.label42.AutoSize = true; - this.label42.Location = new System.Drawing.Point(11, 22); - this.label42.Name = "label42"; - this.label42.Size = new System.Drawing.Size(32, 13); - this.label42.TabIndex = 0; - this.label42.Text = "Host:"; + this.txtExportRSSDaysPast.Location = new System.Drawing.Point(294, 106); + this.txtExportRSSDaysPast.Name = "txtExportRSSDaysPast"; + this.txtExportRSSDaysPast.Size = new System.Drawing.Size(28, 20); + this.txtExportRSSDaysPast.TabIndex = 20; // - // label45 + // bnBrowseWTWXML // - this.label45.AutoSize = true; - this.label45.Location = new System.Drawing.Point(150, 9); - this.label45.Name = "label45"; - this.label45.Size = new System.Drawing.Size(85, 13); - this.label45.TabIndex = 24; - this.label45.Text = "Preferred Terms:"; + this.bnBrowseWTWXML.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.bnBrowseWTWXML.Location = new System.Drawing.Point(541, 47); + this.bnBrowseWTWXML.Name = "bnBrowseWTWXML"; + this.bnBrowseWTWXML.Size = new System.Drawing.Size(75, 23); + this.bnBrowseWTWXML.TabIndex = 19; + this.bnBrowseWTWXML.Text = "Browse..."; + this.bnBrowseWTWXML.UseVisualStyleBackColor = true; + this.bnBrowseWTWXML.Click += new System.EventHandler(this.bnBrowseWTWXML_Click); // - // tbPreferredRSSTerms + // txtWTWXML // - this.tbPreferredRSSTerms.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtWTWXML.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.tbPreferredRSSTerms.Location = new System.Drawing.Point(241, 6); - this.tbPreferredRSSTerms.Name = "tbPreferredRSSTerms"; - this.tbPreferredRSSTerms.Size = new System.Drawing.Size(262, 20); - this.tbPreferredRSSTerms.TabIndex = 23; + this.txtWTWXML.Location = new System.Drawing.Point(65, 49); + this.txtWTWXML.Name = "txtWTWXML"; + this.txtWTWXML.Size = new System.Drawing.Size(443, 20); + this.txtWTWXML.TabIndex = 18; // - // groupBox1 + // cbWTWXML // - this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox1.Controls.Add(this.txtSABHostPort); - this.groupBox1.Controls.Add(this.txtSABAPIKey); - this.groupBox1.Controls.Add(this.label8); - this.groupBox1.Controls.Add(this.label9); - this.groupBox1.Location = new System.Drawing.Point(3, 163); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(500, 81); - this.groupBox1.TabIndex = 6; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "SABnzbd"; + this.cbWTWXML.AutoSize = true; + this.cbWTWXML.Location = new System.Drawing.Point(8, 51); + this.cbWTWXML.Name = "cbWTWXML"; + this.cbWTWXML.Size = new System.Drawing.Size(48, 17); + this.cbWTWXML.TabIndex = 17; + this.cbWTWXML.Text = "XML"; + this.cbWTWXML.UseVisualStyleBackColor = true; + this.cbWTWXML.CheckedChanged += new System.EventHandler(this.EnableDisable); // - // txtSABHostPort + // bnBrowseWTWRSS // - this.txtSABHostPort.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtSABHostPort.Location = new System.Drawing.Point(75, 19); - this.txtSABHostPort.Name = "txtSABHostPort"; - this.txtSABHostPort.Size = new System.Drawing.Size(419, 20); - this.txtSABHostPort.TabIndex = 1; + this.bnBrowseWTWRSS.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.bnBrowseWTWRSS.Location = new System.Drawing.Point(540, 18); + this.bnBrowseWTWRSS.Name = "bnBrowseWTWRSS"; + this.bnBrowseWTWRSS.Size = new System.Drawing.Size(75, 23); + this.bnBrowseWTWRSS.TabIndex = 2; + this.bnBrowseWTWRSS.Text = "Browse..."; + this.bnBrowseWTWRSS.UseVisualStyleBackColor = true; + this.bnBrowseWTWRSS.Click += new System.EventHandler(this.bnBrowseWTWRSS_Click); // - // txtSABAPIKey + // txtWTWRSS // - this.txtSABAPIKey.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtWTWRSS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txtSABAPIKey.Location = new System.Drawing.Point(75, 48); - this.txtSABAPIKey.Name = "txtSABAPIKey"; - this.txtSABAPIKey.Size = new System.Drawing.Size(419, 20); - this.txtSABAPIKey.TabIndex = 4; + this.txtWTWRSS.Location = new System.Drawing.Point(64, 20); + this.txtWTWRSS.Name = "txtWTWRSS"; + this.txtWTWRSS.Size = new System.Drawing.Size(444, 20); + this.txtWTWRSS.TabIndex = 1; // - // label8 + // cbWTWRSS // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(11, 51); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(48, 13); - this.label8.TabIndex = 3; - this.label8.Text = "API Key:"; + this.cbWTWRSS.AutoSize = true; + this.cbWTWRSS.Location = new System.Drawing.Point(8, 22); + this.cbWTWRSS.Name = "cbWTWRSS"; + this.cbWTWRSS.Size = new System.Drawing.Size(48, 17); + this.cbWTWRSS.TabIndex = 0; + this.cbWTWRSS.Text = "RSS"; + this.cbWTWRSS.UseVisualStyleBackColor = true; + this.cbWTWRSS.CheckedChanged += new System.EventHandler(this.EnableDisable); // - // label9 + // label17 // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(11, 22); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(51, 13); - this.label9.TabIndex = 0; - this.label9.Text = "Host:Port"; + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(212, 109); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(79, 13); + this.label17.TabIndex = 7; + this.label17.Text = "days worth and"; // - // groupBox6 + // label16 // - this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox6.Controls.Add(this.bnUTBrowseResumeDat); - this.groupBox6.Controls.Add(this.txtUTResumeDatPath); - this.groupBox6.Controls.Add(this.bnRSSBrowseuTorrent); - this.groupBox6.Controls.Add(this.label27); - this.groupBox6.Controls.Add(this.label26); - this.groupBox6.Controls.Add(this.txtRSSuTorrentPath); - this.groupBox6.Location = new System.Drawing.Point(3, 250); - this.groupBox6.Name = "groupBox6"; - this.groupBox6.Size = new System.Drawing.Size(500, 80); - this.groupBox6.TabIndex = 5; - this.groupBox6.TabStop = false; - this.groupBox6.Text = "µTorrent"; + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(120, 109); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(52, 13); + this.label16.TabIndex = 5; + this.label16.Text = "shows, or"; // - // bnUTBrowseResumeDat + // label15 // - this.bnUTBrowseResumeDat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.bnUTBrowseResumeDat.Location = new System.Drawing.Point(419, 46); - this.bnUTBrowseResumeDat.Name = "bnUTBrowseResumeDat"; - this.bnUTBrowseResumeDat.Size = new System.Drawing.Size(75, 23); - this.bnUTBrowseResumeDat.TabIndex = 5; - this.bnUTBrowseResumeDat.Text = "Bro&wse..."; - this.bnUTBrowseResumeDat.UseVisualStyleBackColor = true; - this.bnUTBrowseResumeDat.Click += new System.EventHandler(this.bnUTBrowseResumeDat_Click); + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(9, 109); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(71, 13); + this.label15.TabIndex = 3; + this.label15.Text = "No more than"; // - // txtUTResumeDatPath + // txtExportRSSMaxDays // - this.txtUTResumeDatPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtUTResumeDatPath.Location = new System.Drawing.Point(75, 48); - this.txtUTResumeDatPath.Name = "txtUTResumeDatPath"; - this.txtUTResumeDatPath.Size = new System.Drawing.Size(338, 20); - this.txtUTResumeDatPath.TabIndex = 4; + this.txtExportRSSMaxDays.Location = new System.Drawing.Point(178, 106); + this.txtExportRSSMaxDays.Name = "txtExportRSSMaxDays"; + this.txtExportRSSMaxDays.Size = new System.Drawing.Size(28, 20); + this.txtExportRSSMaxDays.TabIndex = 6; + this.txtExportRSSMaxDays.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TxtNumberOnlyKeyPress); + // + // txtExportRSSMaxShows + // + this.txtExportRSSMaxShows.Location = new System.Drawing.Point(86, 106); + this.txtExportRSSMaxShows.Name = "txtExportRSSMaxShows"; + this.txtExportRSSMaxShows.Size = new System.Drawing.Size(28, 20); + this.txtExportRSSMaxShows.TabIndex = 4; + this.txtExportRSSMaxShows.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TxtNumberOnlyKeyPress); + // + // tbFilesAndFolders + // + this.tbFilesAndFolders.Controls.Add(this.label53); + this.tbFilesAndFolders.Controls.Add(this.label54); + this.tbFilesAndFolders.Controls.Add(this.tbPercentBetter); + this.tbFilesAndFolders.Controls.Add(this.tbPriorityOverrideTerms); + this.tbFilesAndFolders.Controls.Add(this.label52); + this.tbFilesAndFolders.Controls.Add(this.txtSeasonFormat); + this.tbFilesAndFolders.Controls.Add(this.txtKeepTogether); + this.tbFilesAndFolders.Controls.Add(this.txtMaxSampleSize); + this.tbFilesAndFolders.Controls.Add(this.txtSpecialsFolderName); + this.tbFilesAndFolders.Controls.Add(this.txtOtherExtensions); + this.tbFilesAndFolders.Controls.Add(this.txtVideoExtensions); + this.tbFilesAndFolders.Controls.Add(this.label47); + this.tbFilesAndFolders.Controls.Add(this.bnTags); + this.tbFilesAndFolders.Controls.Add(this.label39); + this.tbFilesAndFolders.Controls.Add(this.cbKeepTogetherMode); + this.tbFilesAndFolders.Controls.Add(this.bnReplaceRemove); + this.tbFilesAndFolders.Controls.Add(this.bnReplaceAdd); + this.tbFilesAndFolders.Controls.Add(this.label3); + this.tbFilesAndFolders.Controls.Add(this.ReplacementsGrid); + this.tbFilesAndFolders.Controls.Add(this.label19); + this.tbFilesAndFolders.Controls.Add(this.label22); + this.tbFilesAndFolders.Controls.Add(this.label14); + this.tbFilesAndFolders.Controls.Add(this.label13); + this.tbFilesAndFolders.Controls.Add(this.cbKeepTogether); + this.tbFilesAndFolders.Controls.Add(this.cbForceLower); + this.tbFilesAndFolders.Controls.Add(this.cbIgnoreSamples); + this.tbFilesAndFolders.Controls.Add(this.cbLeadingZero); + this.tbFilesAndFolders.Location = new System.Drawing.Point(4, 40); + this.tbFilesAndFolders.Name = "tbFilesAndFolders"; + this.tbFilesAndFolders.Padding = new System.Windows.Forms.Padding(3); + this.tbFilesAndFolders.Size = new System.Drawing.Size(529, 426); + this.tbFilesAndFolders.TabIndex = 1; + this.tbFilesAndFolders.Text = "Files and Folders"; + this.tbFilesAndFolders.UseVisualStyleBackColor = true; // - // bnRSSBrowseuTorrent + // label53 // - this.bnRSSBrowseuTorrent.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.bnRSSBrowseuTorrent.Location = new System.Drawing.Point(419, 16); - this.bnRSSBrowseuTorrent.Name = "bnRSSBrowseuTorrent"; - this.bnRSSBrowseuTorrent.Size = new System.Drawing.Size(75, 23); - this.bnRSSBrowseuTorrent.TabIndex = 2; - this.bnRSSBrowseuTorrent.Text = "&Browse..."; - this.bnRSSBrowseuTorrent.UseVisualStyleBackColor = true; - this.bnRSSBrowseuTorrent.Click += new System.EventHandler(this.bnRSSBrowseuTorrent_Click); + this.label53.AutoSize = true; + this.label53.Location = new System.Drawing.Point(3, 382); + this.label53.Name = "label53"; + this.label53.Size = new System.Drawing.Size(129, 13); + this.label53.TabIndex = 30; + this.label53.Text = "Consider a file better if it is"; // - // label27 + // label54 // - this.label27.AutoSize = true; - this.label27.Location = new System.Drawing.Point(7, 22); - this.label27.Name = "label27"; - this.label27.Size = new System.Drawing.Size(62, 13); - this.label27.TabIndex = 0; - this.label27.Text = "A&pplication:"; + this.label54.AutoSize = true; + this.label54.Location = new System.Drawing.Point(171, 382); + this.label54.Name = "label54"; + this.label54.Size = new System.Drawing.Size(129, 13); + this.label54.TabIndex = 32; + this.label54.Text = "% higher resulution/longer"; // - // label26 + // tbPercentBetter // - this.label26.AutoSize = true; - this.label26.Location = new System.Drawing.Point(7, 51); - this.label26.Name = "label26"; - this.label26.Size = new System.Drawing.Size(62, 13); - this.label26.TabIndex = 3; - this.label26.Text = "resume.&dat:"; + this.tbPercentBetter.Location = new System.Drawing.Point(137, 378); + this.tbPercentBetter.Name = "tbPercentBetter"; + this.tbPercentBetter.Size = new System.Drawing.Size(28, 20); + this.tbPercentBetter.TabIndex = 31; // - // txtRSSuTorrentPath + // tbPriorityOverrideTerms // - this.txtRSSuTorrentPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.tbPriorityOverrideTerms.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txtRSSuTorrentPath.Location = new System.Drawing.Point(75, 19); - this.txtRSSuTorrentPath.Name = "txtRSSuTorrentPath"; - this.txtRSSuTorrentPath.Size = new System.Drawing.Size(338, 20); - this.txtRSSuTorrentPath.TabIndex = 1; + this.tbPriorityOverrideTerms.Location = new System.Drawing.Point(111, 352); + this.tbPriorityOverrideTerms.Name = "tbPriorityOverrideTerms"; + this.tbPriorityOverrideTerms.Size = new System.Drawing.Size(410, 20); + this.tbPriorityOverrideTerms.TabIndex = 29; // - // RSSGrid + // label52 // - this.RSSGrid.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.RSSGrid.BackColor = System.Drawing.SystemColors.Window; - this.RSSGrid.EnableSort = true; - this.RSSGrid.Location = new System.Drawing.Point(3, 36); - this.RSSGrid.Name = "RSSGrid"; - this.RSSGrid.OptimizeMode = SourceGrid.CellOptimizeMode.ForRows; - this.RSSGrid.SelectionMode = SourceGrid.GridSelectionMode.Cell; - this.RSSGrid.Size = new System.Drawing.Size(500, 91); - this.RSSGrid.TabIndex = 1; - this.RSSGrid.TabStop = true; - this.RSSGrid.ToolTipText = ""; + this.label52.AutoSize = true; + this.label52.Location = new System.Drawing.Point(4, 355); + this.label52.Name = "label52"; + this.label52.Size = new System.Drawing.Size(110, 13); + this.label52.TabIndex = 28; + this.label52.Text = "Priority override terms:"; // - // bnRSSRemove + // txtSeasonFormat // - this.bnRSSRemove.Location = new System.Drawing.Point(84, 136); - this.bnRSSRemove.Name = "bnRSSRemove"; - this.bnRSSRemove.Size = new System.Drawing.Size(75, 23); - this.bnRSSRemove.TabIndex = 3; - this.bnRSSRemove.Text = "&Remove"; - this.bnRSSRemove.UseVisualStyleBackColor = true; - this.bnRSSRemove.Click += new System.EventHandler(this.bnRSSRemove_Click); + this.txtSeasonFormat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtSeasonFormat.Location = new System.Drawing.Point(113, 280); + this.txtSeasonFormat.Name = "txtSeasonFormat"; + this.txtSeasonFormat.Size = new System.Drawing.Size(410, 20); + this.txtSeasonFormat.TabIndex = 26; // - // bnRSSAdd + // txtKeepTogether // - this.bnRSSAdd.Location = new System.Drawing.Point(3, 136); - this.bnRSSAdd.Name = "bnRSSAdd"; - this.bnRSSAdd.Size = new System.Drawing.Size(75, 23); - this.bnRSSAdd.TabIndex = 2; - this.bnRSSAdd.Text = "&Add"; - this.bnRSSAdd.UseVisualStyleBackColor = true; - this.bnRSSAdd.Click += new System.EventHandler(this.bnRSSAdd_Click); + this.txtKeepTogether.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtKeepTogether.Location = new System.Drawing.Point(204, 206); + this.txtKeepTogether.Name = "txtKeepTogether"; + this.txtKeepTogether.Size = new System.Drawing.Size(319, 20); + this.txtKeepTogether.TabIndex = 23; // - // bnRSSGo + // txtMaxSampleSize // - this.bnRSSGo.Location = new System.Drawing.Point(165, 136); - this.bnRSSGo.Name = "bnRSSGo"; - this.bnRSSGo.Size = new System.Drawing.Size(75, 23); - this.bnRSSGo.TabIndex = 4; - this.bnRSSGo.Text = "&Open"; - this.bnRSSGo.UseVisualStyleBackColor = true; - this.bnRSSGo.Click += new System.EventHandler(this.bnRSSGo_Click); + this.txtMaxSampleSize.Location = new System.Drawing.Point(172, 304); + this.txtMaxSampleSize.Name = "txtMaxSampleSize"; + this.txtMaxSampleSize.Size = new System.Drawing.Size(53, 20); + this.txtMaxSampleSize.TabIndex = 14; + this.txtMaxSampleSize.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TxtNumberOnlyKeyPress); // - // label25 + // txtSpecialsFolderName // - this.label25.AutoSize = true; - this.label25.Location = new System.Drawing.Point(3, 13); - this.label25.Name = "label25"; - this.label25.Size = new System.Drawing.Size(99, 13); - this.label25.TabIndex = 0; - this.label25.Text = "Torrent RSS URLs:"; + this.txtSpecialsFolderName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtSpecialsFolderName.Location = new System.Drawing.Point(113, 254); + this.txtSpecialsFolderName.Name = "txtSpecialsFolderName"; + this.txtSpecialsFolderName.Size = new System.Drawing.Size(410, 20); + this.txtSpecialsFolderName.TabIndex = 12; // - // tpTreeColoring + // txtOtherExtensions // - this.tpTreeColoring.Controls.Add(this.label7); - this.tpTreeColoring.Controls.Add(this.cboShowStatus); - this.tpTreeColoring.Controls.Add(this.label5); - this.tpTreeColoring.Controls.Add(this.txtShowStatusColor); - this.tpTreeColoring.Controls.Add(this.btnSelectColor); - this.tpTreeColoring.Controls.Add(this.bnRemoveDefinedColor); - this.tpTreeColoring.Controls.Add(this.btnAddShowStatusColoring); - this.tpTreeColoring.Controls.Add(this.lvwDefinedColors); - this.tpTreeColoring.Location = new System.Drawing.Point(4, 40); - this.tpTreeColoring.Name = "tpTreeColoring"; - this.tpTreeColoring.Padding = new System.Windows.Forms.Padding(3); - this.tpTreeColoring.Size = new System.Drawing.Size(509, 489); - this.tpTreeColoring.TabIndex = 7; - this.tpTreeColoring.Text = "Tree Colouring"; - this.tpTreeColoring.UseVisualStyleBackColor = true; + this.txtOtherExtensions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtOtherExtensions.Location = new System.Drawing.Point(99, 154); + this.txtOtherExtensions.Name = "txtOtherExtensions"; + this.txtOtherExtensions.Size = new System.Drawing.Size(424, 20); + this.txtOtherExtensions.TabIndex = 7; // - // label7 + // txtVideoExtensions // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(3, 328); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(40, 13); - this.label7.TabIndex = 8; - this.label7.Text = "&Status:"; + this.txtVideoExtensions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtVideoExtensions.Location = new System.Drawing.Point(99, 128); + this.txtVideoExtensions.Name = "txtVideoExtensions"; + this.txtVideoExtensions.Size = new System.Drawing.Size(526, 20); + this.txtVideoExtensions.TabIndex = 5; // - // cboShowStatus + // label47 // - this.cboShowStatus.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.cboShowStatus.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboShowStatus.FormattingEnabled = true; - this.cboShowStatus.Location = new System.Drawing.Point(51, 325); - this.cboShowStatus.Name = "cboShowStatus"; - this.cboShowStatus.Size = new System.Drawing.Size(452, 21); - this.cboShowStatus.TabIndex = 7; + this.label47.AutoSize = true; + this.label47.Location = new System.Drawing.Point(6, 283); + this.label47.Name = "label47"; + this.label47.Size = new System.Drawing.Size(112, 13); + this.label47.TabIndex = 25; + this.label47.Text = "&Seasons folder format:"; // - // label5 + // bnTags // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(3, 360); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(58, 13); - this.label5.TabIndex = 6; - this.label5.Text = "&Text Color:"; + this.bnTags.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.bnTags.Location = new System.Drawing.Point(568, 328); + this.bnTags.Name = "bnTags"; + this.bnTags.Size = new System.Drawing.Size(75, 23); + this.bnTags.TabIndex = 24; + this.bnTags.Text = "Tags..."; + this.bnTags.UseVisualStyleBackColor = true; + this.bnTags.Click += new System.EventHandler(this.bnTags_Click); // - // txtShowStatusColor + // label39 // - this.txtShowStatusColor.Location = new System.Drawing.Point(67, 357); - this.txtShowStatusColor.Name = "txtShowStatusColor"; - this.txtShowStatusColor.Size = new System.Drawing.Size(100, 20); - this.txtShowStatusColor.TabIndex = 5; - this.txtShowStatusColor.TextChanged += new System.EventHandler(this.txtShowStatusColor_TextChanged); + this.label39.AutoSize = true; + this.label39.Location = new System.Drawing.Point(25, 210); + this.label39.Name = "label39"; + this.label39.Size = new System.Drawing.Size(21, 13); + this.label39.TabIndex = 22; + this.label39.Text = "Do"; // - // btnSelectColor + // cbKeepTogetherMode // - this.btnSelectColor.Location = new System.Drawing.Point(173, 355); - this.btnSelectColor.Name = "btnSelectColor"; - this.btnSelectColor.Size = new System.Drawing.Size(75, 23); - this.btnSelectColor.TabIndex = 4; - this.btnSelectColor.Text = "Select &Color"; - this.btnSelectColor.UseVisualStyleBackColor = true; - this.btnSelectColor.Click += new System.EventHandler(this.btnSelectColor_Click); + this.cbKeepTogetherMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbKeepTogetherMode.FormattingEnabled = true; + this.cbKeepTogetherMode.Items.AddRange(new object[] { + "All", + "All but these", + "Just"}); + this.cbKeepTogetherMode.Location = new System.Drawing.Point(52, 207); + this.cbKeepTogetherMode.Name = "cbKeepTogetherMode"; + this.cbKeepTogetherMode.Size = new System.Drawing.Size(146, 21); + this.cbKeepTogetherMode.Sorted = true; + this.cbKeepTogetherMode.TabIndex = 21; + this.cbKeepTogetherMode.SelectedIndexChanged += new System.EventHandler(this.cbKeepTogetherMode_SelectedIndexChanged); // - // bnRemoveDefinedColor + // bnReplaceRemove // - this.bnRemoveDefinedColor.Enabled = false; - this.bnRemoveDefinedColor.Location = new System.Drawing.Point(6, 296); - this.bnRemoveDefinedColor.Name = "bnRemoveDefinedColor"; - this.bnRemoveDefinedColor.Size = new System.Drawing.Size(75, 23); - this.bnRemoveDefinedColor.TabIndex = 3; - this.bnRemoveDefinedColor.Text = "&Remove"; - this.bnRemoveDefinedColor.UseVisualStyleBackColor = true; - this.bnRemoveDefinedColor.Click += new System.EventHandler(this.bnRemoveDefinedColor_Click); + this.bnReplaceRemove.Location = new System.Drawing.Point(90, 91); + this.bnReplaceRemove.Name = "bnReplaceRemove"; + this.bnReplaceRemove.Size = new System.Drawing.Size(75, 23); + this.bnReplaceRemove.TabIndex = 3; + this.bnReplaceRemove.Text = "&Remove"; + this.bnReplaceRemove.UseVisualStyleBackColor = true; + this.bnReplaceRemove.Click += new System.EventHandler(this.bnReplaceRemove_Click); // - // btnAddShowStatusColoring + // bnReplaceAdd // - this.btnAddShowStatusColoring.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnAddShowStatusColoring.Location = new System.Drawing.Point(428, 352); - this.btnAddShowStatusColoring.Name = "btnAddShowStatusColoring"; - this.btnAddShowStatusColoring.Size = new System.Drawing.Size(75, 23); - this.btnAddShowStatusColoring.TabIndex = 3; - this.btnAddShowStatusColoring.Text = "&Add"; - this.btnAddShowStatusColoring.UseVisualStyleBackColor = true; - this.btnAddShowStatusColoring.Click += new System.EventHandler(this.btnAddShowStatusColoring_Click); + this.bnReplaceAdd.Location = new System.Drawing.Point(9, 91); + this.bnReplaceAdd.Name = "bnReplaceAdd"; + this.bnReplaceAdd.Size = new System.Drawing.Size(75, 23); + this.bnReplaceAdd.TabIndex = 2; + this.bnReplaceAdd.Text = "&Add"; + this.bnReplaceAdd.UseVisualStyleBackColor = true; + this.bnReplaceAdd.Click += new System.EventHandler(this.bnReplaceAdd_Click); // - // lvwDefinedColors + // label3 // - this.lvwDefinedColors.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lvwDefinedColors.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.colShowStatus, - this.colColor}); - this.lvwDefinedColors.GridLines = true; - this.lvwDefinedColors.Location = new System.Drawing.Point(6, 6); - this.lvwDefinedColors.MultiSelect = false; - this.lvwDefinedColors.Name = "lvwDefinedColors"; - this.lvwDefinedColors.Size = new System.Drawing.Size(497, 284); - this.lvwDefinedColors.TabIndex = 0; - this.lvwDefinedColors.UseCompatibleStateImageBehavior = false; - this.lvwDefinedColors.View = System.Windows.Forms.View.Details; - this.lvwDefinedColors.SelectedIndexChanged += new System.EventHandler(this.lvwDefinedColors_SelectedIndexChanged); - this.lvwDefinedColors.DoubleClick += new System.EventHandler(this.lvwDefinedColors_DoubleClick); + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(3, 3); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(120, 13); + this.label3.TabIndex = 0; + this.label3.Text = "Filename Replacements"; // - // colShowStatus + // ReplacementsGrid // - this.colShowStatus.Text = "Show Status"; - this.colShowStatus.Width = 297; + this.ReplacementsGrid.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.ReplacementsGrid.BackColor = System.Drawing.SystemColors.Window; + this.ReplacementsGrid.EnableSort = true; + this.ReplacementsGrid.Location = new System.Drawing.Point(6, 19); + this.ReplacementsGrid.Name = "ReplacementsGrid"; + this.ReplacementsGrid.OptimizeMode = SourceGrid.CellOptimizeMode.ForRows; + this.ReplacementsGrid.SelectionMode = SourceGrid.GridSelectionMode.Cell; + this.ReplacementsGrid.Size = new System.Drawing.Size(517, 62); + this.ReplacementsGrid.TabIndex = 1; + this.ReplacementsGrid.TabStop = true; + this.ReplacementsGrid.ToolTipText = ""; // - // colColor + // label19 // - this.colColor.Text = "Color"; - this.colColor.Width = 92; + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(228, 307); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(55, 13); + this.label19.TabIndex = 15; + this.label19.Text = "MB in size"; // - // tpBulkAdd + // label22 // - this.tpBulkAdd.Controls.Add(this.groupBox9); - this.tpBulkAdd.Controls.Add(this.groupBox8); - this.tpBulkAdd.Location = new System.Drawing.Point(4, 40); - this.tpBulkAdd.Name = "tpBulkAdd"; - this.tpBulkAdd.Padding = new System.Windows.Forms.Padding(3); - this.tpBulkAdd.Size = new System.Drawing.Size(509, 489); - this.tpBulkAdd.TabIndex = 10; - this.tpBulkAdd.Text = "Bulk/Auto Add"; - this.tpBulkAdd.UseVisualStyleBackColor = true; + this.label22.AutoSize = true; + this.label22.Location = new System.Drawing.Point(3, 157); + this.label22.Name = "label22"; + this.label22.Size = new System.Drawing.Size(89, 13); + this.label22.TabIndex = 6; + this.label22.Text = "&Other extensions:"; // - // groupBox9 + // label14 // - this.groupBox9.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox9.Controls.Add(this.chkForceBulkAddToUseSettingsOnly); - this.groupBox9.Controls.Add(this.cbIgnoreRecycleBin); - this.groupBox9.Controls.Add(this.cbIgnoreNoVideoFolders); - this.groupBox9.Location = new System.Drawing.Point(6, 10); - this.groupBox9.Name = "groupBox9"; - this.groupBox9.Size = new System.Drawing.Size(497, 111); - this.groupBox9.TabIndex = 16; - this.groupBox9.TabStop = false; - this.groupBox9.Text = "Bulk Add"; + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(3, 131); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(90, 13); + this.label14.TabIndex = 4; + this.label14.Text = "&Video extensions:"; // - // chkForceBulkAddToUseSettingsOnly + // label13 // - this.chkForceBulkAddToUseSettingsOnly.AutoSize = true; - this.chkForceBulkAddToUseSettingsOnly.Location = new System.Drawing.Point(6, 65); - this.chkForceBulkAddToUseSettingsOnly.Name = "chkForceBulkAddToUseSettingsOnly"; - this.chkForceBulkAddToUseSettingsOnly.Size = new System.Drawing.Size(248, 17); - this.chkForceBulkAddToUseSettingsOnly.TabIndex = 15; - this.chkForceBulkAddToUseSettingsOnly.Text = "Force to Use Season Words from Settings Only"; - this.toolTip1.SetToolTip(this.chkForceBulkAddToUseSettingsOnly, "If set then Bulk Add just uses the season words from settings. If not set (recomm" + - "ended) then Bulk Add finds addition season words from each show\'s configuration." + - ""); - this.chkForceBulkAddToUseSettingsOnly.UseVisualStyleBackColor = true; + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(6, 254); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(108, 13); + this.label13.TabIndex = 11; + this.label13.Text = "&Specials folder name:"; // - // cbIgnoreRecycleBin + // cbKeepTogether // - this.cbIgnoreRecycleBin.AutoSize = true; - this.cbIgnoreRecycleBin.Location = new System.Drawing.Point(6, 42); - this.cbIgnoreRecycleBin.Name = "cbIgnoreRecycleBin"; - this.cbIgnoreRecycleBin.Size = new System.Drawing.Size(116, 17); - this.cbIgnoreRecycleBin.TabIndex = 14; - this.cbIgnoreRecycleBin.Text = "Ignore &Recycle Bin"; - this.toolTip1.SetToolTip(this.cbIgnoreRecycleBin, "If set then Bulk Add ignores all files in the Recycle Bin"); - this.cbIgnoreRecycleBin.UseVisualStyleBackColor = true; + this.cbKeepTogether.AutoSize = true; + this.cbKeepTogether.Location = new System.Drawing.Point(6, 180); + this.cbKeepTogether.Name = "cbKeepTogether"; + this.cbKeepTogether.Size = new System.Drawing.Size(251, 17); + this.cbKeepTogether.TabIndex = 8; + this.cbKeepTogether.Text = "&Copy/Move files with same base name as video"; + this.cbKeepTogether.UseVisualStyleBackColor = true; + this.cbKeepTogether.CheckedChanged += new System.EventHandler(this.cbKeepTogether_CheckedChanged); // - // cbIgnoreNoVideoFolders + // cbForceLower // - this.cbIgnoreNoVideoFolders.AutoSize = true; - this.cbIgnoreNoVideoFolders.Location = new System.Drawing.Point(6, 19); - this.cbIgnoreNoVideoFolders.Name = "cbIgnoreNoVideoFolders"; - this.cbIgnoreNoVideoFolders.Size = new System.Drawing.Size(225, 17); - this.cbIgnoreNoVideoFolders.TabIndex = 13; - this.cbIgnoreNoVideoFolders.Text = "&Only Include Folders containing Video files"; - this.toolTip1.SetToolTip(this.cbIgnoreNoVideoFolders, "If set then only folders that contain video files are considered for the \'Bulk Ad" + - "d\' feature"); - this.cbIgnoreNoVideoFolders.UseVisualStyleBackColor = true; + this.cbForceLower.AutoSize = true; + this.cbForceLower.Location = new System.Drawing.Point(6, 329); + this.cbForceLower.Name = "cbForceLower"; + this.cbForceLower.Size = new System.Drawing.Size(167, 17); + this.cbForceLower.TabIndex = 16; + this.cbForceLower.Text = "&Make all filenames lower case"; + this.cbForceLower.UseVisualStyleBackColor = true; // - // groupBox8 + // cbIgnoreSamples // - this.groupBox8.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox8.Controls.Add(this.chkAutoSearchForDownloadedFiles); - this.groupBox8.Controls.Add(this.label43); - this.groupBox8.Controls.Add(this.label44); - this.groupBox8.Controls.Add(this.tbIgnoreSuffixes); - this.groupBox8.Controls.Add(this.tbMovieTerms); - this.groupBox8.Location = new System.Drawing.Point(6, 127); - this.groupBox8.Name = "groupBox8"; - this.groupBox8.Size = new System.Drawing.Size(497, 107); - this.groupBox8.TabIndex = 13; - this.groupBox8.TabStop = false; - this.groupBox8.Text = "Auto Add"; + this.cbIgnoreSamples.AutoSize = true; + this.cbIgnoreSamples.Location = new System.Drawing.Point(6, 306); + this.cbIgnoreSamples.Name = "cbIgnoreSamples"; + this.cbIgnoreSamples.Size = new System.Drawing.Size(166, 17); + this.cbIgnoreSamples.TabIndex = 13; + this.cbIgnoreSamples.Text = "&Ignore \"sample\" videos, up to"; + this.cbIgnoreSamples.UseVisualStyleBackColor = true; // - // chkAutoSearchForDownloadedFiles + // cbLeadingZero // - this.chkAutoSearchForDownloadedFiles.AutoSize = true; - this.chkAutoSearchForDownloadedFiles.Location = new System.Drawing.Point(6, 19); - this.chkAutoSearchForDownloadedFiles.Name = "chkAutoSearchForDownloadedFiles"; - this.chkAutoSearchForDownloadedFiles.Size = new System.Drawing.Size(186, 17); - this.chkAutoSearchForDownloadedFiles.TabIndex = 16; - this.chkAutoSearchForDownloadedFiles.Text = "Notify when new shows are found"; - this.chkAutoSearchForDownloadedFiles.UseVisualStyleBackColor = true; + this.cbLeadingZero.AutoSize = true; + this.cbLeadingZero.Location = new System.Drawing.Point(6, 234); + this.cbLeadingZero.Name = "cbLeadingZero"; + this.cbLeadingZero.Size = new System.Drawing.Size(170, 17); + this.cbLeadingZero.TabIndex = 10; + this.cbLeadingZero.Text = "&Leading 0 on Season numbers"; + this.cbLeadingZero.UseVisualStyleBackColor = true; // - // label43 + // tbGeneral // - this.label43.AutoSize = true; - this.label43.Location = new System.Drawing.Point(3, 69); - this.label43.Name = "label43"; - this.label43.Size = new System.Drawing.Size(78, 13); - this.label43.TabIndex = 14; - this.label43.Text = "&Ignore suffixes:"; + this.tbGeneral.Controls.Add(this.cbShowCollections); + this.tbGeneral.Controls.Add(this.label37); + this.tbGeneral.Controls.Add(this.label38); + this.tbGeneral.Controls.Add(this.tbPercentDirty); + this.tbGeneral.Controls.Add(this.txtParallelDownloads); + this.tbGeneral.Controls.Add(this.txtWTWDays); + this.tbGeneral.Controls.Add(this.cbMode); + this.tbGeneral.Controls.Add(this.label34); + this.tbGeneral.Controls.Add(this.label10); + this.tbGeneral.Controls.Add(this.cbLookForAirdate); + this.tbGeneral.Controls.Add(this.cbLanguages); + this.tbGeneral.Controls.Add(this.label21); + this.tbGeneral.Controls.Add(this.label20); + this.tbGeneral.Controls.Add(this.label2); + this.tbGeneral.Location = new System.Drawing.Point(4, 40); + this.tbGeneral.Name = "tbGeneral"; + this.tbGeneral.Padding = new System.Windows.Forms.Padding(3); + this.tbGeneral.Size = new System.Drawing.Size(529, 426); + this.tbGeneral.TabIndex = 0; + this.tbGeneral.Text = "General"; + this.tbGeneral.UseVisualStyleBackColor = true; // - // label44 + // label37 // - this.label44.AutoSize = true; - this.label44.Location = new System.Drawing.Point(3, 43); - this.label44.Name = "label44"; - this.label44.Size = new System.Drawing.Size(71, 13); - this.label44.TabIndex = 12; - this.label44.Text = "&Movie Terms:"; + this.label37.AutoSize = true; + this.label37.Location = new System.Drawing.Point(11, 62); + this.label37.Name = "label37"; + this.label37.Size = new System.Drawing.Size(114, 13); + this.label37.TabIndex = 20; + this.label37.Text = "Refresh entire series if"; // - // tbIgnoreSuffixes + // label38 // - this.tbIgnoreSuffixes.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tbIgnoreSuffixes.Location = new System.Drawing.Point(99, 66); - this.tbIgnoreSuffixes.Name = "tbIgnoreSuffixes"; - this.tbIgnoreSuffixes.Size = new System.Drawing.Size(395, 20); - this.tbIgnoreSuffixes.TabIndex = 15; - this.toolTip1.SetToolTip(this.tbIgnoreSuffixes, "These terms and any text after them will be ignored when\r\nsearching on TVDB for t" + - "he show title based on the filename."); + this.label38.AutoSize = true; + this.label38.Location = new System.Drawing.Point(163, 62); + this.label38.Name = "label38"; + this.label38.Size = new System.Drawing.Size(132, 13); + this.label38.TabIndex = 22; + this.label38.Text = "% of episodes are updated"; // - // tbMovieTerms + // tbPercentDirty // - this.tbMovieTerms.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tbMovieTerms.Location = new System.Drawing.Point(99, 40); - this.tbMovieTerms.Name = "tbMovieTerms"; - this.tbMovieTerms.Size = new System.Drawing.Size(395, 20); - this.tbMovieTerms.TabIndex = 13; - this.toolTip1.SetToolTip(this.tbMovieTerms, "If a filename contains any of these terms then it is assumed\r\nthat it is a Film a" + - "nd not a TV Show. Hence \'Auto Add\' is not\r\ninvoked for this file."); + this.tbPercentDirty.Location = new System.Drawing.Point(128, 59); + this.tbPercentDirty.Name = "tbPercentDirty"; + this.tbPercentDirty.Size = new System.Drawing.Size(28, 20); + this.tbPercentDirty.TabIndex = 21; // - // tpSubtitles + // txtParallelDownloads // - this.tpSubtitles.Controls.Add(this.cbTxtToSub); - this.tpSubtitles.Controls.Add(this.label46); - this.tpSubtitles.Controls.Add(this.txtSubtitleExtensions); - this.tpSubtitles.Controls.Add(this.chkRetainLanguageSpecificSubtitles); - this.tpSubtitles.Location = new System.Drawing.Point(4, 40); - this.tpSubtitles.Name = "tpSubtitles"; - this.tpSubtitles.Padding = new System.Windows.Forms.Padding(3); - this.tpSubtitles.Size = new System.Drawing.Size(509, 489); - this.tpSubtitles.TabIndex = 11; - this.tpSubtitles.Text = "Subtitles"; - this.tpSubtitles.UseVisualStyleBackColor = true; + this.txtParallelDownloads.Location = new System.Drawing.Point(97, 35); + this.txtParallelDownloads.Name = "txtParallelDownloads"; + this.txtParallelDownloads.Size = new System.Drawing.Size(28, 20); + this.txtParallelDownloads.TabIndex = 12; + this.txtParallelDownloads.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TxtNumberOnlyKeyPress); // - // cbTxtToSub + // txtWTWDays // - this.cbTxtToSub.AutoSize = true; - this.cbTxtToSub.Location = new System.Drawing.Point(6, 38); - this.cbTxtToSub.Name = "cbTxtToSub"; - this.cbTxtToSub.Size = new System.Drawing.Size(118, 17); - this.cbTxtToSub.TabIndex = 28; - this.cbTxtToSub.Text = "&Rename .txt to .sub"; - this.cbTxtToSub.UseVisualStyleBackColor = true; + this.txtWTWDays.Location = new System.Drawing.Point(13, 9); + this.txtWTWDays.Name = "txtWTWDays"; + this.txtWTWDays.Size = new System.Drawing.Size(28, 20); + this.txtWTWDays.TabIndex = 1; + this.txtWTWDays.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TxtNumberOnlyKeyPress); // - // label46 + // cbMode // - this.label46.AutoSize = true; - this.label46.Location = new System.Drawing.Point(3, 66); - this.label46.Name = "label46"; - this.label46.Size = new System.Drawing.Size(98, 13); - this.label46.TabIndex = 26; - this.label46.Text = "&Subtitle extensions:"; + this.cbMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbMode.FormattingEnabled = true; + this.cbMode.Items.AddRange(new object[] { + "Beta", + "Production"}); + this.cbMode.Location = new System.Drawing.Point(117, 130); + this.cbMode.Name = "cbMode"; + this.cbMode.Size = new System.Drawing.Size(146, 21); + this.cbMode.Sorted = true; + this.cbMode.TabIndex = 19; // - // txtSubtitleExtensions + // label34 // - this.txtSubtitleExtensions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtSubtitleExtensions.Location = new System.Drawing.Point(107, 63); - this.txtSubtitleExtensions.Name = "txtSubtitleExtensions"; - this.txtSubtitleExtensions.Size = new System.Drawing.Size(396, 20); - this.txtSubtitleExtensions.TabIndex = 27; + this.label34.AutoSize = true; + this.label34.Location = new System.Drawing.Point(11, 133); + this.label34.Name = "label34"; + this.label34.Size = new System.Drawing.Size(37, 13); + this.label34.TabIndex = 18; + this.label34.Text = "&Mode:"; // - // chkRetainLanguageSpecificSubtitles + // label10 // - this.chkRetainLanguageSpecificSubtitles.AutoSize = true; - this.chkRetainLanguageSpecificSubtitles.Location = new System.Drawing.Point(6, 15); - this.chkRetainLanguageSpecificSubtitles.Name = "chkRetainLanguageSpecificSubtitles"; - this.chkRetainLanguageSpecificSubtitles.Size = new System.Drawing.Size(192, 17); - this.chkRetainLanguageSpecificSubtitles.TabIndex = 25; - this.chkRetainLanguageSpecificSubtitles.Text = "Retain &Language Specific Subtitles"; - this.chkRetainLanguageSpecificSubtitles.UseVisualStyleBackColor = true; + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(11, 109); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(100, 13); + this.label10.TabIndex = 16; + this.label10.Text = "&Preferred language:"; // - // folderBrowser + // cbLookForAirdate // - this.folderBrowser.ShowNewFolderButton = false; + this.cbLookForAirdate.AutoSize = true; + this.cbLookForAirdate.Location = new System.Drawing.Point(14, 85); + this.cbLookForAirdate.Name = "cbLookForAirdate"; + this.cbLookForAirdate.Size = new System.Drawing.Size(158, 17); + this.cbLookForAirdate.TabIndex = 15; + this.cbLookForAirdate.Text = "&Look for airdate in filenames"; + this.cbLookForAirdate.UseVisualStyleBackColor = true; // - // openFile + // cbLanguages // - this.openFile.Filter = "Torrent files (*.torrent)|*.torrent|All files (*.*)|*.*"; + this.cbLanguages.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbLanguages.FormattingEnabled = true; + this.cbLanguages.Items.AddRange(new object[] { + "My Shows", + "Scan", + "When to Watch"}); + this.cbLanguages.Location = new System.Drawing.Point(117, 106); + this.cbLanguages.Name = "cbLanguages"; + this.cbLanguages.Size = new System.Drawing.Size(146, 21); + this.cbLanguages.Sorted = true; + this.cbLanguages.TabIndex = 17; // - // cmDefaults + // label21 // - this.cmDefaults.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.KODIToolStripMenuItem, - this.pyTivoToolStripMenuItem, - this.mede8erToolStripMenuItem, - this.noneToolStripMenuItem}); - this.cmDefaults.Name = "cmDefaults"; - this.cmDefaults.Size = new System.Drawing.Size(121, 92); - this.cmDefaults.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.cmDefaults_ItemClicked); + this.label21.AutoSize = true; + this.label21.Location = new System.Drawing.Point(11, 38); + this.label21.Name = "label21"; + this.label21.Size = new System.Drawing.Size(82, 13); + this.label21.TabIndex = 11; + this.label21.Text = "&Download up to"; // - // KODIToolStripMenuItem + // label20 // - this.KODIToolStripMenuItem.Name = "KODIToolStripMenuItem"; - this.KODIToolStripMenuItem.Size = new System.Drawing.Size(120, 22); - this.KODIToolStripMenuItem.Tag = "1"; - this.KODIToolStripMenuItem.Text = "&KODI"; + this.label20.AutoSize = true; + this.label20.Location = new System.Drawing.Point(131, 38); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(170, 13); + this.label20.TabIndex = 13; + this.label20.Text = "shows simultaneously from thetvdb"; // - // pyTivoToolStripMenuItem + // label2 // - this.pyTivoToolStripMenuItem.Name = "pyTivoToolStripMenuItem"; - this.pyTivoToolStripMenuItem.Size = new System.Drawing.Size(120, 22); - this.pyTivoToolStripMenuItem.Tag = "2"; - this.pyTivoToolStripMenuItem.Text = "&pyTivo"; + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(47, 12); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(111, 13); + this.label2.TabIndex = 2; + this.label2.Text = "days counts as recent"; // - // mede8erToolStripMenuItem + // tpSearch // - this.mede8erToolStripMenuItem.Name = "mede8erToolStripMenuItem"; - this.mede8erToolStripMenuItem.Size = new System.Drawing.Size(120, 22); - this.mede8erToolStripMenuItem.Tag = "3"; - this.mede8erToolStripMenuItem.Text = "&Mede8er"; + this.tpSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tpSearch.Controls.Add(this.tbGeneral); + this.tpSearch.Controls.Add(this.tbFilesAndFolders); + this.tpSearch.Controls.Add(this.tbAutoExport); + this.tpSearch.Controls.Add(this.tpScanOptions); + this.tpSearch.Controls.Add(this.tbFolderDeleting); + this.tpSearch.Controls.Add(this.tbMediaCenter); + this.tpSearch.Controls.Add(this.tbSearchFolders); + this.tpSearch.Controls.Add(this.tbuTorrentNZB); + this.tpSearch.Controls.Add(this.tpTreeColoring); + this.tpSearch.Controls.Add(this.tpBulkAdd); + this.tpSearch.Controls.Add(this.tpSubtitles); + this.tpSearch.Controls.Add(this.tabPage1); + this.tpSearch.Controls.Add(this.tpDisplay); + this.tpSearch.Location = new System.Drawing.Point(12, 12); + this.tpSearch.Multiline = true; + this.tpSearch.Name = "tpSearch"; + this.tpSearch.SelectedIndex = 0; + this.tpSearch.Size = new System.Drawing.Size(537, 470); + this.tpSearch.TabIndex = 0; // - // noneToolStripMenuItem + // cbShowCollections // - this.noneToolStripMenuItem.Name = "noneToolStripMenuItem"; - this.noneToolStripMenuItem.Size = new System.Drawing.Size(120, 22); - this.noneToolStripMenuItem.Tag = "4"; - this.noneToolStripMenuItem.Text = "&None"; + this.cbShowCollections.AutoSize = true; + this.cbShowCollections.Location = new System.Drawing.Point(13, 157); + this.cbShowCollections.Name = "cbShowCollections"; + this.cbShowCollections.Size = new System.Drawing.Size(145, 17); + this.cbShowCollections.TabIndex = 23; + this.cbShowCollections.Text = "Multiple Show collections"; + this.cbShowCollections.UseVisualStyleBackColor = true; // // cbDeleteShowFromDisk // @@ -2753,7 +2969,7 @@ private void InitializeComponent() this.cbDeleteShowFromDisk.Location = new System.Drawing.Point(16, 267); this.cbDeleteShowFromDisk.Name = "cbDeleteShowFromDisk"; this.cbDeleteShowFromDisk.Size = new System.Drawing.Size(269, 17); - this.cbDeleteShowFromDisk.TabIndex = 11; + this.cbDeleteShowFromDisk.TabIndex = 12; this.cbDeleteShowFromDisk.Text = "Delete from disk when deleting show from database"; this.cbDeleteShowFromDisk.UseVisualStyleBackColor = true; // @@ -2763,9 +2979,9 @@ private void InitializeComponent() this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.bnCancel; - this.ClientSize = new System.Drawing.Size(541, 579); + this.ClientSize = new System.Drawing.Size(561, 535); this.ControlBox = false; - this.Controls.Add(this.tabControl1); + this.Controls.Add(this.tpSearch); this.Controls.Add(this.bnCancel); this.Controls.Add(this.OKButton); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); @@ -2779,13 +2995,40 @@ private void InitializeComponent() this.Text = "Preferences"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Preferences_FormClosing); this.Load += new System.EventHandler(this.Preferences_Load); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); - this.tabControl1.ResumeLayout(false); - this.tbGeneral.ResumeLayout(false); - this.tbGeneral.PerformLayout(); - this.tbFilesAndFolders.ResumeLayout(false); - this.tbFilesAndFolders.PerformLayout(); + this.cmDefaults.ResumeLayout(false); + this.tpDisplay.ResumeLayout(false); + this.tpDisplay.PerformLayout(); + this.tabPage1.ResumeLayout(false); + this.gbJSON.ResumeLayout(false); + this.gbJSON.PerformLayout(); + this.gbRSS.ResumeLayout(false); + this.gbRSS.PerformLayout(); + this.tpSubtitles.ResumeLayout(false); + this.tpSubtitles.PerformLayout(); + this.tpBulkAdd.ResumeLayout(false); + this.groupBox9.ResumeLayout(false); + this.groupBox9.PerformLayout(); + this.groupBox8.ResumeLayout(false); + this.groupBox8.PerformLayout(); + this.tpTreeColoring.ResumeLayout(false); + this.tpTreeColoring.PerformLayout(); + this.tbuTorrentNZB.ResumeLayout(false); + this.qBitTorrent.ResumeLayout(false); + this.qBitTorrent.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox6.ResumeLayout(false); + this.groupBox6.PerformLayout(); + this.tbSearchFolders.ResumeLayout(false); + this.tbSearchFolders.PerformLayout(); + this.tbMediaCenter.ResumeLayout(false); + this.tbMediaCenter.PerformLayout(); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.tbFolderDeleting.ResumeLayout(false); + this.tbFolderDeleting.PerformLayout(); + this.tpScanOptions.ResumeLayout(false); + this.tpScanOptions.PerformLayout(); this.tbAutoExport.ResumeLayout(false); this.groupBox7.ResumeLayout(false); this.groupBox7.PerformLayout(); @@ -2795,34 +3038,13 @@ private void InitializeComponent() this.groupBox4.PerformLayout(); this.groupBox3.ResumeLayout(false); this.groupBox3.PerformLayout(); - this.tpScanOptions.ResumeLayout(false); - this.tpScanOptions.PerformLayout(); - this.tbFolderDeleting.ResumeLayout(false); - this.tbFolderDeleting.PerformLayout(); - this.tbMediaCenter.ResumeLayout(false); - this.tbMediaCenter.PerformLayout(); - this.panel1.ResumeLayout(false); - this.panel1.PerformLayout(); - this.tbSearchFolders.ResumeLayout(false); - this.tbSearchFolders.PerformLayout(); - this.tbuTorrentNZB.ResumeLayout(false); - this.tbuTorrentNZB.PerformLayout(); - this.qBitTorrent.ResumeLayout(false); - this.qBitTorrent.PerformLayout(); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.groupBox6.ResumeLayout(false); - this.groupBox6.PerformLayout(); - this.tpTreeColoring.ResumeLayout(false); - this.tpTreeColoring.PerformLayout(); - this.tpBulkAdd.ResumeLayout(false); - this.groupBox9.ResumeLayout(false); - this.groupBox9.PerformLayout(); - this.groupBox8.ResumeLayout(false); - this.groupBox8.PerformLayout(); - this.tpSubtitles.ResumeLayout(false); - this.tpSubtitles.PerformLayout(); - this.cmDefaults.ResumeLayout(false); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.tbFilesAndFolders.ResumeLayout(false); + this.tbFilesAndFolders.PerformLayout(); + this.tbGeneral.ResumeLayout(false); + this.tbGeneral.PerformLayout(); + this.tpSearch.ResumeLayout(false); this.ResumeLayout(false); } @@ -2830,202 +3052,132 @@ private void InitializeComponent() #endregion - private System.Windows.Forms.TabPage tpScanOptions; - private System.Windows.Forms.CheckBox cbSearchRSS; - private System.Windows.Forms.CheckBox cbRenameCheck; - private System.Windows.Forms.CheckBox cbMissing; - private System.Windows.Forms.CheckBox cbLeaveOriginals; - private System.Windows.Forms.CheckBox cbSearchLocally; - private System.Windows.Forms.Label label28; - private SourceGrid.Grid ReplacementsGrid; - private System.Windows.Forms.Button bnReplaceRemove; - private System.Windows.Forms.Button bnReplaceAdd; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.CheckBox cbCheckuTorrent; - private System.Windows.Forms.CheckBox cbAutoSelInMyShows; - private System.Windows.Forms.RadioButton rbFolderSeasonPoster; - private System.Windows.Forms.Button OKButton; private System.Windows.Forms.Button bnCancel; - - private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.Button bnBrowseWTWRSS; - private System.Windows.Forms.TextBox txtWTWRSS; - - private System.Windows.Forms.CheckBox cbWTWRSS; private System.Windows.Forms.SaveFileDialog saveFile; - - private System.Windows.Forms.TextBox txtWTWDays; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.ComboBox cbStartupTab; - private System.Windows.Forms.Label label6; - - private System.Windows.Forms.CheckBox cbNotificationIcon; - private System.Windows.Forms.TextBox txtVideoExtensions; - private System.Windows.Forms.Label label14; - private System.Windows.Forms.Label label16; - private System.Windows.Forms.Label label15; - private System.Windows.Forms.TextBox txtExportRSSMaxDays; - - private System.Windows.Forms.TextBox txtExportRSSMaxShows; - private System.Windows.Forms.Label label17; - private System.Windows.Forms.CheckBox cbKeepTogether; - private System.Windows.Forms.CheckBox cbLeadingZero; - private System.Windows.Forms.CheckBox chkShowInTaskbar; - private System.Windows.Forms.CheckBox cbShowEpisodePictures; - private System.Windows.Forms.TextBox txtSpecialsFolderName; - private System.Windows.Forms.Label label13; - private System.Windows.Forms.TabControl tabControl1; - private System.Windows.Forms.TabPage tbGeneral; - private System.Windows.Forms.TabPage tbFilesAndFolders; - private System.Windows.Forms.TabPage tbAutoExport; - private System.Windows.Forms.GroupBox groupBox3; - private System.Windows.Forms.GroupBox groupBox5; - private System.Windows.Forms.GroupBox groupBox4; - private System.Windows.Forms.Button bnBrowseMissingCSV; - private System.Windows.Forms.CheckBox cbMissingCSV; - private System.Windows.Forms.TextBox txtMissingCSV; - private System.Windows.Forms.Button bnBrowseMissingXML; - private System.Windows.Forms.CheckBox cbMissingXML; - private System.Windows.Forms.TextBox txtMissingXML; - private System.Windows.Forms.Button bnBrowseFOXML; - - private System.Windows.Forms.CheckBox cbFOXML; - private System.Windows.Forms.TextBox txtFOXML; - - private System.Windows.Forms.Button bnBrowseRenamingXML; - private System.Windows.Forms.CheckBox cbRenamingXML; - private System.Windows.Forms.TextBox txtRenamingXML; - private System.Windows.Forms.CheckBox cbIgnoreSamples; - - private System.Windows.Forms.CheckBox cbForceLower; - private System.Windows.Forms.Label label19; - private System.Windows.Forms.TextBox txtMaxSampleSize; - private System.Windows.Forms.Label label21; - private System.Windows.Forms.Label label20; - private System.Windows.Forms.TextBox txtParallelDownloads; - private System.Windows.Forms.Label label22; - private System.Windows.Forms.TextBox txtOtherExtensions; - private System.Windows.Forms.TabPage tbSearchFolders; - private System.Windows.Forms.Button bnOpenSearchFolder; - private System.Windows.Forms.Button bnRemoveSearchFolder; - private System.Windows.Forms.Button bnAddSearchFolder; - private System.Windows.Forms.ListBox lbSearchFolders; - private System.Windows.Forms.Label label23; private System.Windows.Forms.FolderBrowserDialog folderBrowser; - private System.Windows.Forms.TabPage tbuTorrentNZB; - private System.Windows.Forms.Button bnRSSBrowseuTorrent; - private System.Windows.Forms.Button bnRSSGo; - private System.Windows.Forms.TextBox txtRSSuTorrentPath; - - private System.Windows.Forms.Label label25; - private SourceGrid.Grid RSSGrid; - - private System.Windows.Forms.Button bnRSSRemove; - private System.Windows.Forms.Button bnRSSAdd; private System.Windows.Forms.OpenFileDialog openFile; - private System.Windows.Forms.GroupBox groupBox6; - private System.Windows.Forms.Button bnUTBrowseResumeDat; - private System.Windows.Forms.TextBox txtUTResumeDatPath; - private System.Windows.Forms.Label label27; - private System.Windows.Forms.Label label26; - private System.Windows.Forms.CheckBox cbLookForAirdate; - private System.Windows.Forms.CheckBox cbMonitorFolder; private System.Windows.Forms.ToolTip toolTip1; + private System.Windows.Forms.ColorDialog colorDialog; + private System.Windows.Forms.ContextMenuStrip cmDefaults; + private System.Windows.Forms.ToolStripMenuItem KODIToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem pyTivoToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mede8erToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem noneToolStripMenuItem; + private System.Windows.Forms.TabPage tpDisplay; + private System.Windows.Forms.CheckBox chkHideWtWSpoilers; + private System.Windows.Forms.CheckBox chkHideMyShowsSpoilers; + private System.Windows.Forms.RadioButton rbWTWScan; + private System.Windows.Forms.RadioButton rbWTWSearch; + private System.Windows.Forms.ComboBox cbStartupTab; + private System.Windows.Forms.CheckBox cbAutoSelInMyShows; + private System.Windows.Forms.CheckBox cbShowEpisodePictures; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.CheckBox chkShowInTaskbar; + private System.Windows.Forms.CheckBox cbNotificationIcon; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.GroupBox gbJSON; + private System.Windows.Forms.Label label51; + private System.Windows.Forms.TextBox tbJSONFilenameToken; + private System.Windows.Forms.Label label50; + private System.Windows.Forms.TextBox tbJSONURLToken; + private System.Windows.Forms.Label label49; + private System.Windows.Forms.TextBox tbJSONRootNode; + private System.Windows.Forms.Label label48; + private System.Windows.Forms.TextBox tbJSONURL; + private System.Windows.Forms.GroupBox gbRSS; + private System.Windows.Forms.Label label45; + private System.Windows.Forms.TextBox tbPreferredRSSTerms; + private SourceGrid.Grid RSSGrid; + private System.Windows.Forms.Label label25; + private System.Windows.Forms.Button bnRSSRemove; + private System.Windows.Forms.Button bnRSSGo; + private System.Windows.Forms.Button bnRSSAdd; + private System.Windows.Forms.TabPage tpSubtitles; + private System.Windows.Forms.CheckBox cbTxtToSub; + private System.Windows.Forms.Label label46; + private System.Windows.Forms.TextBox txtSubtitleExtensions; + private System.Windows.Forms.CheckBox chkRetainLanguageSpecificSubtitles; + private System.Windows.Forms.TabPage tpBulkAdd; + private System.Windows.Forms.GroupBox groupBox9; + private System.Windows.Forms.CheckBox chkForceBulkAddToUseSettingsOnly; + private System.Windows.Forms.CheckBox cbIgnoreRecycleBin; + private System.Windows.Forms.CheckBox cbIgnoreNoVideoFolders; + private System.Windows.Forms.GroupBox groupBox8; + private System.Windows.Forms.CheckBox chkAutoSearchForDownloadedFiles; + private System.Windows.Forms.Label label43; + private System.Windows.Forms.Label label44; + private System.Windows.Forms.TextBox tbIgnoreSuffixes; + private System.Windows.Forms.TextBox tbMovieTerms; private System.Windows.Forms.TabPage tpTreeColoring; - private System.Windows.Forms.ListView lvwDefinedColors; - private System.Windows.Forms.ColumnHeader colShowStatus; - private System.Windows.Forms.ColumnHeader colColor; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.ComboBox cboShowStatus; + private System.Windows.Forms.Label label5; private System.Windows.Forms.TextBox txtShowStatusColor; private System.Windows.Forms.Button btnSelectColor; - private System.Windows.Forms.Button btnAddShowStatusColoring; - private System.Windows.Forms.ColorDialog colorDialog; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.ComboBox cboShowStatus; - private System.Windows.Forms.Label label7; private System.Windows.Forms.Button bnRemoveDefinedColor; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.TextBox txtExportRSSDaysPast; - private System.Windows.Forms.Button bnBrowseWTWXML; - private System.Windows.Forms.TextBox txtWTWXML; - private System.Windows.Forms.CheckBox cbWTWXML; + private System.Windows.Forms.Button btnAddShowStatusColoring; + private System.Windows.Forms.ListView lvwDefinedColors; + private System.Windows.Forms.ColumnHeader colShowStatus; + private System.Windows.Forms.ColumnHeader colColor; + private System.Windows.Forms.TabPage tbuTorrentNZB; + private System.Windows.Forms.GroupBox qBitTorrent; + private System.Windows.Forms.TextBox tbqBitTorrentHost; + private System.Windows.Forms.TextBox tbqBitTorrentPort; + private System.Windows.Forms.Label label41; + private System.Windows.Forms.Label label42; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.TextBox txtSABHostPort; private System.Windows.Forms.TextBox txtSABAPIKey; private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label9; - private System.Windows.Forms.CheckBox cbCheckSABnzbd; - private System.Windows.Forms.Label label10; - private System.Windows.Forms.ComboBox cbLanguages; - private System.Windows.Forms.RadioButton rbWTWScan; - private System.Windows.Forms.RadioButton rbWTWSearch; - private System.Windows.Forms.Label label11; - private System.Windows.Forms.CheckBox cbKODIImages; + private System.Windows.Forms.GroupBox groupBox6; + private System.Windows.Forms.Button bnUTBrowseResumeDat; + private System.Windows.Forms.TextBox txtUTResumeDatPath; + private System.Windows.Forms.Button bnRSSBrowseuTorrent; + private System.Windows.Forms.Label label27; + private System.Windows.Forms.Label label26; + private System.Windows.Forms.TextBox txtRSSuTorrentPath; + private System.Windows.Forms.TabPage tbSearchFolders; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.DomainUpDown domainUpDown1; + private System.Windows.Forms.CheckBox chkScheduledScan; + private System.Windows.Forms.CheckBox chkScanOnStartup; private System.Windows.Forms.Label lblScanAction; private System.Windows.Forms.RadioButton rdoQuickScan; private System.Windows.Forms.RadioButton rdoRecentScan; private System.Windows.Forms.RadioButton rdoFullScan; + private System.Windows.Forms.CheckBox cbMonitorFolder; + private System.Windows.Forms.Button bnOpenSearchFolder; + private System.Windows.Forms.Button bnRemoveSearchFolder; + private System.Windows.Forms.Button bnAddSearchFolder; + private System.Windows.Forms.ListBox lbSearchFolders; + private System.Windows.Forms.Label label23; private System.Windows.Forms.TabPage tbMediaCenter; + private System.Windows.Forms.CheckBox cbWDLiveEpisodeFiles; + private System.Windows.Forms.CheckBox cbNFOEpisodes; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.RadioButton rbFolderBanner; + private System.Windows.Forms.RadioButton rbFolderPoster; + private System.Windows.Forms.RadioButton rbFolderFanArt; + private System.Windows.Forms.RadioButton rbFolderSeasonPoster; + private System.Windows.Forms.CheckBox cbKODIImages; + private System.Windows.Forms.Button bnMCPresets; + private System.Windows.Forms.CheckBox cbShrinkLarge; + private System.Windows.Forms.CheckBox cbEpThumbJpg; private System.Windows.Forms.Label label29; private System.Windows.Forms.Label label24; private System.Windows.Forms.Label label18; private System.Windows.Forms.Label label12; private System.Windows.Forms.CheckBox cbMetaSubfolder; private System.Windows.Forms.CheckBox cbMeta; - private System.Windows.Forms.RadioButton rbFolderFanArt; - private System.Windows.Forms.RadioButton rbFolderPoster; - private System.Windows.Forms.RadioButton rbFolderBanner; private System.Windows.Forms.CheckBox cbEpTBNs; - private System.Windows.Forms.CheckBox cbNFOShows; - private System.Windows.Forms.CheckBox cbFolderJpg; - private System.Windows.Forms.CheckBox cbEpThumbJpg; - private System.Windows.Forms.CheckBox cbShrinkLarge; private System.Windows.Forms.CheckBox cbSeriesJpg; private System.Windows.Forms.CheckBox cbXMLFiles; - private System.Windows.Forms.Button bnMCPresets; - private System.Windows.Forms.ContextMenuStrip cmDefaults; - private System.Windows.Forms.ToolStripMenuItem KODIToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem pyTivoToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem mede8erToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem noneToolStripMenuItem; + private System.Windows.Forms.CheckBox cbNFOShows; private System.Windows.Forms.CheckBox cbFantArtJpg; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.CheckBox cbNFOEpisodes; - private System.Windows.Forms.GroupBox groupBox7; - private System.Windows.Forms.Button bnBrowseShowsTXT; - private System.Windows.Forms.CheckBox cbShowsTXT; - private System.Windows.Forms.TextBox txtShowsTXTTo; - private System.Windows.Forms.Label label33; - private System.Windows.Forms.CheckBox cbAutoCreateFolders; - private System.Windows.Forms.ComboBox cbMode; - private System.Windows.Forms.Label label34; - private System.Windows.Forms.TextBox txtSeasonFolderName; - private System.Windows.Forms.Label label35; - private System.Windows.Forms.TextBox tbSeasonSearchTerms; - private System.Windows.Forms.Label label36; - private System.Windows.Forms.Label label37; - private System.Windows.Forms.Label label38; - private System.Windows.Forms.TextBox tbPercentDirty; - private System.Windows.Forms.Label label39; - private System.Windows.Forms.ComboBox cbKeepTogetherMode; - private System.Windows.Forms.TextBox txtKeepTogether; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.DomainUpDown domainUpDown1; - private System.Windows.Forms.CheckBox chkScheduledScan; - private System.Windows.Forms.CheckBox chkScanOnStartup; - private System.Windows.Forms.Label label40; - private System.Windows.Forms.CheckBox cbxUpdateAirDate; - private System.Windows.Forms.CheckBox chkHideWtWSpoilers; - private System.Windows.Forms.CheckBox chkHideMyShowsSpoilers; - private System.Windows.Forms.CheckBox chkPreventMove; - private System.Windows.Forms.CheckBox chkAutoMergeDownloadEpisodes; - private System.Windows.Forms.TabPage tpBulkAdd; - private System.Windows.Forms.Button bnBrowseShowsHTML; - private System.Windows.Forms.CheckBox cbShowsHTML; - private System.Windows.Forms.TextBox txtShowsHTMLTo; - private System.Windows.Forms.Label label45; - private System.Windows.Forms.TextBox tbPreferredRSSTerms; - private System.Windows.Forms.CheckBox chkAutoMergeLibraryEpisodes; + private System.Windows.Forms.CheckBox cbFolderJpg; private System.Windows.Forms.TabPage tbFolderDeleting; private System.Windows.Forms.CheckBox cbCleanUpDownloadDir; private System.Windows.Forms.Label label32; @@ -3039,35 +3191,113 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox cbEmptyIgnoreWords; private System.Windows.Forms.CheckBox cbEmptyIgnoreExtensions; private System.Windows.Forms.CheckBox cbDeleteEmpty; - private System.Windows.Forms.TabPage tpSubtitles; - private System.Windows.Forms.Label label46; - private System.Windows.Forms.TextBox txtSubtitleExtensions; - private System.Windows.Forms.CheckBox chkRetainLanguageSpecificSubtitles; - private System.Windows.Forms.CheckBox cbTxtToSub; - private System.Windows.Forms.GroupBox groupBox9; - private System.Windows.Forms.CheckBox chkForceBulkAddToUseSettingsOnly; - private System.Windows.Forms.CheckBox cbIgnoreRecycleBin; - private System.Windows.Forms.CheckBox cbIgnoreNoVideoFolders; - private System.Windows.Forms.GroupBox groupBox8; - private System.Windows.Forms.CheckBox chkAutoSearchForDownloadedFiles; - private System.Windows.Forms.Label label43; - private System.Windows.Forms.Label label44; - private System.Windows.Forms.TextBox tbIgnoreSuffixes; - private System.Windows.Forms.TextBox tbMovieTerms; + private System.Windows.Forms.TabPage tpScanOptions; + private System.Windows.Forms.CheckBox cbHigherQuality; + private System.Windows.Forms.CheckBox cbSearchJSON; + private System.Windows.Forms.CheckBox cbCheckqBitTorrent; + private System.Windows.Forms.CheckBox chkAutoMergeLibraryEpisodes; + private System.Windows.Forms.CheckBox chkAutoMergeDownloadEpisodes; + private System.Windows.Forms.CheckBox chkPreventMove; + private System.Windows.Forms.Label label40; + private System.Windows.Forms.CheckBox cbxUpdateAirDate; + private System.Windows.Forms.Label label33; + private System.Windows.Forms.CheckBox cbAutoCreateFolders; + private System.Windows.Forms.Label label28; + private System.Windows.Forms.CheckBox cbSearchRSS; + private System.Windows.Forms.CheckBox cbRenameCheck; + private System.Windows.Forms.CheckBox cbMissing; + private System.Windows.Forms.CheckBox cbLeaveOriginals; + private System.Windows.Forms.CheckBox cbCheckSABnzbd; + private System.Windows.Forms.CheckBox cbCheckuTorrent; + private System.Windows.Forms.CheckBox cbSearchLocally; + private System.Windows.Forms.TabPage tbAutoExport; + private System.Windows.Forms.GroupBox groupBox7; + private System.Windows.Forms.Button bnBrowseShowsHTML; + private System.Windows.Forms.CheckBox cbShowsHTML; + private System.Windows.Forms.TextBox txtShowsHTMLTo; + private System.Windows.Forms.Button bnBrowseShowsTXT; + private System.Windows.Forms.CheckBox cbShowsTXT; + private System.Windows.Forms.TextBox txtShowsTXTTo; + private System.Windows.Forms.GroupBox groupBox5; + private System.Windows.Forms.Button bnBrowseFOXML; + private System.Windows.Forms.CheckBox cbFOXML; + private System.Windows.Forms.TextBox txtFOXML; + private System.Windows.Forms.GroupBox groupBox4; + private System.Windows.Forms.Button bnBrowseRenamingXML; + private System.Windows.Forms.CheckBox cbRenamingXML; + private System.Windows.Forms.TextBox txtRenamingXML; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.Button bnBrowseMissingCSV; + private System.Windows.Forms.Button bnBrowseMissingXML; + private System.Windows.Forms.TextBox txtMissingCSV; + private System.Windows.Forms.CheckBox cbMissingXML; + private System.Windows.Forms.CheckBox cbMissingCSV; + private System.Windows.Forms.TextBox txtMissingXML; + private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.Button bnBrowseWTWICAL; private System.Windows.Forms.TextBox txtWTWICAL; private System.Windows.Forms.CheckBox cbWTWICAL; - private System.Windows.Forms.GroupBox qBitTorrent; - private System.Windows.Forms.TextBox tbqBitTorrentHost; - private System.Windows.Forms.TextBox tbqBitTorrentPort; - private System.Windows.Forms.Label label41; - private System.Windows.Forms.Label label42; - private System.Windows.Forms.CheckBox cbCheckqBitTorrent; - private System.Windows.Forms.Button bnTags; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox txtExportRSSDaysPast; + private System.Windows.Forms.Button bnBrowseWTWXML; + private System.Windows.Forms.TextBox txtWTWXML; + private System.Windows.Forms.CheckBox cbWTWXML; + private System.Windows.Forms.Button bnBrowseWTWRSS; + private System.Windows.Forms.TextBox txtWTWRSS; + private System.Windows.Forms.CheckBox cbWTWRSS; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.TextBox txtExportRSSMaxDays; + private System.Windows.Forms.TextBox txtExportRSSMaxShows; + private System.Windows.Forms.TabPage tbFilesAndFolders; private System.Windows.Forms.TextBox txtSeasonFormat; + private System.Windows.Forms.TextBox txtKeepTogether; + private System.Windows.Forms.TextBox txtMaxSampleSize; + private System.Windows.Forms.TextBox txtSpecialsFolderName; + private System.Windows.Forms.TextBox txtOtherExtensions; + private System.Windows.Forms.TextBox txtVideoExtensions; private System.Windows.Forms.Label label47; - private System.Windows.Forms.CheckBox cbWDLiveEpisodeFiles; - private System.Windows.Forms.CheckBox cbShowCollections; + private System.Windows.Forms.Button bnTags; + private System.Windows.Forms.Label label39; + private System.Windows.Forms.ComboBox cbKeepTogetherMode; + private System.Windows.Forms.Button bnReplaceRemove; + private System.Windows.Forms.Button bnReplaceAdd; + private System.Windows.Forms.Label label3; + private SourceGrid.Grid ReplacementsGrid; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.Label label22; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.CheckBox cbKeepTogether; + private System.Windows.Forms.CheckBox cbForceLower; + private System.Windows.Forms.CheckBox cbIgnoreSamples; + private System.Windows.Forms.CheckBox cbLeadingZero; + private System.Windows.Forms.TabPage tbGeneral; + private System.Windows.Forms.Label label37; + private System.Windows.Forms.Label label38; + private System.Windows.Forms.TextBox tbPercentDirty; + private System.Windows.Forms.TextBox txtParallelDownloads; + private System.Windows.Forms.TextBox txtWTWDays; + private System.Windows.Forms.ComboBox cbMode; + private System.Windows.Forms.Label label34; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.CheckBox cbLookForAirdate; + private System.Windows.Forms.ComboBox cbLanguages; + private System.Windows.Forms.Label label21; + private System.Windows.Forms.Label label20; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TabControl tpSearch; + private System.Windows.Forms.TextBox tbSeasonSearchTerms; + private System.Windows.Forms.Label label36; + private System.Windows.Forms.TextBox txtSeasonFolderName; + private System.Windows.Forms.Label label35; + private System.Windows.Forms.Label label53; + private System.Windows.Forms.Label label54; + private System.Windows.Forms.TextBox tbPercentBetter; + private System.Windows.Forms.TextBox tbPriorityOverrideTerms; + private System.Windows.Forms.Label label52; private System.Windows.Forms.CheckBox cbDeleteShowFromDisk; + private System.Windows.Forms.CheckBox cbShowCollections; } } diff --git a/TVRename/Forms/Preferences/Preferences.cs b/TVRename/Forms/Preferences/Preferences.cs index 9b0111ae9..96096d614 100644 --- a/TVRename/Forms/Preferences/Preferences.cs +++ b/TVRename/Forms/Preferences/Preferences.cs @@ -50,7 +50,7 @@ public Preferences(TVDoc doc, bool goToScanOpts, Season s) cntfw = null; if (goToScanOpts) - tabControl1.SelectedTab = tpScanOptions; + tpSearch.SelectedTab = tpScanOptions; } private void OKButton_Click(object sender, EventArgs e) @@ -60,7 +60,7 @@ private void OKButton_Click(object sender, EventArgs e) MessageBox.Show( "Extensions list must be separated by semicolons, and each extension must start with a dot.", "Preferences", MessageBoxButtons.OK, MessageBoxIcon.Warning); - tabControl1.SelectedTab = tbFolderDeleting; + tpSearch.SelectedTab = tbFolderDeleting; txtEmptyIgnoreExtensions.Focus(); return; } @@ -70,7 +70,7 @@ private void OKButton_Click(object sender, EventArgs e) MessageBox.Show( "Extensions list must be separated by semicolons, and each extension must start with a dot.", "Preferences", MessageBoxButtons.OK, MessageBoxIcon.Warning); - tabControl1.SelectedTab = tbFilesAndFolders; + tpSearch.SelectedTab = tbFilesAndFolders; txtVideoExtensions.Focus(); return; } @@ -79,7 +79,7 @@ private void OKButton_Click(object sender, EventArgs e) MessageBox.Show( "Extensions list must be separated by semicolons, and each extension must start with a dot.", "Preferences", MessageBoxButtons.OK, MessageBoxIcon.Warning); - tabControl1.SelectedTab = tpSubtitles; + tpSearch.SelectedTab = tpSubtitles; txtSubtitleExtensions.Focus(); return; } @@ -88,7 +88,7 @@ private void OKButton_Click(object sender, EventArgs e) MessageBox.Show( "Extensions list must be separated by semicolons, and each extension must start with a dot.", "Preferences", MessageBoxButtons.OK, MessageBoxIcon.Warning); - tabControl1.SelectedTab = tbFilesAndFolders; + tpSearch.SelectedTab = tbFilesAndFolders; txtOtherExtensions.Focus(); return; } @@ -97,7 +97,7 @@ private void OKButton_Click(object sender, EventArgs e) MessageBox.Show( "Extensions list must be separated by semicolons, and each extension must start with a dot.", "Preferences", MessageBoxButtons.OK, MessageBoxIcon.Warning); - tabControl1.SelectedTab = tbFilesAndFolders; + tpSearch.SelectedTab = tbFilesAndFolders; txtKeepTogether.Focus(); return; } @@ -149,6 +149,7 @@ private void OKButton_Click(object sender, EventArgs e) s.ShowEpisodePictures = cbShowEpisodePictures.Checked; s.ShowCollections = cbShowCollections.Checked; s.DeleteShowFromDisk = cbDeleteShowFromDisk.Checked; + s.ReplaceWithBetterQuality = cbHigherQuality.Checked; s.HideMyShowsSpoilers = chkHideMyShowsSpoilers.Checked; s.HideWtWSpoilers = chkHideWtWSpoilers.Checked; s.AutoSelectShowInMyShows = cbAutoSelInMyShows.Checked; @@ -192,6 +193,12 @@ private void OKButton_Click(object sender, EventArgs e) s.RetainLanguageSpecificSubtitles = chkRetainLanguageSpecificSubtitles.Checked; s.ForceBulkAddToUseSettingsOnly = chkForceBulkAddToUseSettingsOnly.Checked; + s.SearchJSON = cbSearchJSON.Checked; + s.SearchJSONURL = tbJSONURL.Text; + s.SearchJSONRootNode = tbJSONRootNode.Text; + s.SearchJSONFilenameToken = tbJSONFilenameToken.Text; + s.SearchJSONURLToken = tbJSONURLToken.Text; + s.MonitorFolders = cbMonitorFolder.Checked; s.runStartupCheck = chkScanOnStartup.Checked; s.runPeriodicCheck = chkScheduledScan.Checked; @@ -217,6 +224,7 @@ private void OKButton_Click(object sender, EventArgs e) s.BulkAddIgnoreRecycleBin = cbIgnoreRecycleBin.Checked; s.AutoAddIgnoreSuffixes = tbIgnoreSuffixes.Text; s.AutoAddMovieTerms = tbMovieTerms.Text; + s.PriorityReplaceTerms = tbPriorityOverrideTerms.Text; if (rbFolderFanArt.Checked) s.FolderJpgIs = TVSettings.FolderJpgIsType.FanArt; @@ -279,11 +287,25 @@ private void OKButton_Click(object sender, EventArgs e) { s.upgradeDirtyPercent = 20; } + if (s.upgradeDirtyPercent < 1) s.upgradeDirtyPercent = 1; else if (s.upgradeDirtyPercent > 100) s.upgradeDirtyPercent = 100; + try + { + s.replaceMargin = float.Parse(tbPercentBetter.Text); + } + catch + { + s.replaceMargin = 10; + } + + if (s.replaceMargin < 1) + s.replaceMargin = 1; + else if (s.replaceMargin > 100) + s.replaceMargin = 100; try { @@ -397,9 +419,17 @@ private void Preferences_Load(object sender, EventArgs e) tbqBitTorrentPort.Text = s.qBitTorrentPort; cbCheckqBitTorrent.Checked= s.CheckqBitTorrent ; cbCheckSABnzbd.Checked = s.CheckSABnzbd; + cbHigherQuality.Checked= s.ReplaceWithBetterQuality ; txtParallelDownloads.Text = s.ParallelDownloads.ToString(); tbPercentDirty.Text = s.upgradeDirtyPercent.ToString(CultureInfo.InvariantCulture); + tbPercentBetter.Text = s.replaceMargin.ToString(CultureInfo.InvariantCulture); + + cbSearchJSON.Checked = s.SearchJSON; + tbJSONURL.Text = s.SearchJSONURL; + tbJSONRootNode.Text = s.SearchJSONRootNode; + tbJSONFilenameToken.Text = s.SearchJSONFilenameToken; + tbJSONURLToken.Text = s.SearchJSONURLToken; cbSearchRSS.Checked = s.SearchRSS; cbEpTBNs.Checked = s.EpTBNs; @@ -454,6 +484,8 @@ private void Preferences_Load(object sender, EventArgs e) tbMovieTerms.Text = s.AutoAddMovieTerms; tbIgnoreSuffixes.Text = s.AutoAddIgnoreSuffixes; + tbPriorityOverrideTerms.Text = s.PriorityReplaceTerms; + switch (s.WTWDoubleClick) { case TVSettings.WTWDoubleClickAction.Search: @@ -1223,5 +1255,15 @@ private void bnTags_Click(object sender, EventArgs e) cntfw.Show(this); Focus(); } + + private void cbSearchRSS_CheckedChanged(object sender, EventArgs e) + { + gbRSS.Enabled = cbSearchRSS.Checked; + } + + private void cbSearchJSON_CheckedChanged(object sender, EventArgs e) + { + gbJSON.Enabled = cbSearchJSON.Checked; + } } } diff --git a/TVRename/Forms/Preferences/Preferences.resx b/TVRename/Forms/Preferences/Preferences.resx index b4e8c4829..10fa0e6f1 100644 --- a/TVRename/Forms/Preferences/Preferences.resx +++ b/TVRename/Forms/Preferences/Preferences.resx @@ -120,15 +120,15 @@ 17, 17 - - 108, 17 - 205, 17 332, 17 + + 108, 17 + 430, 17 diff --git a/TVRename/Forms/ShowPreferences/AddEditShow.cs b/TVRename/Forms/ShowPreferences/AddEditShow.cs index 90776e422..d3f2b8c97 100644 --- a/TVRename/Forms/ShowPreferences/AddEditShow.cs +++ b/TVRename/Forms/ShowPreferences/AddEditShow.cs @@ -187,7 +187,7 @@ private bool OkToClose() } if (chkCustomLanguage.Checked && string.IsNullOrWhiteSpace(cbLanguage.SelectedItem?.ToString())) { - DialogResult dr = MessageBox.Show("Please enter language for the show or accept the default preferred language", "TVRename Add/Edit Show", + MessageBox.Show("Please enter language for the show or accept the default preferred language", "TVRename Add/Edit Show", MessageBoxButtons.OK, MessageBoxIcon.Warning); return false; diff --git a/TVRename/Forms/UI.Designer.cs b/TVRename/Forms/UI.Designer.cs index 86376985b..90cad08cd 100644 --- a/TVRename/Forms/UI.Designer.cs +++ b/TVRename/Forms/UI.Designer.cs @@ -91,7 +91,7 @@ public void InitializeComponent() this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); this.showSummaryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.actorsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.betaToolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.episodeFileQualitySummaryLogToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.timezoneInconsistencyLOGToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.torrentMatchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -105,6 +105,8 @@ public void InitializeComponent() this.buyMeADrinkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); this.checkForNewVersionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); + this.logToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tbMyShows = new System.Windows.Forms.TabPage(); this.btnFilter = new System.Windows.Forms.Button(); @@ -194,8 +196,7 @@ public void InitializeComponent() this.tmrPeriodicScan = new System.Windows.Forms.Timer(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.btnUpdateAvailable = new System.Windows.Forms.Button(); - this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); - this.logToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.episodeFileQualitySummaryLogToolStripMenuItemToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tbMyShows.SuspendLayout(); @@ -218,7 +219,7 @@ public void InitializeComponent() this.optionsToolStripMenuItem, this.toolsToolStripMenuItem, this.viewToolStripMenuItem, - this.betaToolsToolStripMenuItem, + this.episodeFileQualitySummaryLogToolStripMenuItem, this.helpToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; @@ -247,7 +248,7 @@ public void InitializeComponent() this.toolStripSeparator8}); this.collToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("collToolStripMenuItem.Image"))); this.collToolStripMenuItem.Name = "collToolStripMenuItem"; - this.collToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.collToolStripMenuItem.Size = new System.Drawing.Size(147, 22); this.collToolStripMenuItem.Text = "&Collection"; // // aeCollToolStripMenuItem @@ -265,13 +266,13 @@ public void InitializeComponent() // toolStripSeparator0 // this.toolStripSeparator0.Name = "toolStripSeparator0"; - this.toolStripSeparator0.Size = new System.Drawing.Size(177, 6); + this.toolStripSeparator0.Size = new System.Drawing.Size(144, 6); // // exportToolStripMenuItem // this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; this.exportToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); - this.exportToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.exportToolStripMenuItem.Size = new System.Drawing.Size(147, 22); this.exportToolStripMenuItem.Text = "&Export"; this.exportToolStripMenuItem.Click += new System.EventHandler(this.exportToolStripMenuItem_Click); // @@ -280,20 +281,20 @@ public void InitializeComponent() this.saveToolStripMenuItem.Image = global::TVRename.Properties.Resources.saveHS; this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(147, 22); this.saveToolStripMenuItem.Text = "&Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(144, 6); // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); - this.exitToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.exitToolStripMenuItem.Size = new System.Drawing.Size(147, 22); this.exitToolStripMenuItem.Text = "E&xit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); // @@ -441,19 +442,19 @@ public void InitializeComponent() // this.statisticsToolStripMenuItem.Image = global::TVRename.Properties.Resources.graphhs; this.statisticsToolStripMenuItem.Name = "statisticsToolStripMenuItem"; - this.statisticsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.statisticsToolStripMenuItem.Size = new System.Drawing.Size(166, 22); this.statisticsToolStripMenuItem.Text = "&Statistics..."; this.statisticsToolStripMenuItem.Click += new System.EventHandler(this.statisticsToolStripMenuItem_Click); // // toolStripSeparator5 // this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(177, 6); + this.toolStripSeparator5.Size = new System.Drawing.Size(163, 6); // // showSummaryToolStripMenuItem // this.showSummaryToolStripMenuItem.Name = "showSummaryToolStripMenuItem"; - this.showSummaryToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.showSummaryToolStripMenuItem.Size = new System.Drawing.Size(166, 22); this.showSummaryToolStripMenuItem.Text = "Show Summary..."; this.showSummaryToolStripMenuItem.Click += new System.EventHandler(this.showSummaryToolStripMenuItem_Click); // @@ -461,44 +462,45 @@ public void InitializeComponent() // this.actorsToolStripMenuItem.Image = global::TVRename.Properties.Resources.TableHS; this.actorsToolStripMenuItem.Name = "actorsToolStripMenuItem"; - this.actorsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.actorsToolStripMenuItem.Size = new System.Drawing.Size(166, 22); this.actorsToolStripMenuItem.Text = "&Actors Grid..."; this.actorsToolStripMenuItem.Click += new System.EventHandler(this.actorsToolStripMenuItem_Click); // - // betaToolsToolStripMenuItem + // episodeFileQualitySummaryLogToolStripMenuItem // - this.betaToolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.episodeFileQualitySummaryLogToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.timezoneInconsistencyLOGToolStripMenuItem, + this.episodeFileQualitySummaryLogToolStripMenuItemToolStripMenuItem, this.toolStripSeparator4, this.torrentMatchToolStripMenuItem, this.uTorrentToolStripMenuItem}); - this.betaToolsToolStripMenuItem.Name = "betaToolsToolStripMenuItem"; - this.betaToolsToolStripMenuItem.Size = new System.Drawing.Size(42, 20); - this.betaToolsToolStripMenuItem.Text = "Beta"; + this.episodeFileQualitySummaryLogToolStripMenuItem.Name = "episodeFileQualitySummaryLogToolStripMenuItem"; + this.episodeFileQualitySummaryLogToolStripMenuItem.Size = new System.Drawing.Size(42, 20); + this.episodeFileQualitySummaryLogToolStripMenuItem.Text = "Beta"; // // timezoneInconsistencyLOGToolStripMenuItem // this.timezoneInconsistencyLOGToolStripMenuItem.Name = "timezoneInconsistencyLOGToolStripMenuItem"; - this.timezoneInconsistencyLOGToolStripMenuItem.Size = new System.Drawing.Size(235, 22); + this.timezoneInconsistencyLOGToolStripMenuItem.Size = new System.Drawing.Size(262, 22); this.timezoneInconsistencyLOGToolStripMenuItem.Text = "Timezone Inconsistency (LOG)"; this.timezoneInconsistencyLOGToolStripMenuItem.Click += new System.EventHandler(this.timezoneInconsistencyLOGToolStripMenuItem_Click); // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(232, 6); + this.toolStripSeparator4.Size = new System.Drawing.Size(259, 6); // // torrentMatchToolStripMenuItem // this.torrentMatchToolStripMenuItem.Name = "torrentMatchToolStripMenuItem"; - this.torrentMatchToolStripMenuItem.Size = new System.Drawing.Size(235, 22); + this.torrentMatchToolStripMenuItem.Size = new System.Drawing.Size(262, 22); this.torrentMatchToolStripMenuItem.Text = "&Torrent Match"; this.torrentMatchToolStripMenuItem.Click += new System.EventHandler(this.torrentMatchToolStripMenuItem_Click); // // uTorrentToolStripMenuItem // this.uTorrentToolStripMenuItem.Name = "uTorrentToolStripMenuItem"; - this.uTorrentToolStripMenuItem.Size = new System.Drawing.Size(235, 22); + this.uTorrentToolStripMenuItem.Size = new System.Drawing.Size(262, 22); this.uTorrentToolStripMenuItem.Text = "&uTorrent Save To"; this.uTorrentToolStripMenuItem.Click += new System.EventHandler(this.uTorrentToolStripMenuItem_Click); // @@ -573,6 +575,18 @@ public void InitializeComponent() this.checkForNewVersionToolStripMenuItem.Text = "Check For New Version"; this.checkForNewVersionToolStripMenuItem.Click += new System.EventHandler(this.checkForNewVersionToolStripMenuItem_Click); // + // toolStripSeparator9 + // + this.toolStripSeparator9.Name = "toolStripSeparator9"; + this.toolStripSeparator9.Size = new System.Drawing.Size(193, 6); + // + // logToolStripMenuItem + // + this.logToolStripMenuItem.Name = "logToolStripMenuItem"; + this.logToolStripMenuItem.Size = new System.Drawing.Size(196, 22); + this.logToolStripMenuItem.Text = "Log"; + this.logToolStripMenuItem.Click += new System.EventHandler(this.logToolStripMenuItem_Click); + // // tabControl1 // this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -1538,17 +1552,12 @@ public void InitializeComponent() this.btnUpdateAvailable.Visible = false; this.btnUpdateAvailable.Click += new System.EventHandler(this.btnUpdateAvailable_Click); // - // toolStripSeparator9 - // - this.toolStripSeparator9.Name = "toolStripSeparator9"; - this.toolStripSeparator9.Size = new System.Drawing.Size(193, 6); + // episodeFileQualitySummaryLogToolStripMenuItemToolStripMenuItem // - // logToolStripMenuItem - // - this.logToolStripMenuItem.Name = "logToolStripMenuItem"; - this.logToolStripMenuItem.Size = new System.Drawing.Size(196, 22); - this.logToolStripMenuItem.Text = "Log"; - this.logToolStripMenuItem.Click += new System.EventHandler(this.logToolStripMenuItem_Click); + this.episodeFileQualitySummaryLogToolStripMenuItemToolStripMenuItem.Name = "episodeFileQualitySummaryLogToolStripMenuItemToolStripMenuItem"; + this.episodeFileQualitySummaryLogToolStripMenuItemToolStripMenuItem.Size = new System.Drawing.Size(262, 22); + this.episodeFileQualitySummaryLogToolStripMenuItemToolStripMenuItem.Text = "Episode File Quality Summary (Log)"; + this.episodeFileQualitySummaryLogToolStripMenuItemToolStripMenuItem.Click += new System.EventHandler(this.episodeFileQualitySummaryLogToolStripMenuItemToolStripMenuItem_Click); // // UI // @@ -1714,7 +1723,7 @@ public void InitializeComponent() private System.Windows.Forms.Button btnFilter; private System.Windows.Forms.TextBox filterTextBox; private System.Windows.Forms.ToolStripMenuItem visitSupportForumToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem betaToolsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem episodeFileQualitySummaryLogToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem showSummaryToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem checkForNewVersionToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem duplicateFinderLOGToolStripMenuItem; @@ -1734,5 +1743,6 @@ public void InitializeComponent() private ToolStripSeparator toolStripSeparator8; private ToolStripSeparator toolStripSeparator9; private ToolStripMenuItem logToolStripMenuItem; + private ToolStripMenuItem episodeFileQualitySummaryLogToolStripMenuItemToolStripMenuItem; } } diff --git a/TVRename/Forms/UI.cs b/TVRename/Forms/UI.cs index 928f5d66a..654049741 100644 --- a/TVRename/Forms/UI.cs +++ b/TVRename/Forms/UI.cs @@ -308,7 +308,7 @@ private void UI_Load(object sender, EventArgs e) // Send EM_SETMARGINS to prevent text from disappearing underneath the button NativeMethods.SendMessage(filterTextBox.Handle, 0xd3, (IntPtr) 2, (IntPtr) (filterButton.Width << 16)); - betaToolsToolStripMenuItem.Visible = TVSettings.Instance.IncludeBetaUpdates(); + episodeFileQualitySummaryLogToolStripMenuItem.Visible = TVSettings.Instance.IncludeBetaUpdates(); Show(); UI_LocationChanged(null, null); @@ -1848,7 +1848,7 @@ private void DoPrefs(bool scanOptions) toolStripSeparator0.Visible = (TVSettings.Instance.ShowCollections) ? true : false; FillEpGuideHtml(); mAutoFolderMonitor.SettingsChanged(TVSettings.Instance.MonitorFolders); - betaToolsToolStripMenuItem.Visible = TVSettings.Instance.IncludeBetaUpdates(); + episodeFileQualitySummaryLogToolStripMenuItem.Visible = TVSettings.Instance.IncludeBetaUpdates(); ForceRefresh(null); } @@ -2453,6 +2453,8 @@ private List CurrentlySelectedPel() List pel = null; if (currentShow != null && currentShow.SeasonEpisodes.ContainsKey(snum)) pel = currentShow.SeasonEpisodes[snum]; + else if (currentShow?.SeasonEpisodes.First() != null) + pel = currentShow?.SeasonEpisodes.First().Value; else { foreach (ShowItem si in mDoc.Library.GetShowItems()) @@ -2848,10 +2850,9 @@ private ListViewItem LviForItem(Item item) if (item is Action act && act.Error) { lvi.BackColor = Helpers.WarningColor(); - lvi.SubItems.Add(act.ErrorText); // error text } - else - lvi.SubItems.Add(""); + + lvi.SubItems.Add(item.ErrorText); // error text if (!(item is Action)) lvi.Checked = false; @@ -2931,7 +2932,7 @@ private void FillActionList() } else if (action is ActionDownloadImage) downloadCount++; - else if (action is ActionRSS) + else if (action is ActionTDownload) rssCount++; else if (action is ActionWriteMetadata) // base interface that all metadata actions are derived from metaCount++; @@ -3341,7 +3342,7 @@ private void cbActionRSS_Click(object sender, EventArgs e) foreach (ListViewItem lvi in lvAction.Items) { Item i = (Item) lvi.Tag; - if (i is ActionRSS) + if (i is ActionTDownload) lvi.Checked = cs == CheckState.Checked; } @@ -3672,5 +3673,10 @@ private void logToolStripMenuItem_Click(object sender, EventArgs e) LogViewer form = new LogViewer(); form.Show(); } + + private void episodeFileQualitySummaryLogToolStripMenuItemToolStripMenuItem_Click(object sender, EventArgs e) + { + mDoc.LogShowEpisodeSizes(); + } } } diff --git a/TVRename/Forms/UI.resx b/TVRename/Forms/UI.resx index 6d684dc62..c7687e33a 100644 --- a/TVRename/Forms/UI.resx +++ b/TVRename/Forms/UI.resx @@ -141,7 +141,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADk - HQAAAk1TRnQBSQFMAgEBEwEAARgBBAEYAQQBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + HQAAAk1TRnQBSQFMAgEBEwEAASABBAEgAQQBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAAVADAAEBAQABCAYAARQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -286,7 +286,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC0 - HQAAAk1TRnQBSQFMAgEBCwEAATQBBAE0AQQBEgEAAQ0BAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFI + HQAAAk1TRnQBSQFMAgEBCwEAATwBBAE8AQQBEgEAAQ0BAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFI AwABJwMAAQEBAAEYBQAB6AEgGAAD7wMSBjADCQYwAw8DKgMwAxsD0Q8AASEB1gEIASEB1gEIASEB1gEI ASEB1gEIMAAC+AH3AfMB6AHaAfEB0wG2AeEBswGMAdYBnAFxAdIBlAFoAdIBlAFnAdQBmgFvAd8BrQGG AfAB0QGzAfMB5gHVAfcB9gH1RQAD7wM8A58D5gMwA+ADzgNPA9gDtwOPA9EMAAEhAdYBCAEhAdYBCAEh diff --git a/TVRename/Ipc/ActionWriteMetadata.cs b/TVRename/Ipc/ActionWriteMetadata.cs new file mode 100644 index 000000000..43fb0dc78 --- /dev/null +++ b/TVRename/Ipc/ActionWriteMetadata.cs @@ -0,0 +1,42 @@ +// +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// + +using Alphaleonis.Win32.Filesystem; + +namespace TVRename +{ + public abstract class ActionWriteMetadata : ActionDownload + { + protected readonly FileInfo Where; + protected readonly ShowItem SelectedShow; // if for an entire show, rather than specific episode + + protected ActionWriteMetadata(FileInfo where, ShowItem sI) + { + Where = where; + SelectedShow = sI; + } + + public override string Produces => Where.FullName; + + public override string ProgressText => Where.Name; + + public override long SizeOfWork => 10000; + + public override string TargetFolder => Where == null ? null : Where.DirectoryName; + + public override IgnoreItem Ignore => Where == null ? null : new IgnoreItem(Where.FullName); + + public override string ScanListViewGroup => "lvgActionMeta"; + + public override int IconNumber => 7; + + protected override string SeriesName => Episode?.Show?.ShowName ?? SelectedShow.ShowName; + protected override string DestinationFolder => Where.DirectoryName; + protected override string DestinationFile => Where.Name; + } +} diff --git a/TVRename/ItemsAndActions/Action.cs b/TVRename/ItemsAndActions/Action.cs new file mode 100644 index 000000000..96aeaf0c0 --- /dev/null +++ b/TVRename/ItemsAndActions/Action.cs @@ -0,0 +1,45 @@ +// +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// + +namespace TVRename +{ + public abstract class Action : Item // Something we can do + { + public abstract string Name { get; } // Name of this action, e.g. "Copy", "Move", "Download" + + public bool + Done + { + get; + protected set; + } // All work has been completed for this item, and can be removed from to-do list. set to true on completion, even on error. + + public bool Error { get; protected set; } // Error state, after trying to do work? + public abstract string ProgressText { get; } // shortish text to display to user while task is running + + private double percent; + + public double PercentDone // 0.0 to 100.0 + { + get => Done ? 100.0 : percent; + protected set => percent = value; + } + + public abstract long + SizeOfWork + { + get; + } // for file copy/move, number of bytes in file. for simple tasks, 1, or something proportional to how slow it is to copy files around. + + public abstract bool + Go(ref bool pause, + TVRenameStats stats); // action the action. do not return until done. will be run in a dedicated thread. if pause is set to true, stop working until it goes back to false + + public abstract string Produces { get; } //What does this action produce? typically a filename + } +} diff --git a/TVRename/ItemsAndActions/ActionCopyMoveRename.cs b/TVRename/ItemsAndActions/ActionCopyMoveRename.cs index 812712347..dbbe1b37a 100644 --- a/TVRename/ItemsAndActions/ActionCopyMoveRename.cs +++ b/TVRename/ItemsAndActions/ActionCopyMoveRename.cs @@ -35,6 +35,12 @@ public ActionCopyMoveRename(Op operation, FileInfo from, FileInfo to, ProcessedE UndoItemMissing = undoItem; } + public ActionCopyMoveRename(FileInfo fi, FileInfo existingFile, ProcessedEpisode pep): + this(TVSettings.Instance.LeaveOriginals ? ActionCopyMoveRename.Op.copy : ActionCopyMoveRename.Op.move, fi, + existingFile, + pep, TVSettings.Instance.Tidyup, null) + {} + #region Action Members public override string Name => IsMoveRename() ? "Move" : "Copy"; diff --git a/TVRename/ItemsAndActions/ActionDelete.cs b/TVRename/ItemsAndActions/ActionDelete.cs index ac0513d1c..a1c9db04c 100644 --- a/TVRename/ItemsAndActions/ActionDelete.cs +++ b/TVRename/ItemsAndActions/ActionDelete.cs @@ -1,11 +1,13 @@ -using Alphaleonis.Win32.Filesystem; +// +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// namespace TVRename { - using System; - using FileInfo = FileInfo; - using DirectoryInfo = DirectoryInfo; - public abstract class ActionDelete : ActionFileOperation { public override string Name => "Delete"; @@ -16,125 +18,4 @@ public abstract class ActionDelete : ActionFileOperation protected override string DestinationFolder => TargetFolder; protected override string DestinationFile => ProgressText; } - public class ActionDeleteFile : ActionDelete - { - private readonly FileInfo toRemove; - - public ActionDeleteFile(FileInfo remove, ProcessedEpisode ep, TidySettings tidyup) - { - Tidyup = tidyup; - PercentDone = 0; - Episode = ep; - toRemove = remove; - } - - public override string ProgressText => toRemove.Name; - public override string Produces => toRemove.FullName; - public override IgnoreItem Ignore => toRemove == null ? null : new IgnoreItem(toRemove.FullName); - public override string TargetFolder => toRemove?.DirectoryName; - - public override bool Go(ref bool pause, TVRenameStats stats) - { - try - { - if (toRemove.Exists) - { - DeleteOrRecycleFile(toRemove); - if (Tidyup != null && Tidyup.DeleteEmpty) - { - Logger.Info($"Testing {toRemove.Directory.FullName } to see whether it should be tidied up"); - DoTidyup(toRemove.Directory); - } - } - } - catch (Exception e) - { - Error = true; - ErrorText = e.Message; - } - Done = true; - return !Error; - } - - public override bool SameAs(Item o) - { - return (o is ActionDeleteFile cmr) && FileHelper.Same(toRemove , cmr.toRemove); - } - - public override int Compare(Item o) - { - if (!(o is ActionDeleteFile cmr) || toRemove.Directory == null || cmr.toRemove.Directory == null ) - return 0; - - return string.Compare(toRemove.FullName , cmr.toRemove.FullName , StringComparison.Ordinal); - } - - public bool SameSource(ActionDeleteFile o) => FileHelper.Same(toRemove , o.toRemove); - } - - public class ActionDeleteDirectory : ActionDelete - { - private readonly DirectoryInfo toRemove; - - public ActionDeleteDirectory(DirectoryInfo remove, ProcessedEpisode ep, TidySettings tidyup) - { - Tidyup = tidyup; - PercentDone = 0; - Episode = ep; - toRemove = remove; - - } - - public override string ProgressText => toRemove.Name; - public override string Produces => toRemove.FullName; - public override IgnoreItem Ignore => toRemove == null ? null : new IgnoreItem(toRemove.FullName); - public override string TargetFolder => toRemove?.Parent.FullName; - - public override bool Go(ref bool pause, TVRenameStats stats) - { - //if the directory is the root download folder do not delete - if (TVSettings.Instance.MonitorFolders && - TVSettings.Instance.DownloadFolders.Contains(toRemove.FullName)) - { - Error = true; - ErrorText = $@"Not removing {toRemove.FullName} as it is a Search Folder"; - return false; - } - - try - { - if ((toRemove.Exists) ) - { - DeleteOrRecycleFolder(toRemove); - if (Tidyup != null && Tidyup.DeleteEmpty) - { - Logger.Info($"Testing {toRemove.Parent.FullName } to see whether it should be tidied up"); - DoTidyup(toRemove.Parent); - } - } - } - catch (Exception e) - { - Error = true; - ErrorText = e.Message; - } - Done = true; - return !Error; - } - - public override bool SameAs(Item o) - { - return (o is ActionDeleteDirectory cmr) && FileHelper.Same(toRemove, cmr.toRemove); - } - - public override int Compare(Item o) - { - if (!(o is ActionDeleteDirectory cmr) || toRemove.Parent.FullName == null || cmr.toRemove.Parent.FullName == null) - return 0; - - return string.Compare(toRemove.FullName, cmr.toRemove.FullName, StringComparison.Ordinal); - } - - public bool SameSource(ActionDeleteDirectory o) => FileHelper.Same(toRemove, o.toRemove); - } } diff --git a/TVRename/ItemsAndActions/ActionDeleteDirectory.cs b/TVRename/ItemsAndActions/ActionDeleteDirectory.cs new file mode 100644 index 000000000..628d02faf --- /dev/null +++ b/TVRename/ItemsAndActions/ActionDeleteDirectory.cs @@ -0,0 +1,78 @@ +// +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// + +using System; +using Alphaleonis.Win32.Filesystem; + +namespace TVRename +{ + public class ActionDeleteDirectory : ActionDelete + { + private readonly DirectoryInfo toRemove; + + public ActionDeleteDirectory(DirectoryInfo remove, ProcessedEpisode ep, TidySettings tidyup) + { + Tidyup = tidyup; + PercentDone = 0; + Episode = ep; + toRemove = remove; + } + + public override string ProgressText => toRemove.Name; + public override string Produces => toRemove.FullName; + public override IgnoreItem Ignore => toRemove == null ? null : new IgnoreItem(toRemove.FullName); + public override string TargetFolder => toRemove?.Parent.FullName; + + public override bool Go(ref bool pause, TVRenameStats stats) + { + //if the directory is the root download folder do not delete + if (TVSettings.Instance.MonitorFolders && + TVSettings.Instance.DownloadFolders.Contains(toRemove.FullName)) + { + Error = true; + ErrorText = $@"Not removing {toRemove.FullName} as it is a Search Folder"; + return false; + } + + try + { + if (toRemove.Exists) + { + DeleteOrRecycleFolder(toRemove); + if (Tidyup != null && Tidyup.DeleteEmpty) + { + Logger.Info($"Testing {toRemove.Parent.FullName } to see whether it should be tidied up"); + DoTidyup(toRemove.Parent); + } + } + } + catch (Exception e) + { + Error = true; + ErrorText = e.Message; + } + Done = true; + return !Error; + } + + public override bool SameAs(Item o) + { + return (o is ActionDeleteDirectory cmr) && FileHelper.Same(toRemove, cmr.toRemove); + } + + public override int Compare(Item o) + { + if (!(o is ActionDeleteDirectory cmr) || toRemove.Parent.FullName == null || cmr.toRemove.Parent.FullName == null) + return 0; + + return string.Compare(toRemove.FullName, cmr.toRemove.FullName, StringComparison.Ordinal); + } + + public bool SameSource(ActionDeleteDirectory o) => FileHelper.Same(toRemove, o.toRemove); + } +} diff --git a/TVRename/ItemsAndActions/ActionDeleteFile.cs b/TVRename/ItemsAndActions/ActionDeleteFile.cs new file mode 100644 index 000000000..38edaaaf6 --- /dev/null +++ b/TVRename/ItemsAndActions/ActionDeleteFile.cs @@ -0,0 +1,69 @@ +// +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// + +using System; +using Alphaleonis.Win32.Filesystem; + +namespace TVRename +{ + public class ActionDeleteFile : ActionDelete + { + private readonly FileInfo toRemove; + + public ActionDeleteFile(FileInfo remove, ProcessedEpisode ep, TidySettings tidyup) + { + Tidyup = tidyup; + PercentDone = 0; + Episode = ep; + toRemove = remove; + } + + public override string ProgressText => toRemove.Name; + public override string Produces => toRemove.FullName; + public override IgnoreItem Ignore => toRemove == null ? null : new IgnoreItem(toRemove.FullName); + public override string TargetFolder => toRemove?.DirectoryName; + + public override bool Go(ref bool pause, TVRenameStats stats) + { + try + { + if (toRemove.Exists) + { + DeleteOrRecycleFile(toRemove); + if (Tidyup != null && Tidyup.DeleteEmpty) + { + Logger.Info($"Testing {toRemove.Directory.FullName } to see whether it should be tidied up"); + DoTidyup(toRemove.Directory); + } + } + } + catch (Exception e) + { + Error = true; + ErrorText = e.Message; + } + Done = true; + return !Error; + } + + public override bool SameAs(Item o) + { + return (o is ActionDeleteFile cmr) && FileHelper.Same(toRemove , cmr.toRemove); + } + + public override int Compare(Item o) + { + if (!(o is ActionDeleteFile cmr) || toRemove.Directory == null || cmr.toRemove.Directory == null ) + return 0; + + return string.Compare(toRemove.FullName , cmr.toRemove.FullName , StringComparison.Ordinal); + } + + public bool SameSource(ActionDeleteFile o) => FileHelper.Same(toRemove , o.toRemove); + } +} diff --git a/TVRename/ItemsAndActions/ActionDownload.cs b/TVRename/ItemsAndActions/ActionDownload.cs new file mode 100644 index 000000000..e9eeccdb3 --- /dev/null +++ b/TVRename/ItemsAndActions/ActionDownload.cs @@ -0,0 +1,14 @@ +// +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// + +namespace TVRename +{ + public abstract class ActionDownload : Action + { + } +} diff --git a/TVRename/ItemsAndActions/ActionFileMetaData.cs b/TVRename/ItemsAndActions/ActionFileMetaData.cs new file mode 100644 index 000000000..2238aa069 --- /dev/null +++ b/TVRename/ItemsAndActions/ActionFileMetaData.cs @@ -0,0 +1,14 @@ +// +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// + +namespace TVRename +{ + public abstract class ActionFileMetaData : Action + { + } +} diff --git a/TVRename/ItemsAndActions/ActionFileOperation.cs b/TVRename/ItemsAndActions/ActionFileOperation.cs new file mode 100644 index 000000000..01a711861 --- /dev/null +++ b/TVRename/ItemsAndActions/ActionFileOperation.cs @@ -0,0 +1,128 @@ +// +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// + +using System; +using System.Diagnostics; +using System.Linq; +using Alphaleonis.Win32.Filesystem; + +namespace TVRename +{ + public abstract class ActionFileOperation : Action + { + protected TidySettings Tidyup; + protected static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger(); + + protected void DeleteOrRecycleFile(FileInfo file) + { + if (file == null) return; + if (Tidyup.DeleteEmptyIsRecycle) + { + Logger.Info($"Recycling {file.FullName}"); + Microsoft.VisualBasic.FileIO.FileSystem.DeleteFile(file.FullName, + Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDialogs, + Microsoft.VisualBasic.FileIO.RecycleOption.SendToRecycleBin); + } + else + { + Logger.Info($"Deleting {file.FullName}"); + file.Delete(true); + } + } + + protected void DeleteOrRecycleFolder(DirectoryInfo di) + { + if (di == null) return; + if (Tidyup ==null ||Tidyup.DeleteEmptyIsRecycle) + { + Logger.Info($"Recycling {di.FullName}"); + Microsoft.VisualBasic.FileIO.FileSystem.DeleteDirectory(di.FullName, + Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDialogs, + Microsoft.VisualBasic.FileIO.RecycleOption.SendToRecycleBin); + } + else + { + Logger.Info($"Deleting {di.FullName}"); + di.Delete(true, true); + } + } + + protected void DoTidyup(DirectoryInfo di) + { +#if DEBUG + Debug.Assert(Tidyup != null); + Debug.Assert(Tidyup.DeleteEmpty); +#else + if (this.Tidyup == null || !this.Tidyup.DeleteEmpty) + return; +#endif + // See if we should now delete the folder we just moved that file from. + if (di == null) + return; + + //if there are sub-directories then we shouldn't remove this one + DirectoryInfo[] directories = di.GetDirectories(); + foreach (DirectoryInfo subdi in directories) + { + bool okToDelete = Tidyup.EmptyIgnoreWordsArray.Any(word => + subdi.Name.Contains(word, StringComparison.OrdinalIgnoreCase)); + + if (!okToDelete) + return; + } + //we know that each subfolder is OK to delete + + //if the directory is the root download folder do not delete + if (TVSettings.Instance.DownloadFolders.Contains(di.FullName)) + return; + + // Do not delete any monitor folders either + if (TVSettings.Instance.LibraryFolders.Contains(di.FullName)) + return; + + FileInfo[] files = di.GetFiles(); + if (files.Length == 0) + { + // its empty, so just delete it + DeleteOrRecycleFolder(di); + return; + } + + if (Tidyup.EmptyIgnoreExtensions && !Tidyup.EmptyIgnoreWords) + return; // nope + + foreach (FileInfo fi in files) + { + bool okToDelete = Tidyup.EmptyIgnoreExtensions && + Array.FindIndex(Tidyup.EmptyIgnoreExtensionsArray, x => x == fi.Extension) != -1; + + if (okToDelete) + continue; // onto the next file + + // look in the filename + if (Tidyup.EmptyIgnoreWordsArray.Any(word => + fi.Name.Contains(word, StringComparison.OrdinalIgnoreCase))) + okToDelete = true; + + if (!okToDelete) + return; + } + + if (Tidyup.EmptyMaxSizeCheck) + { + // how many MB are we deleting? + long totalBytes = files.Sum(fi => fi.Length); + + if (totalBytes / (1024 * 1024) > Tidyup.EmptyMaxSizeMB) + return; // too much + } + + DeleteOrRecycleFolder(di); + } + } +} diff --git a/TVRename/ItemsAndActions/ActionItem.cs b/TVRename/ItemsAndActions/ActionItem.cs deleted file mode 100644 index 32fddb58f..000000000 --- a/TVRename/ItemsAndActions/ActionItem.cs +++ /dev/null @@ -1,283 +0,0 @@ -// -// Main website for TVRename is http://tvrename.com -// -// Source code available at https://github.com/TV-Rename/tvrename -// -// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md -// - -using System.Collections.Generic; - -namespace TVRename -{ - using System; - using System.Diagnostics; - using System.Linq; - using System.Windows.Forms; - using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; - using DirectoryInfo = Alphaleonis.Win32.Filesystem.DirectoryInfo; - - public abstract class Item // something shown in the list on the Scan tab (not always an Action) - { - public abstract string TargetFolder { get; } // return a list of folders for right-click menu - public abstract string ScanListViewGroup { get; } // which group name for the listview - public abstract int IconNumber { get; } // which icon number to use in "ilIcons" (UI.cs). -1 for none - public abstract IgnoreItem Ignore { get; } // what to add to the ignore list / compare against the ignore list - public ProcessedEpisode Episode { get; protected set; } // associated episode - public abstract int Compare(Item o); // for sorting items in scan list (ActionItemSorter) - public abstract bool SameAs(Item o); // are we the same thing as that other one? - - protected static IgnoreItem GenerateIgnore(string file) - { - return string.IsNullOrEmpty(file) ? null : new IgnoreItem(file); - } - - public ListViewItem ScanListViewItem // to add to Scan ListView - { - get - { - ListViewItem lvi = new ListViewItem {Text = SeriesName}; - - lvi.SubItems.Add(SeasonNumber); - lvi.SubItems.Add(EpisodeNumber); - lvi.SubItems.Add(AirDate); - lvi.SubItems.Add(DestinationFolder); - lvi.SubItems.Add(DestinationFile); - lvi.SubItems.Add(SourceDetails); - - if (InError) - lvi.BackColor = Helpers.WarningColor(); - - lvi.Tag = this; - - return lvi; - } - } - - protected virtual string SeriesName => Episode?.TheSeries?.Name ?? string.Empty; - protected virtual string SeasonNumber => Episode?.AppropriateSeasonNumber.ToString() ?? string.Empty; - protected virtual string EpisodeNumber => Episode?.NumsAsString() ?? string.Empty; - protected virtual string AirDate => Episode?.GetAirDateDT(true).PrettyPrint() ?? string.Empty; - protected abstract string DestinationFolder { get; } - protected abstract string DestinationFile { get; } - protected virtual string SourceDetails => string.Empty; - protected virtual bool InError => false; - } - - public abstract class Action : Item // Something we can do - { - public abstract string Name { get; } // Name of this action, e.g. "Copy", "Move", "Download" - - public bool - Done - { - get; - protected set; - } // All work has been completed for this item, and can be removed from to-do list. set to true on completion, even on error. - - public bool Error { get; protected set; } // Error state, after trying to do work? - public string ErrorText { get; protected set; } // Human-readable error message, for when Error is true - public abstract string ProgressText { get; } // shortish text to display to user while task is running - - private double percent; - - public double PercentDone // 0.0 to 100.0 - { - get => Done ? 100.0 : percent; - protected set => percent = value; - } - - public abstract long - SizeOfWork - { - get; - } // for file copy/move, number of bytes in file. for simple tasks, 1, or something proportional to how slow it is to copy files around. - - public abstract bool - Go(ref bool pause, - TVRenameStats stats); // action the action. do not return until done. will be run in a dedicated thread. if pause is set to true, stop working until it goes back to false - - public abstract string Produces { get; } //What does this action produce? typically a filename - } - - public abstract class ActionDownload : Action - { - } - - public abstract class ActionFileMetaData : Action - { - } - - public abstract class ActionFileOperation : Action - { - protected TidySettings Tidyup; - protected static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger(); - - protected void DeleteOrRecycleFile(FileInfo file) - { - if (file == null) return; - if (Tidyup.DeleteEmptyIsRecycle) - { - Logger.Info($"Recycling {file.FullName}"); - Microsoft.VisualBasic.FileIO.FileSystem.DeleteFile(file.FullName, - Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDialogs, - Microsoft.VisualBasic.FileIO.RecycleOption.SendToRecycleBin); - } - else - { - Logger.Info($"Deleting {file.FullName}"); - file.Delete(true); - } - } - - protected void DeleteOrRecycleFolder(DirectoryInfo di) - { - if (di == null) return; - if (Tidyup.DeleteEmptyIsRecycle) - { - Logger.Info($"Recycling {di.FullName}"); - Microsoft.VisualBasic.FileIO.FileSystem.DeleteDirectory(di.FullName, - Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDialogs, - Microsoft.VisualBasic.FileIO.RecycleOption.SendToRecycleBin); - } - else - { - Logger.Info($"Deleting {di.FullName}"); - di.Delete(true, true); - } - } - - protected void DoTidyup(DirectoryInfo di) - { -#if DEBUG - Debug.Assert(Tidyup != null); - Debug.Assert(Tidyup.DeleteEmpty); -#else - if (this.Tidyup == null || !this.Tidyup.DeleteEmpty) - return; -#endif - // See if we should now delete the folder we just moved that file from. - if (di == null) - return; - - //if there are sub-directories then we shouldn't remove this one - DirectoryInfo[] directories = di.GetDirectories(); - foreach (DirectoryInfo subdi in directories) - { - bool okToDelete = Tidyup.EmptyIgnoreWordsArray.Any(word => - subdi.Name.Contains(word, StringComparison.OrdinalIgnoreCase)); - - if (!okToDelete) - return; - } - //we know that each subfolder is OK to delete - - //if the directory is the root download folder do not delete - if (TVSettings.Instance.DownloadFolders.Contains(di.FullName)) - return; - - // Do not delete any monitor folders either - if (TVSettings.Instance.LibraryFolders.Contains(di.FullName)) - return; - - FileInfo[] files = di.GetFiles(); - if (files.Length == 0) - { - // its empty, so just delete it - DeleteOrRecycleFolder(di); - return; - } - - if (Tidyup.EmptyIgnoreExtensions && !Tidyup.EmptyIgnoreWords) - return; // nope - - foreach (FileInfo fi in files) - { - bool okToDelete = Tidyup.EmptyIgnoreExtensions && - Array.FindIndex(Tidyup.EmptyIgnoreExtensionsArray, x => x == fi.Extension) != -1; - - if (okToDelete) - continue; // onto the next file - - // look in the filename - if (Tidyup.EmptyIgnoreWordsArray.Any(word => - fi.Name.Contains(word, StringComparison.OrdinalIgnoreCase))) - okToDelete = true; - - if (!okToDelete) - return; - } - - if (Tidyup.EmptyMaxSizeCheck) - { - // how many MB are we deleting? - long totalBytes = files.Sum(fi => fi.Length); - - if (totalBytes / (1024 * 1024) > Tidyup.EmptyMaxSizeMB) - return; // too much - } - - DeleteOrRecycleFolder(di); - } - } - - public abstract class ActionWriteMetadata : ActionDownload - { - protected readonly FileInfo Where; - protected readonly ShowItem SelectedShow; // if for an entire show, rather than specific episode - - protected ActionWriteMetadata(FileInfo where, ShowItem sI) - { - Where = where; - SelectedShow = sI; - } - - public override string Produces => Where.FullName; - - public override string ProgressText => Where.Name; - - public override long SizeOfWork => 10000; - - public override string TargetFolder => Where == null ? null : Where.DirectoryName; - - public override IgnoreItem Ignore => Where == null ? null : new IgnoreItem(Where.FullName); - - public override string ScanListViewGroup => "lvgActionMeta"; - - public override int IconNumber => 7; - - protected override string SeriesName => Episode?.Show?.ShowName ?? SelectedShow.ShowName; - protected override string DestinationFolder => Where.DirectoryName; - protected override string DestinationFile => Where.Name; - } - - public class ItemList : List - { - public void Add(ItemList slil) - { - if (slil == null) return; - foreach (Item sli in slil) - { - Add(sli); - } - } - - public IEnumerable Actions( ) => this.OfType(); - } - - public class ActionQueue - { - public readonly List Actions; // The contents of this queue - public readonly int ParallelLimit; // Number of tasks in the queue than can be run at once - public readonly string Name; // Name of this queue - public int ActionPosition; // Position in the queue list of the next item to process - - public ActionQueue(string name, int parallelLimit) - { - Name = name; - ParallelLimit = parallelLimit; - Actions = new List(); - ActionPosition = 0; - } - } -} diff --git a/TVRename/ItemsAndActions/ActionItemSorter.cs b/TVRename/ItemsAndActions/ActionItemSorter.cs index c851afa50..1eba5bf4f 100644 --- a/TVRename/ItemsAndActions/ActionItemSorter.cs +++ b/TVRename/ItemsAndActions/ActionItemSorter.cs @@ -26,7 +26,7 @@ private static int TypeNumber(Item a) return 1; if (a is ActionCopyMoveRename) return 2; - if (a is ActionRSS) + if (a is ActionTDownload) return 3; if (a is ActionDownloadImage) return 4; diff --git a/TVRename/ItemsAndActions/ActionMede8erViewXML.cs b/TVRename/ItemsAndActions/ActionMede8erViewXML.cs index 06494b8c3..e7f7eff64 100644 --- a/TVRename/ItemsAndActions/ActionMede8erViewXML.cs +++ b/TVRename/ItemsAndActions/ActionMede8erViewXML.cs @@ -12,6 +12,7 @@ namespace TVRename using Alphaleonis.Win32.Filesystem; using System.Xml; + // ReSharper disable once InconsistentNaming public class ActionMede8erViewXML : ActionWriteMetadata { private readonly int snum; diff --git a/TVRename/ItemsAndActions/ActionMede8erXML.cs b/TVRename/ItemsAndActions/ActionMede8erXML.cs index d9197c8ea..7b0af5dc6 100644 --- a/TVRename/ItemsAndActions/ActionMede8erXML.cs +++ b/TVRename/ItemsAndActions/ActionMede8erXML.cs @@ -14,6 +14,7 @@ namespace TVRename using System.Xml; using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo; + // ReSharper disable once InconsistentNaming public class ActionMede8erXML : ActionWriteMetadata { public ActionMede8erXML(FileInfo nfo, ProcessedEpisode pe) : base(nfo, null) diff --git a/TVRename/ItemsAndActions/ActionQueue.cs b/TVRename/ItemsAndActions/ActionQueue.cs new file mode 100644 index 000000000..f4e975870 --- /dev/null +++ b/TVRename/ItemsAndActions/ActionQueue.cs @@ -0,0 +1,20 @@ +using System.Collections.Generic; + +namespace TVRename +{ + public class ActionQueue + { + public readonly List Actions; // The contents of this queue + public readonly int ParallelLimit; // Number of tasks in the queue than can be run at once + public readonly string Name; // Name of this queue + public int ActionPosition; // Position in the queue list of the next item to process + + public ActionQueue(string name, int parallelLimit) + { + Name = name; + ParallelLimit = parallelLimit; + Actions = new List(); + ActionPosition = 0; + } + } +} \ No newline at end of file diff --git a/TVRename/ItemsAndActions/ActionRSS.cs b/TVRename/ItemsAndActions/ActionTDownload.cs similarity index 75% rename from TVRename/ItemsAndActions/ActionRSS.cs rename to TVRename/ItemsAndActions/ActionTDownload.cs index 15490bc4a..434e8ad08 100644 --- a/TVRename/ItemsAndActions/ActionRSS.cs +++ b/TVRename/ItemsAndActions/ActionTDownload.cs @@ -1,119 +1,129 @@ -// Main website for TVRename is http://tvrename.com -// -// Source code available at https://github.com/TV-Rename/tvrename -// -// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md -// -namespace TVRename -{ - using System; - using Alphaleonis.Win32.Filesystem; - - // ReSharper disable once InconsistentNaming - public class ActionRSS : ActionDownload - { - // ReSharper disable once InconsistentNaming - public readonly RSSItem RSS; - private readonly string theFileNoExt; - - public ActionRSS(RSSItem rss, string toWhereNoExt, ProcessedEpisode pe) - { - Episode = pe; - RSS = rss; - theFileNoExt = toWhereNoExt; - } - - #region Action Members - - public override string ProgressText => RSS.Title; - public override string Name => "Get Torrent"; - public override long SizeOfWork => 1000000; - public override string Produces => RSS.URL; - - public override bool Go( ref bool pause, TVRenameStats stats) - { - try - { - if (!(TVSettings.Instance.CheckuTorrent || TVSettings.Instance.CheckqBitTorrent)) - { - Error = true; - ErrorText = "No torrent clients enabled to download RSS"; - Done = true; - return false; - } - - if (TVSettings.Instance.CheckuTorrent) - { - byte[] r = new System.Net.WebClient().DownloadData(RSS.URL); - if ((r == null) || (r.Length == 0)) - { - Error = true; - ErrorText = "No data downloaded"; - Done = true; - return false; - } - - string saveTemp = SaveDownloadedData(r, RSS.Title); - uTorrentFinder.StartTorrentDownload(saveTemp, theFileNoExt); - } - - if (TVSettings.Instance.CheckqBitTorrent) - qBitTorrentFinder.StartTorrentDownload(RSS.URL); - - Done = true; - return true; - } - catch (Exception e) - { - ErrorText = e.Message; - Error = true; - Done = true; - return false; - } - } - - private static string SaveDownloadedData(byte[] r,string name) - { - string saveTemp = Path.GetTempPath() + System.IO.Path.DirectorySeparatorChar + TVSettings.Instance.FilenameFriendly(name); - if (new FileInfo(saveTemp).Extension.ToLower() != "torrent") - saveTemp += ".torrent"; - File.WriteAllBytes(saveTemp, r); - return saveTemp; - } - - #endregion - - #region Item Members - - public override bool SameAs(Item o) - { - return (o is ActionRSS rss) && (rss.RSS == RSS); - } - - public override int Compare(Item o) - { - ActionRSS rss = o as ActionRSS; - return rss == null ? 0 : string.Compare(RSS.URL, rss.RSS.URL, StringComparison.Ordinal); - } - - #endregion - - #region Item Members - - public override IgnoreItem Ignore => GenerateIgnore(theFileNoExt); - - protected override string DestinationFolder => TargetFolder; - protected override string DestinationFile => TargetFilename; - protected override string SourceDetails => RSS.Title; - - public override string TargetFolder => string.IsNullOrEmpty(theFileNoExt) ? null : new FileInfo(theFileNoExt).DirectoryName; - - private string TargetFilename => string.IsNullOrEmpty(theFileNoExt) ? null : new FileInfo(theFileNoExt).Name; - - public override string ScanListViewGroup => "lvgActionDownloadRSS"; - - public override int IconNumber => 6; - - #endregion - } -} +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// +namespace TVRename +{ + using System; + using Alphaleonis.Win32.Filesystem; + + // ReSharper disable once InconsistentNaming + public class ActionTDownload : ActionDownload + { + // ReSharper disable once InconsistentNaming + private readonly string theFileNoExt; + public readonly string SourceName; + private readonly string url; + private ProcessedEpisode pe; + + public ActionTDownload(string name,string url, string toWhereNoExt, ProcessedEpisode pe) + { + Episode = pe; + this.SourceName = name; + this.url = url; + theFileNoExt = toWhereNoExt; + } + + public ActionTDownload(RSSItem rss, string theFileNoExt, ProcessedEpisode pe) + { + this.SourceName = rss.Title; + this.url = rss.URL; + this.theFileNoExt = theFileNoExt; + this.pe = pe; + } + + #region Action Members + + public override string ProgressText => SourceName; + public override string Name => "Get Torrent"; + public override long SizeOfWork => 1000000; + public override string Produces => url; + + public override bool Go( ref bool pause, TVRenameStats stats) + { + try + { + if (!(TVSettings.Instance.CheckuTorrent || TVSettings.Instance.CheckqBitTorrent)) + { + Error = true; + ErrorText = "No torrent clients enabled to download RSS"; + Done = true; + return false; + } + + if (TVSettings.Instance.CheckuTorrent) + { + byte[] r = new System.Net.WebClient().DownloadData(url); + if ((r == null) || (r.Length == 0)) + { + Error = true; + ErrorText = "No data downloaded"; + Done = true; + return false; + } + + string saveTemp = SaveDownloadedData(r, SourceName); + uTorrentFinder.StartTorrentDownload(saveTemp, theFileNoExt); + } + + if (TVSettings.Instance.CheckqBitTorrent) + qBitTorrentFinder.StartTorrentDownload(url); + + Done = true; + return true; + } + catch (Exception e) + { + ErrorText = e.Message; + Error = true; + Done = true; + return false; + } + } + + private static string SaveDownloadedData(byte[] r,string name) + { + string saveTemp = Path.GetTempPath() + System.IO.Path.DirectorySeparatorChar + TVSettings.Instance.FilenameFriendly(name); + if (new FileInfo(saveTemp).Extension.ToLower() != "torrent") + saveTemp += ".torrent"; + File.WriteAllBytes(saveTemp, r); + return saveTemp; + } + + #endregion + + #region Item Members + + public override bool SameAs(Item o) + { + return (o is ActionTDownload rss) && (rss.url == url); + } + + public override int Compare(Item o) + { + return !(o is ActionTDownload rss) ? 0 : string.Compare(url, rss.url, StringComparison.Ordinal); + } + + #endregion + + #region Item Members + + public override IgnoreItem Ignore => GenerateIgnore(theFileNoExt); + + protected override string DestinationFolder => TargetFolder; + protected override string DestinationFile => TargetFilename; + protected override string SourceDetails => SourceName; + + public override string TargetFolder => string.IsNullOrEmpty(theFileNoExt) ? null : new FileInfo(theFileNoExt).DirectoryName; + + private string TargetFilename => string.IsNullOrEmpty(theFileNoExt) ? null : new FileInfo(theFileNoExt).Name; + + public override string ScanListViewGroup => "lvgActionDownloadRSS"; + + public override int IconNumber => 6; + + #endregion + } +} diff --git a/TVRename/ItemsAndActions/ActionWriteMetadata.cs b/TVRename/ItemsAndActions/ActionWriteMetadata.cs index ea6557aab..43fb0dc78 100644 --- a/TVRename/ItemsAndActions/ActionWriteMetadata.cs +++ b/TVRename/ItemsAndActions/ActionWriteMetadata.cs @@ -1,7 +1,42 @@ +// +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// + +using Alphaleonis.Win32.Filesystem; + namespace TVRename { - interface ActionWriteMetadata + public abstract class ActionWriteMetadata : ActionDownload { - // empty base interface, just so we can see if an action is one of these or not, for grouping and processing + protected readonly FileInfo Where; + protected readonly ShowItem SelectedShow; // if for an entire show, rather than specific episode + + protected ActionWriteMetadata(FileInfo where, ShowItem sI) + { + Where = where; + SelectedShow = sI; + } + + public override string Produces => Where.FullName; + + public override string ProgressText => Where.Name; + + public override long SizeOfWork => 10000; + + public override string TargetFolder => Where == null ? null : Where.DirectoryName; + + public override IgnoreItem Ignore => Where == null ? null : new IgnoreItem(Where.FullName); + + public override string ScanListViewGroup => "lvgActionMeta"; + + public override int IconNumber => 7; + + protected override string SeriesName => Episode?.Show?.ShowName ?? SelectedShow.ShowName; + protected override string DestinationFolder => Where.DirectoryName; + protected override string DestinationFile => Where.Name; } } diff --git a/TVRename/ItemsAndActions/Item.cs b/TVRename/ItemsAndActions/Item.cs new file mode 100644 index 000000000..dfdd6869d --- /dev/null +++ b/TVRename/ItemsAndActions/Item.cs @@ -0,0 +1,60 @@ +// +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// + +namespace TVRename +{ + using System.Windows.Forms; + + public abstract class Item // something shown in the list on the Scan tab (not always an Action) + { + public abstract string TargetFolder { get; } // return a list of folders for right-click menu + public abstract string ScanListViewGroup { get; } // which group name for the listview + public abstract int IconNumber { get; } // which icon number to use in "ilIcons" (UI.cs). -1 for none + public abstract IgnoreItem Ignore { get; } // what to add to the ignore list / compare against the ignore list + public ProcessedEpisode Episode { get; protected set; } // associated episode + public abstract int Compare(Item o); // for sorting items in scan list (ActionItemSorter) + public abstract bool SameAs(Item o); // are we the same thing as that other one? + + protected static IgnoreItem GenerateIgnore(string file) + { + return string.IsNullOrEmpty(file) ? null : new IgnoreItem(file); + } + + public ListViewItem ScanListViewItem // to add to Scan ListView + { + get + { + ListViewItem lvi = new ListViewItem {Text = SeriesName}; + + lvi.SubItems.Add(SeasonNumber); + lvi.SubItems.Add(EpisodeNumber); + lvi.SubItems.Add(AirDate); + lvi.SubItems.Add(DestinationFolder); + lvi.SubItems.Add(DestinationFile); + lvi.SubItems.Add(SourceDetails); + + if (InError) + lvi.BackColor = Helpers.WarningColor(); + + lvi.Tag = this; + + return lvi; + } + } + + protected virtual string SeriesName => Episode?.TheSeries?.Name ?? string.Empty; + protected virtual string SeasonNumber => Episode?.AppropriateSeasonNumber.ToString() ?? string.Empty; + protected virtual string EpisodeNumber => Episode?.NumsAsString() ?? string.Empty; + protected virtual string AirDate => Episode?.GetAirDateDT(true).PrettyPrint() ?? string.Empty; + protected abstract string DestinationFolder { get; } + protected abstract string DestinationFile { get; } + protected virtual string SourceDetails => string.Empty; + protected virtual bool InError => false; + public string ErrorText { get; protected set; } // Human-readable error message, for when Error is true + } +} diff --git a/TVRename/ItemsAndActions/ItemDownloading.cs b/TVRename/ItemsAndActions/ItemDownloading.cs index d9f60aef1..2bc345333 100644 --- a/TVRename/ItemsAndActions/ItemDownloading.cs +++ b/TVRename/ItemsAndActions/ItemDownloading.cs @@ -13,7 +13,7 @@ namespace TVRename { public class ItemDownloading : Item { - private readonly IDownloadInformation Entry; + private readonly IDownloadInformation entry; public readonly string DesiredLocationNoExt; public override IgnoreItem Ignore => GenerateIgnore(DesiredLocationNoExt); @@ -22,27 +22,27 @@ public class ItemDownloading : Item protected override string DestinationFolder => FileIdentifier; protected override string DestinationFile => Destination; protected override string SourceDetails => Remaining; - private string FileIdentifier => Entry.FileIdentifier; - private string Destination => Entry.Destination; - private string Remaining => Entry.RemainingText; + private string FileIdentifier => entry.FileIdentifier; + private string Destination => entry.Destination; + private string Remaining => entry.RemainingText; public override int IconNumber { get; } public override string TargetFolder => string.IsNullOrEmpty(Destination) ? null : new FileInfo(Destination).DirectoryName; - public ItemDownloading(IDownloadInformation dl, ProcessedEpisode pe, string desiredLocationNoExt, Finder.DownloadApp tApp) + public ItemDownloading(IDownloadInformation dl, ProcessedEpisode pe, string desiredLocationNoExt, DownloadingFinder.DownloadApp tApp) { Episode = pe; DesiredLocationNoExt = desiredLocationNoExt; - Entry = dl; - IconNumber = (tApp == Finder.DownloadApp.uTorrent) ? 2 : - (tApp == Finder.DownloadApp.SABnzbd) ? 8 : - (tApp == Finder.DownloadApp.qBitTorrent) ? 10 : 0; + entry = dl; + IconNumber = (tApp == DownloadingFinder.DownloadApp.uTorrent) ? 2 : + (tApp == DownloadingFinder.DownloadApp.SABnzbd) ? 8 : + (tApp == DownloadingFinder.DownloadApp.qBitTorrent) ? 10 : 0; } #region Item Members public override bool SameAs(Item o) { - return (o is ItemDownloading torrenting) && Entry == torrenting.Entry; + return (o is ItemDownloading torrenting) && entry == torrenting.entry; } public override int Compare(Item o) diff --git a/TVRename/ItemsAndActions/ItemList.cs b/TVRename/ItemsAndActions/ItemList.cs new file mode 100644 index 000000000..18bf55348 --- /dev/null +++ b/TVRename/ItemsAndActions/ItemList.cs @@ -0,0 +1,31 @@ +// +// Main website for TVRename is http://tvrename.com +// +// Source code available at https://github.com/TV-Rename/tvrename +// +// This code is released under GPLv3 https://github.com/TV-Rename/tvrename/blob/master/LICENSE.md +// + +using System.Collections.Generic; +using System.Linq; + +namespace TVRename +{ + public class ItemList : List + { + public void Add(ItemList slil) + { + if (slil == null) return; + foreach (Item sli in slil) + { + Add(sli); + } + } + + public IEnumerable Actions( ) => this.OfType(); + + public IEnumerable MissingItems() => this.OfType(); + + public IEnumerable CopyMoveItems() => this.OfType(); + } +} diff --git a/TVRename/ItemsAndActions/ItemMissing.cs b/TVRename/ItemsAndActions/ItemMissing.cs index 50912d6ca..526dd2269 100644 --- a/TVRename/ItemsAndActions/ItemMissing.cs +++ b/TVRename/ItemsAndActions/ItemMissing.cs @@ -67,5 +67,10 @@ public override int Compare(Item o) public override int IconNumber => 1; #endregion + + public void AddComment(string p0) + { + ErrorText += p0; + } } } diff --git a/TVRename/Settings/CustomEpisodeName.cs b/TVRename/Settings/CustomEpisodeName.cs index 9574745b9..b6dfd1a88 100644 --- a/TVRename/Settings/CustomEpisodeName.cs +++ b/TVRename/Settings/CustomEpisodeName.cs @@ -62,6 +62,8 @@ public static string OldNStyle(int n) "{ShowName}", "{Season}", "{Season:2}", + "{SeasonNumber}", + "{SeasonNumber:2}", "{Episode}", "{Episode2}", "{EpisodeName}", @@ -117,6 +119,8 @@ private string GetTargetEpisodeName(ShowItem show, Episode ep, TimeZone tz, bool { name = name.ReplaceInsensitive("{Season}", ep.DvdSeasonNumber.ToString()); name = name.ReplaceInsensitive("{Season:2}", ep.DvdSeasonNumber.ToString("00")); + name = name.ReplaceInsensitive("{SeasonNumber}", ep.DvdSeasonIndex.ToString()); + name = name.ReplaceInsensitive("{SeasonNumber:2}", ep.DvdSeasonIndex.ToString("00")); name = name.ReplaceInsensitive("{Episode}", ep.DvdEpNum.ToString("00")); name = name.ReplaceInsensitive("{Episode2}", ep.DvdEpNum.ToString("00")); name = Regex.Replace(name, "{AllEpisodes}", ep.DvdEpNum.ToString("00")); @@ -125,6 +129,8 @@ private string GetTargetEpisodeName(ShowItem show, Episode ep, TimeZone tz, bool { name = name.ReplaceInsensitive("{Season}", ep.AiredSeasonNumber.ToString()); name = name.ReplaceInsensitive("{Season:2}", ep.AiredSeasonNumber.ToString("00")); + name = name.ReplaceInsensitive("{SeasonNumber}", ep.AiredSeasonIndex.ToString()); + name = name.ReplaceInsensitive("{SeasonNumber:2}", ep.AiredSeasonIndex.ToString("00")); name = name.ReplaceInsensitive("{Episode}", ep.AiredEpNum.ToString("00")); name = name.ReplaceInsensitive("{Episode2}", ep.AiredEpNum.ToString("00")); name = Regex.Replace(name, "{AllEpisodes}", ep.AiredEpNum.ToString("00")); @@ -188,6 +194,8 @@ public static string NameForNoExt(ProcessedEpisode pe, string styleString, bool name = name.ReplaceInsensitive("{ShowName}", showname); name = name.ReplaceInsensitive("{Season}", pe.AppropriateSeasonNumber.ToString()); name = name.ReplaceInsensitive("{Season:2}", pe.AppropriateSeasonNumber.ToString("00")); + name = name.ReplaceInsensitive("{SeasonNumber}", pe.AppropriateSeasonIndex.ToString()); + name = name.ReplaceInsensitive("{SeasonNumber:2}", pe.AppropriateSeasonIndex.ToString("00")); if (pe.AppropriateSeason.Episodes.Count >= 100) { name = name.ReplaceInsensitive("{Episode}", pe.AppropriateEpNum.ToString("000")); diff --git a/TVRename/Settings/CustomSeasonName.cs b/TVRename/Settings/CustomSeasonName.cs index 93e7888f3..f1ac2758f 100644 --- a/TVRename/Settings/CustomSeasonName.cs +++ b/TVRename/Settings/CustomSeasonName.cs @@ -40,6 +40,11 @@ public CustomSeasonName() "S{Season}", "S{Season:2}", "{ShowName} - Season {Season:2}", + "Season {SeasonNumber:2}", + "Season {SeasonNumber}", + "S{SeasonNumber}", + "S{SeasonNumber:2}", + "{ShowName} - Season {SeasonNumber:2}", "{StartYear}-{EndYear}" }; @@ -48,6 +53,8 @@ public CustomSeasonName() "{ShowName}", "{Season}", "{Season:2}", + "{SeasonNumber}", + "{SeasonNumber:2}", "{StartYear}", "{EndYear}" }; @@ -82,6 +89,8 @@ private static string NameFor(Season s, string styleString, bool urlEncode) name = name.ReplaceInsensitive("{ShowName}", showname); name = name.ReplaceInsensitive("{Season}", s.SeasonNumber.ToString()); name = name.ReplaceInsensitive("{Season:2}", s.SeasonNumber.ToString("00")); + name = name.ReplaceInsensitive("{SeasonNumber}", s.SeasonIndex.ToString()); + name = name.ReplaceInsensitive("{SeasonNumber:2}", s.SeasonIndex.ToString("00")); name = name.ReplaceInsensitive("{StartYear}", s.MinYear().ToString()); name = name.ReplaceInsensitive("{EndYear}", s.MaxYear().ToString()); diff --git a/TVRename/Settings/ProcessedEpisode.cs b/TVRename/Settings/ProcessedEpisode.cs index 2adefd7d2..93f7d6f22 100644 --- a/TVRename/Settings/ProcessedEpisode.cs +++ b/TVRename/Settings/ProcessedEpisode.cs @@ -71,6 +71,7 @@ public ProcessedEpisode(Episode e, ShowItem si, List episodes) } public int AppropriateSeasonNumber => Show.DvdOrder ? DvdSeasonNumber : AiredSeasonNumber; + public int AppropriateSeasonIndex => Show.DvdOrder ? DvdSeasonIndex : AiredSeasonIndex; public Season AppropriateSeason => Show.DvdOrder ? TheDvdSeason : TheAiredSeason; diff --git a/TVRename/Settings/Searchers.cs b/TVRename/Settings/Searchers.cs index 6f63409d2..52cea4386 100644 --- a/TVRename/Settings/Searchers.cs +++ b/TVRename/Settings/Searchers.cs @@ -61,7 +61,7 @@ public Searchers(XmlReader reader) else { // old-style URL, replace "!" with "{ShowName}+{Season}+{Episode}" - url = url.Replace("!", "{ShowName}+{Season}+{Episode}"); + url = url.Replace("!", "{ShowName}+S{Season:2}E{Episode}"); } Add(reader.GetAttribute("Name"), url); reader.ReadElementContentAsString(); diff --git a/TVRename/Settings/Settings.cs b/TVRename/Settings/Settings.cs index 145d8cbc3..661f46f10 100644 --- a/TVRename/Settings/Settings.cs +++ b/TVRename/Settings/Settings.cs @@ -326,13 +326,18 @@ public enum KeepTogetherModes public BetaMode mode = BetaMode.ProductionOnly; public float upgradeDirtyPercent = 20; - public KeepTogetherModes keepTogetherMode = KeepTogetherModes.All; + public float replaceMargin = 10; + public bool ReplaceWithBetterQuality = true; + public KeepTogetherModes keepTogetherMode = KeepTogetherModes.All; public bool BulkAddIgnoreRecycleBin = false; public bool BulkAddCompareNoVideoFolders = false; public string AutoAddMovieTerms = "dvdrip;camrip;screener;dvdscr;r5;bluray"; public string AutoAddIgnoreSuffixes = "1080p;720p"; + public string PriorityReplaceTerms = "PROPER;REPACK;RERIP"; + public string[] PriorityReplaceTermsArray => PriorityReplaceTerms.Split(';'); + public string[] AutoAddMovieTermsArray => AutoAddMovieTerms.Split(';'); public string[] AutoAddIgnoreSuffixesArray => AutoAddIgnoreSuffixes.Split(';'); @@ -372,6 +377,7 @@ internal bool IncludeBetaUpdates() public int SampleFileMaxSizeMB = 50; // sample file must be smaller than this to be ignored public bool SearchLocally = true; public bool SearchRSS = false; + public bool SearchJSON = false; public bool ShowEpisodePictures = true; public bool HideWtWSpoilers = false; public bool HideMyShowsSpoilers = false; @@ -382,6 +388,11 @@ internal bool IncludeBetaUpdates() public int StartupTab = 0; public Searchers TheSearchers = new Searchers(); + public string SearchJSONURL = "https://eztv.ag/api/get-torrents?imdb_id="; + public string SearchJSONRootNode = "torrents"; + public string SearchJSONFilenameToken = "filename"; + public string SearchJSONURLToken = "torrent_url"; + public string[] VideoExtensionsArray => VideoExtensionsString.Split(';'); public bool ForceBulkAddToUseSettingsOnly = false; public bool RetainLanguageSpecificSubtitles = true; @@ -437,6 +448,8 @@ public void load(XmlReader reader) BGDownload = reader.ReadElementContentAsBoolean(); else if (reader.Name == "OfflineMode") OfflineMode = reader.ReadElementContentAsBoolean(); + else if (reader.Name == "ReplaceWithBetterQuality") + ReplaceWithBetterQuality = reader.ReadElementContentAsBoolean(); else if (reader.Name == "ShowCollections") ShowCollections = reader.ReadElementContentAsBoolean(); else if (reader.Name == "DeleteShowFromDisk") @@ -527,6 +540,14 @@ public void load(XmlReader reader) SpecialsFolderName = reader.ReadElementContentAsString(); else if (reader.Name == "SeasonFolderFormat") SeasonFolderFormat = reader.ReadElementContentAsString(); + else if (reader.Name == "SearchJSONURL") + SearchJSONURL = reader.ReadElementContentAsString(); + else if (reader.Name == "SearchJSONRootNode") + SearchJSONRootNode = reader.ReadElementContentAsString(); + else if (reader.Name == "SearchJSONFilenameToken") + SearchJSONFilenameToken = reader.ReadElementContentAsString(); + else if (reader.Name == "SearchJSONURLToken") + SearchJSONURLToken = reader.ReadElementContentAsString(); else if (reader.Name == "SABAPIKey") SABAPIKey = reader.ReadElementContentAsString(); else if (reader.Name == "CheckSABnzbd") @@ -575,6 +596,8 @@ public void load(XmlReader reader) ResumeDatPath = reader.ReadElementContentAsString(); else if (reader.Name == "SearchRSS") SearchRSS = reader.ReadElementContentAsBoolean(); + else if (reader.Name == "SearchJSON") + SearchJSON = reader.ReadElementContentAsBoolean(); else if (reader.Name == "EpImgs") EpTBNs = reader.ReadElementContentAsBoolean(); else if (reader.Name == "NFOs") //support legacy tag @@ -678,6 +701,8 @@ public void load(XmlReader reader) AutoAddMovieTerms = reader.ReadElementContentAsString(); else if (reader.Name == "AutoAddIgnoreSuffixes") AutoAddIgnoreSuffixes = reader.ReadElementContentAsString(); + else if (reader.Name == "PriorityReplaceTerms") + PriorityReplaceTerms = reader.ReadElementContentAsString(); else if (reader.Name == "BetaMode") mode = (BetaMode)reader.ReadElementContentAsInt(); else if (reader.Name == "PercentDirtyUpgrade") @@ -895,11 +920,12 @@ public void WriteXML(XmlWriter writer) XmlHelper.WriteElementToXml(writer,"OfflineMode",OfflineMode); XmlHelper.WriteElementToXml(writer,"ShowCollections", ShowCollections); XmlHelper.WriteElementToXml(writer, "DeleteShowFromDisk", DeleteShowFromDisk); + XmlHelper.WriteElementToXml(writer, "ReplaceWithBetterQuality", ReplaceWithBetterQuality); writer.WriteStartElement("Replacements"); foreach (Replacement R in Replacements) { writer.WriteStartElement("Replace"); - XmlHelper.WriteAttributeToXml(writer,"This",R.This); + XmlHelper.WriteAttributeToXml(writer, "This", R.This); XmlHelper.WriteAttributeToXml(writer, "That", R.That); XmlHelper.WriteAttributeToXml(writer, "CaseInsensitive", R.CaseInsensitive ? "Y" : "N"); writer.WriteEndElement(); //Replace @@ -953,6 +979,7 @@ public void WriteXML(XmlWriter writer) XmlHelper.WriteElementToXml(writer,"uTorrentPath",uTorrentPath); XmlHelper.WriteElementToXml(writer,"ResumeDatPath",ResumeDatPath); XmlHelper.WriteElementToXml(writer,"SearchRSS",SearchRSS); + XmlHelper.WriteElementToXml(writer, "SearchJSON", SearchJSON); XmlHelper.WriteElementToXml(writer,"EpImgs",EpTBNs); XmlHelper.WriteElementToXml(writer,"NFOShows",NFOShows); XmlHelper.WriteElementToXml(writer,"NFOEpisodes", NFOEpisodes); @@ -1011,6 +1038,11 @@ public void WriteXML(XmlWriter writer) XmlHelper.WriteElementToXml(writer, "BulkAddCompareNoVideoFolders", BulkAddCompareNoVideoFolders); XmlHelper.WriteElementToXml(writer, "AutoAddMovieTerms", AutoAddMovieTerms); XmlHelper.WriteElementToXml(writer, "AutoAddIgnoreSuffixes", AutoAddIgnoreSuffixes); + XmlHelper.WriteElementToXml(writer, "SearchJSONURL", SearchJSONURL); + XmlHelper.WriteElementToXml(writer, "SearchJSONRootNode", SearchJSONRootNode); + XmlHelper.WriteElementToXml(writer, "SearchJSONFilenameToken", SearchJSONFilenameToken); + XmlHelper.WriteElementToXml(writer, "SearchJSONURLToken", SearchJSONURLToken); + XmlHelper.WriteElementToXml(writer, "PriorityReplaceTerms", PriorityReplaceTerms); writer.WriteStartElement("FNPRegexs"); foreach (FilenameProcessorRE re in FNPRegexs) @@ -1202,14 +1234,14 @@ public bool UsefulExtension(string sn, bool otherExtensionsToo) { foreach (string s in VideoExtensionsArray) { - if (sn.ToLower() == s.ToLower()) + if (String.Equals(sn, s, StringComparison.CurrentCultureIgnoreCase)) return true; } if (otherExtensionsToo) { foreach (string s in OtherExtensionsArray) { - if (sn.ToLower() == s.ToLower()) + if (String.Equals(sn, s, StringComparison.CurrentCultureIgnoreCase)) return true; } } diff --git a/TVRename/TVRename.csproj b/TVRename/TVRename.csproj index 2c4bd4510..79130ff29 100644 --- a/TVRename/TVRename.csproj +++ b/TVRename/TVRename.csproj @@ -133,6 +133,8 @@ + + @@ -166,6 +168,7 @@ LogViewer.cs + @@ -212,11 +215,21 @@ TVRenameSplash.cs + + + + + + + + + + @@ -342,10 +355,8 @@ - - diff --git a/TVRename/TVRename/ActionEngine.cs b/TVRename/TVRename/ActionEngine.cs index 31578d1b1..89039c5c8 100644 --- a/TVRename/TVRename/ActionEngine.cs +++ b/TVRename/TVRename/ActionEngine.cs @@ -272,7 +272,7 @@ private static ActionQueue[] ActionProcessorMakeQueues(ItemList theList) if (action is ActionWriteMetadata) // base interface that all metadata actions are derived from queues[2].Actions.Add(action); - else if ((action is ActionDownloadImage) || (action is ActionRSS)) + else if ((action is ActionDownloadImage) || (action is ActionTDownload)) queues[3].Actions.Add(action); else if (action is ActionCopyMoveRename rename) queues[rename.QuickOperation() ? 1 : 0].Actions.Add(rename); diff --git a/TVRename/TVRename/LVResults.cs b/TVRename/TVRename/LVResults.cs index d065fd0a0..95a3c2fbd 100644 --- a/TVRename/TVRename/LVResults.cs +++ b/TVRename/TVRename/LVResults.cs @@ -29,7 +29,7 @@ public enum WhichResults public System.Collections.Generic.List Missing; public System.Collections.Generic.List NFO; public System.Collections.Generic.List PyTivoMeta; - public System.Collections.Generic.List RSS; + public System.Collections.Generic.List RSS; public System.Collections.Generic.List Rename; public LVResults(ListView lv, bool isChecked) // if not checked, then selected items @@ -45,7 +45,7 @@ public LVResults(ListView lv, WhichResults which) public void Go(ListView lv, WhichResults which) { Missing = new System.Collections.Generic.List(); - RSS = new System.Collections.Generic.List(); + RSS = new System.Collections.Generic.List(); CopyMove = new System.Collections.Generic.List(); Rename = new System.Collections.Generic.List(); Download = new System.Collections.Generic.List(); @@ -97,7 +97,7 @@ public void Go(ListView lv, WhichResults which) } else if (action is ActionDownloadImage item) Download.Add(item); - else if (action is ActionRSS rss) + else if (action is ActionTDownload rss) RSS.Add(rss); else if (action is ItemMissing missing) Missing.Add(missing); diff --git a/TVRename/TVRename/TVDoc.cs b/TVRename/TVRename/TVDoc.cs index e04b0fb70..fa6a3efae 100644 --- a/TVRename/TVRename/TVDoc.cs +++ b/TVRename/TVRename/TVDoc.cs @@ -81,6 +81,7 @@ public TVDoc(CommandLineArgs args) new uTorrentFinder(this), new qBitTorrentFinder(this), new SABnzbdFinder(this), + new JSONFinder(this), new RSSFinder(this) //RSS Finder Should Be last as it is the finder if all others fail }; @@ -807,17 +808,6 @@ public void WriteUpcoming() } } - private static bool ListHasMissingItems(ItemList l) - { - foreach (Item i in l) - { - if (i is ItemMissing) - return true; - } - - return false; - } - public void Scan(List shows, bool unattended, TVSettings.ScanType st) { try @@ -891,7 +881,7 @@ private void SetupScanUi() bool anyActiveFileFinders = finders.Any(x => x.Active() && x.DisplayType() == Finder.FinderDisplayType.local); bool anyActiveRssFinders = - finders.Any(x => x.Active() && x.DisplayType() == Finder.FinderDisplayType.rss); + finders.Any(x => x.Active() && x.DisplayType() == Finder.FinderDisplayType.search); scanProgDlg = new ScanProgress( TVSettings.Instance.RenameCheck || TVSettings.Instance.MissingCheck, @@ -936,6 +926,49 @@ public void DoAllActions() AllowAutoScan(); } + protected internal void LogShowEpisodeSizes() + { + PreventAutoScan("Find Double Episodes"); + StringBuilder output = new StringBuilder(); + + output.AppendLine(""); + output.AppendLine("##################################################"); + output.AppendLine("File Quailty FINDER - Start"); + output.AppendLine("##################################################"); + Logger.Info(output.ToString()); + + DirFilesCache dfc = new DirFilesCache(); + foreach (ShowItem si in Library.Values) + { + if (si.ShowName != "The Armando Iannucci Shows") continue; + + foreach (KeyValuePair> kvp in si.SeasonEpisodes) + { + foreach (ProcessedEpisode pep in kvp.Value) + { + List files = FindEpOnDisk(dfc, pep); + foreach (FileInfo file in files) + { + int width = file.GetFrameWidth(); + int height = file.GetFrameHeight(); + int length = file.GetFilmLength(); + Logger.Info($"{width,-10} {height,-10} {length,-10} {pep.Show.ShowName,-50} {file.Name}"); + + Logger.Info(file.GetFilmDetails); + } + } + } + } + + output.Clear(); + output.AppendLine("##################################################"); + output.AppendLine("File Quailty FINDER - End"); + output.AppendLine("##################################################"); + + Logger.Info(output.ToString()); + AllowAutoScan(); + } + protected internal List FindDoubleEps() { PreventAutoScan("Find Double Episodes"); @@ -965,7 +998,7 @@ protected internal List FindDoubleEps() //Search through each pair of episodes for the same season foreach (ProcessedEpisode pep in kvp.Value) { - SearchForDuplicates(pep,output,si,kvp.Key,kvp.Value,dfc,returnValue); + SearchForDuplicates(pep, output, si, kvp.Key, kvp.Value, dfc, returnValue); } } } @@ -1332,37 +1365,78 @@ private void FindUnusedFilesInDLDirectory(ICollection showList) if (FileHelper.IgnoreFile(fi)) continue; - List matchingShows = new List(); - - foreach (ShowItem si in showList) - { - if (si.GetSimplifiedPossibleShowNames() + List matchingShows = showList.Where(si => si.GetSimplifiedPossibleShowNames() .Any(name => FileHelper.SimplifyAndCheckFilename(fi.Name, name))) - matchingShows.Add(si); - } + .ToList(); - if (matchingShows.Count > 0) + if (matchingShows.Count <= 0) continue; + + bool fileCanBeDeleted = true; + ProcessedEpisode firstMatchingPep = null; + + foreach (ShowItem si in matchingShows) { - bool fileCanBeRemoved = true; + FindSeasEp(fi, out int seasF, out int epF, out int _, si, out FilenameProcessorRE _); + SeriesInfo s = si.TheSeries(); + Episode ep = s.GetEpisode(seasF, epF, si.DvdOrder); + ProcessedEpisode pep = new ProcessedEpisode(ep, si); + firstMatchingPep = pep; + List encumbants = TVDoc.FindEpOnDisk(dfc, pep, false); - foreach (ShowItem si in matchingShows) + if (encumbants.Count == 0) { - if (FileNeeded(fi, si, dfc)) fileCanBeRemoved = false; + //File is needed as there are no + fileCanBeDeleted = false; } - if (fileCanBeRemoved) + foreach (FileInfo existingFile in encumbants) { - ShowItem si = matchingShows[0]; //Choose the first series - FindSeasEp(fi, out int seasF, out int epF, out int _, si, out FilenameProcessorRE _); - SeriesInfo s = si.TheSeries(); - Episode ep = s.GetEpisode(seasF, epF, si.DvdOrder); - ProcessedEpisode pep = new ProcessedEpisode(ep, si); - Logger.Info( - $"Removing {fi.FullName} as it matches {matchingShows[0].ShowName} and no episodes are needed"); + FileHelper.VideoComparison result = FileHelper.BetterQualityFile(existingFile, fi); + if (result == FileHelper.VideoComparison.SecondFileBetter) + { + fileCanBeDeleted = false; - TheActionList.Add(new ActionDeleteFile(fi, pep, TVSettings.Instance.Tidyup)); + if (TVSettings.Instance.ReplaceWithBetterQuality) + { + if (existingFile.Extension != fi.Extension) + { + TheActionList.Add(new ActionDeleteFile(existingFile, pep, null)); + TheActionList.Add(new ActionCopyMoveRename(fi, existingFile.WithExtension(fi.Extension), pep)); + } + else + { + TheActionList.Add(new ActionCopyMoveRename(fi, existingFile, pep)); + } + + + + Logger.Info( + $"Using {fi.FullName} to replace {existingFile.FullName} as it is better quality"); + } + else + { + Logger.Warn( + $"Keeping {fi.FullName} as it is better quality than some of the current files for that show (Auto Replace with better quality file sis turned off)"); + } + } + else if (result == FileHelper.VideoComparison.CantTell || + result == FileHelper.VideoComparison.Similar) + { + fileCanBeDeleted = false; + Logger.Info( + $"Keeping {fi.FullName} as it might be better quality than {existingFile.FullName}"); + } + //the other cases of the files being the same or the existing file being better are not enough to save the file } } + + if (fileCanBeDeleted) + { + Logger.Info( + $"Removing {fi.FullName} as it matches {string.Join(", ", matchingShows.Select(s => s.ShowName))} and no episodes are needed"); + + TheActionList.Add(new ActionDeleteFile(fi, firstMatchingPep, TVSettings.Instance.Tidyup)); + } } } catch (UnauthorizedAccessException ex) @@ -1374,48 +1448,48 @@ private void FindUnusedFilesInDLDirectory(ICollection showList) { foreach (string subDirPath in Directory.GetDirectories(dirPath, "*", System.IO.SearchOption.AllDirectories)) - { - if (!Directory.Exists(subDirPath)) continue; - - DirectoryInfo di = new DirectoryInfo(subDirPath); + { + if (!Directory.Exists(subDirPath)) continue; - List matchingShows = new List(); + DirectoryInfo di = new DirectoryInfo(subDirPath); - foreach (ShowItem si in showList) - { - if (si.GetSimplifiedPossibleShowNames() - .Any(name => FileHelper.SimplifyAndCheckFilename(di.Name, name))) - matchingShows.Add(si); - } + List matchingShows = new List(); - if (matchingShows.Count > 0) - { - bool dirCanBeRemoved = true; + foreach (ShowItem si in showList) + { + if (si.GetSimplifiedPossibleShowNames() + .Any(name => FileHelper.SimplifyAndCheckFilename(di.Name, name))) + matchingShows.Add(si); + } - foreach (ShowItem si in matchingShows) + if (matchingShows.Count > 0) { - if (FileNeeded(di, si, dfc)) + bool dirCanBeRemoved = true; + + foreach (ShowItem si in matchingShows) { - Logger.Info($"Not removing {di.FullName} as it may be needed for {si.ShowName}"); - dirCanBeRemoved = false; + if (FileNeeded(di, si, dfc)) + { + Logger.Info($"Not removing {di.FullName} as it may be needed for {si.ShowName}"); + dirCanBeRemoved = false; + } } - } - if (dirCanBeRemoved) - { - ShowItem si = matchingShows[0]; //Choose the first series - FindSeasEp(di, out int seasF, out int epF, si, out FilenameProcessorRE _); - SeriesInfo s = si.TheSeries(); - Episode ep = s.GetEpisode(seasF, epF, si.DvdOrder); - ProcessedEpisode pep = new ProcessedEpisode(ep, si); - Logger.Info( - $"Removing {di.FullName} as it matches {matchingShows[0].ShowName} and no episodes are needed"); + if (dirCanBeRemoved) + { + ShowItem si = matchingShows[0]; //Choose the first series + FindSeasEp(di, out int seasF, out int epF, si, out FilenameProcessorRE _); + SeriesInfo s = si.TheSeries(); + Episode ep = s.GetEpisode(seasF, epF, si.DvdOrder); + ProcessedEpisode pep = new ProcessedEpisode(ep, si); + Logger.Info( + $"Removing {di.FullName} as it matches {matchingShows[0].ShowName} and no episodes are needed"); - TheActionList.Add(new ActionDeleteDirectory(di, pep, TVSettings.Instance.Tidyup)); + TheActionList.Add(new ActionDeleteDirectory(di, pep, TVSettings.Instance.Tidyup)); + } } } } - } catch (UnauthorizedAccessException ex) { Logger.Warn(ex, $"Could not access subdirectories of {dirPath}"); @@ -1427,7 +1501,7 @@ private static bool FileNeeded(FileInfo fi, ShowItem si, DirFilesCache dfc) { if (FindSeasEp(fi, out int seasF, out int epF, out _, si, out _)) { - return EpisodeNeeded(si, dfc, seasF, epF,fi); + return EpisodeNeeded(si, dfc, seasF, epF, fi); } //We may need the file @@ -1438,14 +1512,14 @@ private static bool FileNeeded(DirectoryInfo di, ShowItem si, DirFilesCache dfc) { if (FindSeasEp(di, out int seasF, out int epF, si, out _)) { - return EpisodeNeeded(si, dfc, seasF, epF,di); + return EpisodeNeeded(si, dfc, seasF, epF, di); } //We may need the file return true; } - private static bool EpisodeNeeded(ShowItem si, DirFilesCache dfc, int seasF, int epF,FileSystemInfo fi) + private static bool EpisodeNeeded(ShowItem si, DirFilesCache dfc, int seasF, int epF, FileSystemInfo fi) { try { @@ -1760,9 +1834,9 @@ private void RenameAndMissingCheck(ShowItem si, DirFilesCache dfc, bool fullscan //The following section informs the DownloadIdentifers that we already plan to //copy a file inthe appropriate place and they do not need to worry about downloading - //one for that purpse - + //one for that purpose downloadIdentifiers.NotifyComplete(newFile); + localEps[epNum] = newFile; } } @@ -1859,7 +1933,7 @@ private void ScanWorker(object o) { try { - List specific = (List) (o); + List specific = (List)(o); while (!Args.Hide && ((scanProgDlg == null) || (!scanProgDlg.Ready))) Thread.Sleep(10); // wait for thread to create the dialog @@ -1877,77 +1951,61 @@ private void ScanWorker(object o) if (TVSettings.Instance.MissingCheck) { // have a look around for any missing episodes - int activeLocalFinders = 0; - int activeRssFinders = 0; - int activeDownloadingFinders = 0; + (int activeLocalFinders, int activeRssFinders, int activeDownloadingFinders) = GetNumbersOfActiveFinders(); - foreach (Finder f in finders) + foreach (Finder f in finders.Where(f => f.Active())) { - if (!f.Active()) continue; f.ActionList = TheActionList; - - switch (f.DisplayType()) - { - case Finder.FinderDisplayType.local: - activeLocalFinders++; - break; - case Finder.FinderDisplayType.downloading: - activeDownloadingFinders++; - break; - case Finder.FinderDisplayType.rss: - activeRssFinders++; - break; - default: - throw new ArgumentException("Inappropriate displaytype identified " + f.DisplayType()); - } } int currentLocalFinderId = 0; - int currentRssFinderId = 0; + int currentSearchFinderId = 0; int currentDownloadingFinderId = 0; - foreach (Finder f in finders) + foreach (Finder f in finders.Where(f => f.Active())) { if (actionCancel) { return; } - if (f.Active() && ListHasMissingItems(TheActionList)) + if (!TheActionList.MissingItems().Any()) { - int startPos; - int endPos; + continue; + } - switch (f.DisplayType()) - { - case Finder.FinderDisplayType.local: - currentLocalFinderId++; - startPos = 100 * (currentLocalFinderId - 1) / activeLocalFinders; - endPos = 100 * (currentLocalFinderId) / activeLocalFinders; - f.Check(scanProgDlg == null ? noProgress : scanProgDlg.LocalSearchProg, - startPos, endPos); + int startPos; + int endPos; - break; - case Finder.FinderDisplayType.downloading: - currentDownloadingFinderId++; - startPos = 100 * (currentDownloadingFinderId - 1) / activeDownloadingFinders; - endPos = 100 * (currentDownloadingFinderId) / activeDownloadingFinders; - f.Check(scanProgDlg == null ? noProgress : scanProgDlg.DownloadingProg, - startPos, endPos); + switch (f.DisplayType()) + { + case Finder.FinderDisplayType.local: + currentLocalFinderId++; + startPos = 100 * (currentLocalFinderId - 1) / activeLocalFinders; + endPos = 100 * (currentLocalFinderId) / activeLocalFinders; + f.Check(scanProgDlg == null ? noProgress : scanProgDlg.LocalSearchProg, + startPos, endPos); - break; - case Finder.FinderDisplayType.rss: - currentRssFinderId++; - startPos = 100 * (currentRssFinderId - 1) / activeRssFinders; - endPos = 100 * (currentRssFinderId) / activeRssFinders; - f.Check(scanProgDlg == null ? noProgress : scanProgDlg.RSSProg, startPos, - endPos); + break; + case Finder.FinderDisplayType.downloading: + currentDownloadingFinderId++; + startPos = 100 * (currentDownloadingFinderId - 1) / activeDownloadingFinders; + endPos = 100 * (currentDownloadingFinderId) / activeDownloadingFinders; + f.Check(scanProgDlg == null ? noProgress : scanProgDlg.DownloadingProg, + startPos, endPos); - break; - } + break; + case Finder.FinderDisplayType.search: + currentSearchFinderId++; + startPos = 100 * (currentSearchFinderId - 1) / activeRssFinders; + endPos = 100 * (currentSearchFinderId) / activeRssFinders; + f.Check(scanProgDlg == null ? noProgress : scanProgDlg.RSSProg, startPos, + endPos); - RemoveIgnored(); + break; } + + RemoveIgnored(); } } @@ -1968,6 +2026,34 @@ private void ScanWorker(object o) } } + private (int activeLocalFinders, int activeRssFinders, int activeDownloadingFinders) GetNumbersOfActiveFinders() + { + int activeLocalFinders = 0; + int activeRssFinders = 0; + int activeDownloadingFinders = 0; + foreach (Finder f in finders) + { + if (!f.Active()) continue; + + switch (f.DisplayType()) + { + case Finder.FinderDisplayType.local: + activeLocalFinders++; + break; + case Finder.FinderDisplayType.downloading: + activeDownloadingFinders++; + break; + case Finder.FinderDisplayType.search: + activeRssFinders++; + break; + default: + throw new ArgumentException("Inappropriate displaytype identified " + f.DisplayType()); + } + } + + return (activeLocalFinders, activeRssFinders, activeDownloadingFinders); + } + public static bool MatchesSequentialNumber(string filename, ref int seas, ref int ep, ProcessedEpisode pe) { if (pe.OverallNumber == -1) @@ -2044,7 +2130,7 @@ private static bool FindSeasEpDateCheck(FileInfo fi, out int seas, out int ep, o // check for YMD, DMY, and MDY // only check against airdates we expect for the given show SeriesInfo ser = TheTVDB.Instance.GetSeries(si.TvdbCode); - string[] dateFormats = new[] {"yyyy-MM-dd", "dd-MM-yyyy", "MM-dd-yyyy", "yy-MM-dd", "dd-MM-yy", "MM-dd-yy"}; + string[] dateFormats = new[] { "yyyy-MM-dd", "dd-MM-yyyy", "MM-dd-yyyy", "yy-MM-dd", "dd-MM-yy", "MM-dd-yy" }; string filename = fi.Name; // force possible date separators to a dash filename = filename.Replace("/", "-"); @@ -2139,7 +2225,8 @@ private List GetShowsThatHaveDownloads() { if (!Directory.Exists(dirPath)) continue; - try{ + try + { string[] x = Directory.GetFiles(dirPath, "*", System.IO.SearchOption.AllDirectories); Logger.Info($"Processing {x.Length} files for shows that need to be scanned"); @@ -2168,7 +2255,8 @@ private List GetShowsThatHaveDownloads() Logger.Warn(ex, $"Could not access files in {dirPath}"); } - try { + try + { string[] directories = Directory.GetDirectories(dirPath, "*", System.IO.SearchOption.AllDirectories); Logger.Info($"Processing {directories.Length} directories for shows that need to be scanned"); @@ -2205,7 +2293,7 @@ internal void ForceRefresh(List sis) { foreach (ShowItem si in sis) { - TheTVDB.Instance.ForgetShow(si.TvdbCode, true,si.UseCustomLanguage,si.CustomLanguageCode); + TheTVDB.Instance.ForgetShow(si.TvdbCode, true, si.UseCustomLanguage, si.CustomLanguageCode); } } @@ -2264,6 +2352,11 @@ public static bool FindSeasEp(string directory, string filename, out int seas, o return FindSeasEp(directory, filename, out seas, out ep, out maxEp, si, rexps, out FilenameProcessorRE _); } + internal static bool FindSeasEp(string itemName, out int seas, out int ep, out int maxEp, ShowItem show) + { + return FindSeasEp(string.Empty, itemName, out seas, out ep, out maxEp, show, TVSettings.Instance.FNPRegexs, out FilenameProcessorRE _); + } + public static bool FindSeasEp(string directory, string filename, out int seas, out int ep, out int maxEp, ShowItem si, List rexps, out FilenameProcessorRE rex) { @@ -2356,7 +2449,7 @@ public void PreventAutoScan(string v) public void AllowAutoScan() { Logger.Info($"TV Rename free again (busy since {busySince})"); - currentlyBusy =false; + currentlyBusy = false; } public bool AutoScanCanRun() => !currentlyBusy; diff --git a/TVRename/TheTVDB/Episode.cs b/TVRename/TheTVDB/Episode.cs index 6b5259e04..1a38c7690 100644 --- a/TVRename/TheTVDB/Episode.cs +++ b/TVRename/TheTVDB/Episode.cs @@ -420,27 +420,13 @@ public string Name set => mName = System.Web.HttpUtility.HtmlDecode(value); } - public int AiredSeasonNumber - { - get - { - if (TheAiredSeason != null) - return TheAiredSeason.SeasonNumber; + public int AiredSeasonNumber => TheAiredSeason?.SeasonNumber ?? -1; - return -1; - } - } + public int DvdSeasonNumber => TheDvdSeason?.SeasonNumber ?? -1; - public int DvdSeasonNumber - { - get - { - if (TheDvdSeason != null) - return TheDvdSeason.SeasonNumber; + public int AiredSeasonIndex => TheAiredSeason?.SeasonIndex ?? -1; - return -1; - } - } + public int DvdSeasonIndex => TheDvdSeason?.SeasonIndex ?? -1; public bool SameAs(Episode o) { diff --git a/TVRename/TheTVDB/Season.cs b/TVRename/TheTVDB/Season.cs index bde3bd4a1..f866ac707 100644 --- a/TVRename/TheTVDB/Season.cs +++ b/TVRename/TheTVDB/Season.cs @@ -20,17 +20,25 @@ public enum SeasonStatus noEpisodes, } - public Dictionary Episodes; - public int SeasonId; - public int SeasonNumber; - public SeriesInfo TheSeries; + public enum SeasonType + { + dvd, + aired + } + + public readonly Dictionary Episodes; + public readonly int SeasonId; + public readonly int SeasonNumber; + public readonly SeriesInfo TheSeries; + private readonly SeasonType type; - public Season(SeriesInfo theSeries, int number, int seasonid) + public Season(SeriesInfo theSeries, int number, int seasonid, SeasonType t) { TheSeries = theSeries; SeasonNumber = number; SeasonId = seasonid; Episodes = new Dictionary(); + type = t; } // ReSharper disable once InconsistentNaming @@ -122,6 +130,8 @@ internal int MaxYear() private bool HasEpisodes => Episodes != null && Episodes.Count > 0; + public int SeasonIndex => this.TheSeries.GetSeasonIndex(this.SeasonNumber,type); + private bool HasUnairedEpisodes(TimeZone tz) { if (!HasEpisodes) return false; @@ -175,18 +185,11 @@ private bool HasAiredEpisodes(TimeZone tz) } return returnValue; - } - public string GetBannerPath() - { - return TheSeries.GetSeasonBannerPath(SeasonNumber); - } + public string GetBannerPath() => TheSeries.GetSeasonBannerPath(SeasonNumber); - public string GetWideBannerPath() - { - return TheSeries.GetSeasonWideBannerPath(SeasonNumber); - } + public string GetWideBannerPath() => TheSeries.GetSeasonWideBannerPath(SeasonNumber); public void AddUpdateEpisode(Episode newEpisode) { diff --git a/TVRename/TheTVDB/SeriesInfo.cs b/TVRename/TheTVDB/SeriesInfo.cs index d9aa017ec..15a3b91ac 100644 --- a/TVRename/TheTVDB/SeriesInfo.cs +++ b/TVRename/TheTVDB/SeriesInfo.cs @@ -479,7 +479,7 @@ private void LoadJson(JObject bestLanguageR, JObject backupLanguageR) public string GetContentRating() => GetValueAcrossVersions("Rating","rating",""); public string GetSiteRating() => GetValueAcrossVersions("SiteRating", "siteRating", ""); public string GetSiteRatingVotes() => GetValueAcrossVersions("SiteRatingCount", "siteRatingCount", ""); - public string GetImdb() => GetValueAcrossVersions("IMDB_ID", "imdb_id", ""); + public string GetImdb() => GetValueAcrossVersions("IMDB_ID", "imdbId", ""); public string GetYear() => GetValueAcrossVersions("Year", "year", ""); public string GetFirstAired() => GetValueAcrossVersions("FirstAired", "firstAired", ""); public string GetSeriesId() => GetValueAcrossVersions("SeriesID", "seriesId", ""); @@ -565,7 +565,7 @@ public Season GetOrAddAiredSeason(int num, int seasonId) if (AiredSeasons.ContainsKey(num)) return AiredSeasons[num]; - Season s = new Season(this, num, seasonId); + Season s = new Season(this, num, seasonId,Season.SeasonType.aired); AiredSeasons[num] = s; return s; @@ -576,7 +576,7 @@ public Season GetOrAddDvdSeason(int num, int seasonId) if (DvdSeasons.ContainsKey(num)) return DvdSeasons[num]; - Season s = new Season(this, num, seasonId); + Season s = new Season(this, num, seasonId,Season.SeasonType.dvd); DvdSeasons[num] = s; return s; @@ -812,5 +812,25 @@ public void AddActor(Actor actor) { actors.Add(actor); } + + public string GetImdbNumber() + { + return (GetImdb().StartsWith("tt")) ? GetImdb().Substring(2): GetImdb(); + } + + public int GetSeasonIndex(int seasonNumber, Season.SeasonType type) + { + Dictionary appropriateSeasons = type == Season.SeasonType.aired ? AiredSeasons : DvdSeasons; + + List seasonNumbers = new List(); + foreach (KeyValuePair sn in appropriateSeasons) + { + seasonNumbers.Add(sn.Value.SeasonNumber); + } + + seasonNumbers.Sort(); + + return seasonNumbers.IndexOf(seasonNumber); + } } } diff --git a/TVRename/Utility/BT.cs b/TVRename/Utility/BT.cs index d7e183b7f..7e2364f8e 100644 --- a/TVRename/Utility/BT.cs +++ b/TVRename/Utility/BT.cs @@ -676,7 +676,6 @@ private FileInfo FindLocalFileWithHashAt(byte[] findMe, long whereInFile, long p return null; foreach (DirCacheEntry dc in FileCache) - //for (int i = 0; i < FileCache.Cache.Count; i++) { FileInfo fiTemp = dc.TheFile; long flen = dc.Length; diff --git a/TVRename/Utility/Helper/FileHelper.cs b/TVRename/Utility/Helper/FileHelper.cs index 899f97c98..aa27781b7 100644 --- a/TVRename/Utility/Helper/FileHelper.cs +++ b/TVRename/Utility/Helper/FileHelper.cs @@ -1,5 +1,7 @@ using System; +using System.Collections.Generic; using System.Linq; +using System.Text; using System.Text.RegularExpressions; using Alphaleonis.Win32.Filesystem; using Microsoft.WindowsAPICodePack.Shell; @@ -9,6 +11,81 @@ namespace TVRename { public static class FileHelper { + public static int GetFrameWidth(this FileInfo movieFile) + { + using (ShellObject shell = ShellObject.FromParsingName(movieFile.FullName)) + { + IShellProperty prop = shell.Properties.System.Video.FrameWidth; + string returnValue = prop.FormatForDisplay(PropertyDescriptionFormatOptions.None); + return (int.TryParse(returnValue, out int value)) ?value:-1 ; + } + } + + public enum VideoComparison + { + FirstFileBetter, + SecondFileBetter, + Similar, + CantTell, + Same + } + + public static VideoComparison BetterQualityFile(FileInfo encumbantFile, FileInfo newFile) + { + if (!newFile.IsMovieFile()) return VideoComparison.FirstFileBetter; + if (!encumbantFile.IsMovieFile()) return VideoComparison.SecondFileBetter; + + int encumbantLength = encumbantFile.GetFilmLength(); + int newFileLength = newFile.GetFilmLength(); + int encumbantFrameWidth = encumbantFile.GetFrameWidth(); + int newFileFrameWidth = newFile.GetFrameWidth(); + + bool newFileContainsTerm = + TVSettings.Instance.PriorityReplaceTermsArray.Any(term => newFile.Name.Contains(term, StringComparison.OrdinalIgnoreCase)); + + if (encumbantLength == -1) return VideoComparison.CantTell; + if (newFileLength == -1) return VideoComparison.CantTell; + if (encumbantFrameWidth == -1) return VideoComparison.CantTell; + if (newFileFrameWidth == -1) return VideoComparison.CantTell; + + float percentMargin = TVSettings.Instance.replaceMargin; + float marginMultiplier = (percentMargin + 100) / 100; + + bool encumbantFileIsMuchLonger = encumbantLength > newFileLength * marginMultiplier; + bool newFileIsMuchLonger = encumbantLength * marginMultiplier < newFileLength; + + bool newFileIsBetterQuality = encumbantFrameWidth * marginMultiplier < newFileFrameWidth; + bool encumbantFileIsBetterQuality = encumbantFrameWidth > newFileFrameWidth * marginMultiplier; + + if (encumbantFileIsMuchLonger) return VideoComparison.FirstFileBetter; //exting file is longer + if (encumbantFileIsBetterQuality) return VideoComparison.FirstFileBetter; //exting file is better quality + + if (newFileIsBetterQuality) return VideoComparison.SecondFileBetter; + if (newFileIsMuchLonger) return VideoComparison.SecondFileBetter; + + if (newFileContainsTerm) return VideoComparison.SecondFileBetter; + + if (encumbantLength == newFileLength && encumbantFrameWidth == newFileFrameWidth && + newFile.Length == encumbantFile.Length) return VideoComparison.Same; + + return VideoComparison.Similar; + } + + public static int GetFrameHeight(this FileInfo movieFile) + { + using (ShellObject shell = ShellObject.FromParsingName(movieFile.FullName)) + { + IShellProperty prop = shell.Properties.System.Video.FrameHeight; + string returnValue = prop.FormatForDisplay(PropertyDescriptionFormatOptions.None); + return (int.TryParse(returnValue, out int value)) ? value : -1; + } + } + + public static bool IsMovieFile(this FileInfo file) + { + return TVSettings.Instance.FileHasUsefulExtension(file, false, out string _); + } + public static bool IsLanguageSpecificSubtitle(this FileInfo file, out string extension) { foreach (string subExtension in TVSettings.Instance.subtitleExtensionsArray) @@ -27,6 +104,11 @@ public static bool IsLanguageSpecificSubtitle(this FileInfo file, out string ext return false; } + public static FileInfo WithExtension(this FileInfo baseFile, string extension) + { + return new FileInfo(baseFile.RemoveExtension()+extension); + } + public static int GetFilmLength(this FileInfo movieFile) { string duration; @@ -38,6 +120,8 @@ public static int GetFilmLength(this FileInfo movieFile) duration = prop.FormatForDisplay(PropertyDescriptionFormatOptions.None); } + if (string.IsNullOrWhiteSpace(duration)) return -1; + return (3600 * int.Parse(duration.Split(':')[0])) + (60 * int.Parse(duration.Split(':')[1])) + int.Parse(duration.Split(':')[2]); @@ -71,17 +155,20 @@ public static string RemoveExtension(this FileInfo file, bool useFullPath = fals return root.Substring(0, root.Length - file.Extension.Length); } - public static void GetFilmDetails(this FileInfo movieFile) + public static string GetFilmDetails(this FileInfo movieFile) { using (ShellPropertyCollection properties = new ShellPropertyCollection(movieFile.FullName)) { + StringBuilder sb = new StringBuilder(); foreach (IShellProperty prop in properties) { string value = (prop.ValueAsObject == null) ? "" : prop.FormatForDisplay(PropertyDescriptionFormatOptions.None); - Console.WriteLine("{0} = {1}", prop.CanonicalName, value); + sb.AppendLine($"{prop.CanonicalName} = {value}" ); } + + return sb.ToString(); } }