core: fix .net core 5.0 warnings. resolves #10433 (#10485)

This commit is contained in:
Diego Heras
2020-12-12 21:38:33 +01:00
committed by GitHub
parent eaa4126da5
commit 13baa27656
11 changed files with 29 additions and 52 deletions

View File

@@ -128,7 +128,7 @@ namespace Jackett.Updater
private void ProcessUpdate(UpdaterConsoleOptions options)
{
var updateLocation = GetUpdateLocation();
var updateLocation = EnvironmentUtil.JackettInstallationPath();
if (!(updateLocation.EndsWith("\\") || updateLocation.EndsWith("/")))
updateLocation += Path.DirectorySeparatorChar;
@@ -608,15 +608,6 @@ namespace Jackett.Updater
return success;
}
private string GetUpdateLocation()
{
// Use EscapedCodeBase to avoid Uri reserved characters from causing bugs
// https://stackoverflow.com/questions/896572
var location = new Uri(Assembly.GetEntryAssembly().GetName().EscapedCodeBase);
// Use LocalPath instead of AbsolutePath to avoid needing to unescape Uri format.
return new FileInfo(location.LocalPath).DirectoryName;
}
private string GetJackettConsolePath(string directoryPath)
{
var variants = new Variants();