Skip to content

Commit

Permalink
Try to fix 4.5.4 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SirSparkles committed Jan 17, 2022
1 parent c5f279f commit f72d859
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 38 deletions.
5 changes: 2 additions & 3 deletions TVRename/Forms/UI.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 20 additions & 29 deletions TVRename/Forms/UI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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<Item>().Any(i => i.Episode?.Show.UseCustomSearchUrl == true && i.Episode.Show.CustomSearchUrl.HasValue());
}

private static bool UseCustom([NotNull] ListView view)
Expand Down Expand Up @@ -1233,7 +1220,7 @@ private void FillMyShows(bool updateSelectedNode)
expanded.Add(TreeNodeToShowItem(n));
}
}

Logger.Info("UI: Updating MyShows");
MyShowTree.BeginUpdate();

MyShowTree.Nodes.Clear();
Expand Down Expand Up @@ -1286,6 +1273,7 @@ private void FillMyMovies(MovieConfiguration? selectedMovie)
{
selectedMovie ??= TreeNodeToMovieItem(movieTree.SelectedNode);

Logger.Info("UI: Updating MyMovies");
movieTree.BeginUpdate();

movieTree.Nodes.Clear();
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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();
}
Expand Down
11 changes: 5 additions & 6 deletions TVRename/Settings/TVSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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"))
Expand Down

0 comments on commit f72d859

Please sign in to comment.