Skip to content

Commit

Permalink
Resharper Updates and packages update
Browse files Browse the repository at this point in the history
  • Loading branch information
SirSparkles committed Dec 3, 2021
1 parent ede1e6c commit b7c2a0b
Show file tree
Hide file tree
Showing 13 changed files with 102 additions and 97 deletions.
2 changes: 1 addition & 1 deletion TVRename/App/AutoFolderMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
6 changes: 3 additions & 3 deletions TVRename/Exporter/Exporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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)
{
Expand All @@ -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()}");
}
}

Expand Down
6 changes: 3 additions & 3 deletions TVRename/Exporter/UpcomingExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<ProcessedEpisode> elist);
Expand Down
2 changes: 1 addition & 1 deletion TVRename/ScanActivity/FindNewShowsInLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion TVRename/Settings/AppState/State.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
2 changes: 1 addition & 1 deletion TVRename/Sources/MediaCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
}
}

Expand Down
10 changes: 4 additions & 6 deletions TVRename/Sources/TMDB/LocalCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
46 changes: 26 additions & 20 deletions TVRename/TVRename.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="16.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\CefSharp.Common.96.0.142\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.96.0.142\build\CefSharp.Common.props')" />
<Import Project="..\packages\cef.redist.x86.96.0.14\build\cef.redist.x86.props" Condition="Exists('..\packages\cef.redist.x86.96.0.14\build\cef.redist.x86.props')" />
<Import Project="..\packages\cef.redist.x64.96.0.14\build\cef.redist.x64.props" Condition="Exists('..\packages\cef.redist.x64.96.0.14\build\cef.redist.x64.props')" />
<Import Project="..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.props" Condition="Exists('..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.props')" />
<Import Project="..\packages\CefSharp.Common.95.7.141\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.95.7.141\build\CefSharp.Common.props')" />
<Import Project="..\packages\cef.redist.x86.95.7.14\build\cef.redist.x86.props" Condition="Exists('..\packages\cef.redist.x86.95.7.14\build\cef.redist.x86.props')" />
<Import Project="..\packages\cef.redist.x64.95.7.14\build\cef.redist.x64.props" Condition="Exists('..\packages\cef.redist.x64.95.7.14\build\cef.redist.x64.props')" />
<PropertyGroup>
<CefSharpAnyCpuSupport>true</CefSharpAnyCpuSupport>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -74,20 +74,24 @@
<Reference Include="AlphaFS, Version=2.2.0.0, Culture=neutral, PublicKeyToken=4d31a58f7d7ad5c9, processorArchitecture=MSIL">
<HintPath>..\packages\AlphaFS.2.2.6\lib\net452\AlphaFS.dll</HintPath>
</Reference>
<Reference Include="CefSharp, Version=95.7.141.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>..\packages\CefSharp.Common.95.7.141\lib\net452\CefSharp.dll</HintPath>
<Reference Include="CefSharp, Version=96.0.142.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
<HintPath>..\packages\CefSharp.Common.96.0.142\lib\net452\CefSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CefSharp.Core, Version=95.7.141.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>..\packages\CefSharp.Common.95.7.141\lib\net452\CefSharp.Core.dll</HintPath>
<Reference Include="CefSharp.Core, Version=96.0.142.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
<HintPath>..\packages\CefSharp.Common.96.0.142\lib\net452\CefSharp.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CefSharp.WinForms, Version=95.7.141.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>..\packages\CefSharp.WinForms.95.7.141\lib\net462\CefSharp.WinForms.dll</HintPath>
<Reference Include="CefSharp.WinForms, Version=96.0.142.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
<HintPath>..\packages\CefSharp.WinForms.96.0.142\lib\net462\CefSharp.WinForms.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CloudFlareUtilities, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\CloudFlareUtilities.1.3.0\lib\netstandard1.1\CloudFlareUtilities.dll</HintPath>
</Reference>
<Reference Include="Humanizer, Version=2.11.0.0, Culture=neutral, PublicKeyToken=979442b78dfc278e, processorArchitecture=MSIL">
<HintPath>..\packages\Humanizer.Core.2.11.10\lib\netstandard2.0\Humanizer.dll</HintPath>
<Reference Include="Humanizer, Version=2.13.0.0, Culture=neutral, PublicKeyToken=979442b78dfc278e">
<HintPath>..\packages\Humanizer.Core.2.13.14\lib\netstandard2.0\Humanizer.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Ical.Net, Version=1.0.0.0, Culture=neutral, PublicKeyToken=65c0446cd019ea53, processorArchitecture=MSIL">
<HintPath>..\packages\Ical.Net.4.2.0\lib\netstandard2.0\Ical.Net.dll</HintPath>
Expand Down Expand Up @@ -143,8 +147,9 @@
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="SharpCompress, Version=0.30.0.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
<HintPath>..\packages\SharpCompress.0.30.0\lib\net461\SharpCompress.dll</HintPath>
<Reference Include="SharpCompress, Version=0.30.1.0, Culture=neutral, PublicKeyToken=afb0a02973931d96">
<HintPath>..\packages\SharpCompress.0.30.1\lib\net461\SharpCompress.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SourceGrid, Version=4.40.4580.29115, Culture=neutral, PublicKeyToken=df6f5e538749e85d, processorArchitecture=MSIL">
<HintPath>..\packages\SourceGrid.4.4.0\lib\net35\SourceGrid.dll</HintPath>
Expand Down Expand Up @@ -277,8 +282,9 @@
<Private>True</Private>
</Reference>
<Reference Include="System.ServiceModel" />
<Reference Include="System.Text.Encoding.CodePages, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encoding.CodePages.5.0.0\lib\net461\System.Text.Encoding.CodePages.dll</HintPath>
<Reference Include="System.Text.Encoding.CodePages, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<HintPath>..\packages\System.Text.Encoding.CodePages.6.0.0\lib\net461\System.Text.Encoding.CodePages.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Text.RegularExpressions, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.RegularExpressions.4.3.1\lib\net463\System.Text.RegularExpressions.dll</HintPath>
Expand Down Expand Up @@ -1255,19 +1261,19 @@
<PropertyGroup>
<ErrorText>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}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\cef.redist.x64.95.7.14\build\cef.redist.x64.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x64.95.7.14\build\cef.redist.x64.props'))" />
<Error Condition="!Exists('..\packages\cef.redist.x86.95.7.14\build\cef.redist.x86.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x86.95.7.14\build\cef.redist.x86.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Common.95.7.141\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.95.7.141\build\CefSharp.Common.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Common.95.7.141\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.95.7.141\build\CefSharp.Common.targets'))" />
<Error Condition="!Exists('..\packages\MediaInfo.Native.21.9.1\build\MediaInfo.Native.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MediaInfo.Native.21.9.1\build\MediaInfo.Native.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.props'))" />
<Error Condition="!Exists('..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.targets'))" />
<Error Condition="!Exists('..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets'))" />
<Error Condition="!Exists('..\packages\cef.redist.x64.96.0.14\build\cef.redist.x64.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x64.96.0.14\build\cef.redist.x64.props'))" />
<Error Condition="!Exists('..\packages\cef.redist.x86.96.0.14\build\cef.redist.x86.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\cef.redist.x86.96.0.14\build\cef.redist.x86.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Common.96.0.142\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.96.0.142\build\CefSharp.Common.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Common.96.0.142\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.96.0.142\build\CefSharp.Common.targets'))" />
</Target>
<Import Project="..\packages\CefSharp.Common.95.7.141\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.95.7.141\build\CefSharp.Common.targets')" />
<Import Project="..\packages\MediaInfo.Native.21.9.1\build\MediaInfo.Native.targets" Condition="Exists('..\packages\MediaInfo.Native.21.9.1\build\MediaInfo.Native.targets')" />
<Import Project="..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.targets" Condition="Exists('..\packages\Microsoft.CodeAnalysis.NetAnalyzers.6.0.0\build\Microsoft.CodeAnalysis.NetAnalyzers.targets')" />
<Import Project="..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
<Import Project="..\packages\CefSharp.Common.96.0.142\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.96.0.142\build\CefSharp.Common.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
2 changes: 1 addition & 1 deletion TVRename/Utility/Helper/JSONHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static class JsonHelper
}
catch (FormatException)
{
Logger.Error("Failed to parse time: {0} ", theTime);
Logger.Error($"Failed to parse time: {theTime}");
}
return DateTime.Parse("20:00");
}
Expand Down
6 changes: 3 additions & 3 deletions TVRename/Utility/VersionUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static class VersionUpdater
}
catch (ArgumentException e)
{
Logger.Error("Failed to establish if there are any new releases as could not parse internal version: " + Helpers.DisplayVersion, e);
Logger.Error(e,"Failed to establish if there are any new releases as could not parse internal version: " + Helpers.DisplayVersion);
return null;
}

Expand Down Expand Up @@ -104,13 +104,13 @@ await HttpHelper.RetryOnExceptionAsync<Exception>

if (latestVersion is null)
{
Logger.Error("Could not find latest version information from GitHub: {0}", gitHubInfo.ToString());
Logger.Error("Could not find latest version information from GitHub: " + gitHubInfo);
return (null, latestBetaVersion);
}

if (latestBetaVersion is null)
{
Logger.Error("Could not find latest beta version information from GitHub: {0}", gitHubInfo.ToString());
Logger.Error("Could not find latest beta version information from GitHub: " + gitHubInfo);
return (latestVersion, null);
}
}
Expand Down
Loading

0 comments on commit b7c2a0b

Please sign in to comment.