diff --git a/TVRename/Forms/UI.Designer.cs b/TVRename/Forms/UI.Designer.cs index 7c4b6d06..691c08dc 100644 --- a/TVRename/Forms/UI.Designer.cs +++ b/TVRename/Forms/UI.Designer.cs @@ -162,7 +162,7 @@ public void InitializeComponent() this.tabPage3 = new System.Windows.Forms.TabPage(); this.chrTvTrailer = new CefSharp.WinForms.ChromiumWebBrowser(); this.tbAllInOne = new System.Windows.Forms.TabPage(); - this.olvAction = new TVRename.FastObjectListViewFlickerFree(); + this.olvAction = new TVRename.ObjectListViewFlickerFree(); this.olvShowColumn = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.olvSeason = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); this.olvEpisode = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn())); @@ -1393,7 +1393,6 @@ public void InitializeComponent() this.olvAction.UseFilterIndicator = true; this.olvAction.UseFiltering = true; this.olvAction.View = System.Windows.Forms.View.Details; - this.olvAction.VirtualMode = true; this.olvAction.BeforeCreatingGroups += new System.EventHandler(this.olvAction_BeforeCreatingGroups); this.olvAction.CanDrop += new System.EventHandler(this.OlvAction_CanDrop); this.olvAction.Dropped += new System.EventHandler(this.OlvAction_Dropped); @@ -2488,7 +2487,7 @@ public void InitializeComponent() private ToolStripSeparator toolStripSeparator14; private ToolStripButton tsbScanContextMenu; private ToolStripMenuItem tsmiOrphanFiles; - private FastObjectListViewFlickerFree olvAction; + private ObjectListViewFlickerFree olvAction; private ToolStripButton tbActionJackettSearch; private ToolStripButton tsbScheduleJackettSearch; private TabPage tbMyMovies; diff --git a/TVRename/Forms/UI.cs b/TVRename/Forms/UI.cs index 34e0d93f..473e797a 100644 --- a/TVRename/Forms/UI.cs +++ b/TVRename/Forms/UI.cs @@ -164,23 +164,23 @@ public UI(TVDoc doc, [NotNull] TVRenameSplash splash, bool showUi) mDoc.WriteRecent(); UpdateSplashStatus(splash, "Setting Notifications"); ShowHideNotificationIcon(); - UpdateSplashStatus(splash, "Creating Monitors"); - mAutoFolderMonitor = new AutoFolderMonitor(mDoc, this); - - tmrPeriodicScan.Interval = TVSettings.Instance.PeriodicCheckPeriod(); - - UpdateSplashStatus(splash, "Starting Monitor"); if (TVSettings.Instance.MonitorFolders) { + UpdateSplashStatus(splash, "Creating Monitors"); + mAutoFolderMonitor = new AutoFolderMonitor(mDoc, this); + UpdateSplashStatus(splash, "Starting Monitor"); mAutoFolderMonitor.Start(); } + tmrPeriodicScan.Interval = TVSettings.Instance.PeriodicCheckPeriod(); tmrPeriodicScan.Enabled = TVSettings.Instance.RunPeriodicCheck(); SetupObjectListForScanResults(); - UpdateSplashStatus(splash, "Running Auto-scan"); + if (TVSettings.Instance.RunOnStartUp()) { + UpdateSplashStatus(splash, "Running Auto-scan"); + } SetStartUpTab(); } @@ -728,26 +728,13 @@ private MediaConfiguration.MediaType GetSelectedObjectType([NotNull] ObjectListV } private void visitWebsiteToolStripMenuItem_Click(object sender, EventArgs eventArgs) => - Helpers.OpenUrl("http://tvrename.com"); + Helpers.OpenUrl("https://tvrename.com"); private void exitToolStripMenuItem_Click(object sender, EventArgs e) => Close(); private static bool UseCustomObject([NotNull] ObjectListView view) { - foreach (Object o in view.SelectedObjects) - { - if (o is Item i) - { - if (i.Episode != null) - { - if (i.Episode.Show.UseCustomSearchUrl && i.Episode.Show.CustomSearchUrl.HasValue()) - { - return true; - } - } - } - } - return false; + return view.SelectedObjects.OfType().Any(i => i.Episode?.Show.UseCustomSearchUrl == true && i.Episode.Show.CustomSearchUrl.HasValue()); } private static bool UseCustom([NotNull] ListView view) @@ -1233,7 +1220,7 @@ private void FillMyShows(bool updateSelectedNode) expanded.Add(TreeNodeToShowItem(n)); } } - + Logger.Info("UI: Updating MyShows"); MyShowTree.BeginUpdate(); MyShowTree.Nodes.Clear(); @@ -1286,6 +1273,7 @@ private void FillMyMovies(MovieConfiguration? selectedMovie) { selectedMovie ??= TreeNodeToMovieItem(movieTree.SelectedNode); + Logger.Info("UI: Updating MyMovies"); movieTree.BeginUpdate(); movieTree.Nodes.Clear(); @@ -1821,7 +1809,7 @@ private void calCalendar_DateSelected(object sender, DateRangeEventArgs e) if (dt2 != null) { double h = dt2.Value.Subtract(dt).TotalHours; - if (h >= 0 && h < 24.0) + if (h is >= 0 and < 24.0) { lvi.Selected = true; if (first) @@ -3770,13 +3758,16 @@ public void FillActionList() internalCheckChange = true; - byte[] oldState = olvAction.SaveState(); + //byte[] oldState = olvAction.SaveState(); olvAction.BeginUpdate(); - olvAction.SetObjects(mDoc.TheActionList); + Logger.Info("UI: Updating Actions: Adding Data"); + olvAction.SetObjects(mDoc.TheActionList,true); + Logger.Info("UI: Updating Actions: Rebuilding Columns"); olvAction.RebuildColumns(); - olvAction.RestoreState(oldState); + //Logger.Info("UI: Updating Actions: Restoring State"); + //olvAction.RestoreState(oldState); olvAction.EndUpdate(); - + Logger.Info("UI: Updating Actions: Updating CheckBoxes after action list update"); UpdateActionCheckboxes(); internalCheckChange = false; } @@ -4782,7 +4773,7 @@ private void DefaultOlvView() olvAction.ShowGroups = true; olvAction.AlwaysGroupByColumn = null; olvAction.Sort(olvType, SortOrder.Ascending); - olvAction.BuildGroups(olvType, SortOrder.Ascending); //,olvShowColumn,SortOrder.Ascending,olvSeason,SortOrder.Ascending); + olvAction.BuildGroups(olvType, SortOrder.Ascending,olvShowColumn,SortOrder.Ascending,olvSeason,SortOrder.Ascending); olvAction.CustomSorter = delegate { olvAction.ListViewItemSorter = new ListViewActionItemSorter(); }; olvAction.EndUpdate(); } diff --git a/TVRename/Settings/TVSettings.cs b/TVRename/Settings/TVSettings.cs index d0ebd3eb..53ace19a 100644 --- a/TVRename/Settings/TVSettings.cs +++ b/TVRename/Settings/TVSettings.cs @@ -345,7 +345,7 @@ private static string[] Convert(string? propertyString) public MovieConfiguration.MovieFolderFormat DefMovieFolderFormat = MovieConfiguration.MovieFolderFormat.singleDirectorySingleFile; - + public bool AutomateAutoAddWhenOneMovieFound = true; public bool AutomateAutoAddWhenOneShowFound = true; @@ -354,7 +354,7 @@ private static string[] Convert(string? propertyString) : StringComparison.CurrentCultureIgnoreCase; public bool FileNameCaseSensitiveMatch = false; - public bool CopySubsFolders = true; + public bool CopySubsFolders = true; public bool DeleteMovieFromDisk = false; @@ -440,8 +440,8 @@ private static string[] Convert(string? propertyString) public bool DefMovieDoMissingCheck = true; public bool DefMovieUseutomaticFolders = true; public bool DefMovieUseDefaultLocation = true; - public bool DefMovieCheckFutureDatedMovies = false; - public bool DefMovieCheckNoDatedMovies = false; + public bool DefMovieCheckFutureDatedMovies = false; + public bool DefMovieCheckNoDatedMovies = false; public bool SuppressUpdateAvailablePopup = false; public UpdateCheckMode UpdateCheckType = UpdateCheckMode.Everytime; @@ -797,7 +797,7 @@ private void WriteFilters([NotNull] XmlWriter writer) writer.WriteInfo("ShowRatingFilter", "ShowRatingInclude", Filter.ShowRatingInclude); writer.WriteInfo("IncludeBlankFields", "IncludeBlankFields", Filter.IncludeBlankFields); - + foreach (string genre in Filter.Genres) { writer.WriteInfo("GenreFilter", "Genre", genre); @@ -1678,7 +1678,6 @@ private void UpdateFiters([NotNull] XElement xmlSettings) IncludeBlankFields = (bool?)xmlSettings.Descendants("ShowFilters").Descendants("IncludeBlankFields").Attributes("IncludeBlankFields") .FirstOrDefault() ?? true, - }; foreach (XAttribute rep in xmlSettings.Descendants("ShowFilters").Descendants("GenreFilter").Attributes("Genre"))