From b7c2a0bf3481d673c6a49d2d41a56c77fb5298d2 Mon Sep 17 00:00:00 2001 From: Mark Date: Sat, 4 Dec 2021 00:40:07 +0800 Subject: [PATCH] Resharper Updates and packages update --- TVRename/App/AutoFolderMonitor.cs | 2 +- TVRename/Exporter/Exporter.cs | 6 +- TVRename/Exporter/UpcomingExporter.cs | 6 +- .../ScanActivity/FindNewShowsInLibrary.cs | 2 +- .../ScanShowActivity/CheckAllFoldersExist.cs | 2 +- .../CheckAllMovieFoldersExist.cs | 2 +- TVRename/Settings/AppState/State.cs | 2 +- TVRename/Sources/MediaCache.cs | 2 +- TVRename/Sources/TMDB/LocalCache.cs | 10 +- TVRename/TVRename.csproj | 46 ++++---- TVRename/Utility/Helper/JSONHelper.cs | 2 +- TVRename/Utility/VersionUpdater.cs | 6 +- TVRename/packages.config | 111 +++++++++--------- 13 files changed, 102 insertions(+), 97 deletions(-) diff --git a/TVRename/App/AutoFolderMonitor.cs b/TVRename/App/AutoFolderMonitor.cs index d007a1e4..35fa8461 100644 --- a/TVRename/App/AutoFolderMonitor.cs +++ b/TVRename/App/AutoFolderMonitor.cs @@ -69,7 +69,7 @@ public void Start() watcher.Created += watcher_Changed; watcher.Renamed += watcher_Changed; watchers.Add(watcher); - Logger.Info("Starting FileSystemWatcher for {0}", efi); + Logger.Info("Starting FileSystemWatcher for "+ efi); } catch (Exception ex) { diff --git a/TVRename/Exporter/Exporter.cs b/TVRename/Exporter/Exporter.cs index 9f7c9662..5145d86f 100644 --- a/TVRename/Exporter/Exporter.cs +++ b/TVRename/Exporter/Exporter.cs @@ -20,7 +20,7 @@ private void Run() { if (!Active()) { - LOGGER.Trace("Skipped (Disabled) Output File to: {0}", Location()); + LOGGER.Trace($"Skipped (Disabled) Output File to: {Location()}"); return; } if (Location().IsNullOrWhitespace()) @@ -47,7 +47,7 @@ private void Run() //Create the directory if needed Directory.CreateDirectory(dir); Do(); - LOGGER.Info("Output File to: {0}", Location()); + LOGGER.Info($"Output File to: {Location()}"); } catch (NotSupportedException e) { @@ -67,7 +67,7 @@ private void Run() } catch (Exception e) { - LOGGER.Error(e, "Failed to Output File to: {0}", Location()); + LOGGER.Error(e, $"Failed to Output File to: {Location()}"); } } diff --git a/TVRename/Exporter/UpcomingExporter.cs b/TVRename/Exporter/UpcomingExporter.cs index d812b56e..ff526c5a 100644 --- a/TVRename/Exporter/UpcomingExporter.cs +++ b/TVRename/Exporter/UpcomingExporter.cs @@ -44,11 +44,11 @@ private string Produce() } } - LOGGER.Error("Failed to generate records to put into Export file at: {0}", Location()); + LOGGER.Error($"Failed to generate records to put into Export file at: {Location()}"); } catch (Exception e) { - LOGGER.Error(e, "Failed to produce records to put into Export file at: {0}", Location()); + LOGGER.Error(e, $"Failed to produce records to put into Export file at: {Location()}"); } return string.Empty; @@ -64,7 +64,7 @@ protected override void Do() file.Write(contents); } - LOGGER.Trace("contents of File are: {0}", contents); + LOGGER.Trace($"Contents of File are: {contents}"); } protected abstract bool Generate(Stream str, IEnumerable elist); diff --git a/TVRename/ScanActivity/FindNewShowsInLibrary.cs b/TVRename/ScanActivity/FindNewShowsInLibrary.cs index 0ff0ce09..bd955f67 100644 --- a/TVRename/ScanActivity/FindNewShowsInLibrary.cs +++ b/TVRename/ScanActivity/FindNewShowsInLibrary.cs @@ -43,7 +43,7 @@ protected override void DoCheck([NotNull] SetProgressDelegate prog) { Settings.Shows.Add(si); } - LOGGER.Info("Added new shows called: {0}", addedShows.Select(si => si.ShowName).ToCsv()); + LOGGER.Info($"Added new shows called: {addedShows.Select(si => si.ShowName).ToCsv()}"); MDoc.TvAddedOrEdited(true, Settings.Unattended, Settings.Hidden, Settings.Owner, addedShows); } diff --git a/TVRename/ScanActivity/ScanShowActivity/CheckAllFoldersExist.cs b/TVRename/ScanActivity/ScanShowActivity/CheckAllFoldersExist.cs index 36318251..4f44cc48 100644 --- a/TVRename/ScanActivity/ScanShowActivity/CheckAllFoldersExist.cs +++ b/TVRename/ScanActivity/ScanShowActivity/CheckAllFoldersExist.cs @@ -235,7 +235,7 @@ private static void TryCreateDirectory(string? folder, string sn, string text) { try { - LOGGER.Info("Creating directory as it is missing: {0}", folder); + LOGGER.Info($"Creating directory as it is missing: {folder}"); Directory.CreateDirectory(folder); } catch (Exception ioe) diff --git a/TVRename/ScanActivity/ScanShowActivity/CheckAllMovieFoldersExist.cs b/TVRename/ScanActivity/ScanShowActivity/CheckAllMovieFoldersExist.cs index 2749e270..521720a7 100644 --- a/TVRename/ScanActivity/ScanShowActivity/CheckAllMovieFoldersExist.cs +++ b/TVRename/ScanActivity/ScanShowActivity/CheckAllMovieFoldersExist.cs @@ -190,7 +190,7 @@ private static void TryCreateDirectory(string? folder, string text) { try { - LOGGER.Info("Creating directory as it is missing: {0}", folder); + LOGGER.Info($"Creating directory as it is missing: {folder}"); Directory.CreateDirectory(folder); } catch (Exception ioe) diff --git a/TVRename/Settings/AppState/State.cs b/TVRename/Settings/AppState/State.cs index ee99468e..94c3fb85 100644 --- a/TVRename/Settings/AppState/State.cs +++ b/TVRename/Settings/AppState/State.cs @@ -28,7 +28,7 @@ private static State LoadFromFile(string path) } catch (Exception ex) { - Logger.Warn(ex, "Could not load app state file {0}", path); + Logger.Warn(ex, $"Could not load app state file {path}" ); return new State(); } } diff --git a/TVRename/Sources/MediaCache.cs b/TVRename/Sources/MediaCache.cs index e22a497a..14829963 100644 --- a/TVRename/Sources/MediaCache.cs +++ b/TVRename/Sources/MediaCache.cs @@ -76,7 +76,7 @@ protected void Say(string? s) CurrentDLTask = s; if (s.HasValue()) { - LOGGER.Info("Status on screen updated: {0}", s); + LOGGER.Info($"Status on screen updated: {s}"); } } diff --git a/TVRename/Sources/TMDB/LocalCache.cs b/TVRename/Sources/TMDB/LocalCache.cs index c26108e1..5026430a 100644 --- a/TVRename/Sources/TMDB/LocalCache.cs +++ b/TVRename/Sources/TMDB/LocalCache.cs @@ -97,7 +97,7 @@ public void Setup(FileInfo? loadFrom, [NotNull] FileInfo cache, bool showIssues) //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 latestUpdateTime = new UpdateTimeTracker(); - + LastErrorMessage = string.Empty; if (loadFrom is null) @@ -432,7 +432,7 @@ internal CachedMovieInfo DownloadMovieNow([NotNull] ISeriesSpecifier id, bool sh Dirty = false, Country = downloadedMovie.ProductionCountries.FirstOrDefault()?.Name, }; - + foreach (string? s in downloadedMovie.AlternativeTitles.Titles.Where(t=>t.Iso_3166_1==id.RegionToUse().Abbreviation).Select(title => title.Title)) { m.AddAlias(s); @@ -471,9 +471,7 @@ internal CachedMovieInfo DownloadMovieNow([NotNull] ISeriesSpecifier id, bool sh } catch (HttpRequestException ex) { - LOGGER.Error( - $"Error obtaining TMDB Movie for {id} in {id.TargetLocale.LanguageToUse(TVDoc.ProviderType.TMDB).EnglishName}:", - ex); + LOGGER.Error(ex, $"Error obtaining TMDB Movie for {id} in {id.TargetLocale.LanguageToUse(TVDoc.ProviderType.TMDB).EnglishName}:"); SayNothing(); LastErrorMessage = ex.LoggableDetails(); @@ -584,7 +582,7 @@ internal CachedSeriesInfo DownloadSeriesNow([NotNull] ISeriesSpecifier ss, bool Country = downloadedSeries.OriginCountry.FirstOrDefault(), Dirty = false, }; - + foreach (string? s in downloadedSeries.AlternativeTitles.Results.Select(title => title.Title)) { m.AddAlias(s); diff --git a/TVRename/TVRename.csproj b/TVRename/TVRename.csproj index 3bace767..d06a559d 100644 --- a/TVRename/TVRename.csproj +++ b/TVRename/TVRename.csproj @@ -1,9 +1,9 @@  + + + - - - true Debug @@ -74,20 +74,24 @@ ..\packages\AlphaFS.2.2.6\lib\net452\AlphaFS.dll - - ..\packages\CefSharp.Common.95.7.141\lib\net452\CefSharp.dll + + ..\packages\CefSharp.Common.96.0.142\lib\net452\CefSharp.dll + True - - ..\packages\CefSharp.Common.95.7.141\lib\net452\CefSharp.Core.dll + + ..\packages\CefSharp.Common.96.0.142\lib\net452\CefSharp.Core.dll + True - - ..\packages\CefSharp.WinForms.95.7.141\lib\net462\CefSharp.WinForms.dll + + ..\packages\CefSharp.WinForms.96.0.142\lib\net462\CefSharp.WinForms.dll + True ..\packages\CloudFlareUtilities.1.3.0\lib\netstandard1.1\CloudFlareUtilities.dll - - ..\packages\Humanizer.Core.2.11.10\lib\netstandard2.0\Humanizer.dll + + ..\packages\Humanizer.Core.2.13.14\lib\netstandard2.0\Humanizer.dll + True ..\packages\Ical.Net.4.2.0\lib\netstandard2.0\Ical.Net.dll @@ -143,8 +147,9 @@ - - ..\packages\SharpCompress.0.30.0\lib\net461\SharpCompress.dll + + ..\packages\SharpCompress.0.30.1\lib\net461\SharpCompress.dll + True ..\packages\SourceGrid.4.4.0\lib\net35\SourceGrid.dll @@ -277,8 +282,9 @@ True - - ..\packages\System.Text.Encoding.CodePages.5.0.0\lib\net461\System.Text.Encoding.CodePages.dll + + ..\packages\System.Text.Encoding.CodePages.6.0.0\lib\net461\System.Text.Encoding.CodePages.dll + True ..\packages\System.Text.RegularExpressions.4.3.1\lib\net463\System.Text.RegularExpressions.dll @@ -1255,19 +1261,19 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + + + + - +