mirror of
https://github.com/Jackett/Jackett
synced 2024-12-29 11:17:22 +00:00
Bug fix
This commit is contained in:
commit
f045a1f350
5 changed files with 30 additions and 21 deletions
|
@ -22,14 +22,17 @@ namespace JackettConsole
|
|||
{
|
||||
switch (args[0].ToLowerInvariant())
|
||||
{
|
||||
case "/i":
|
||||
case "/i": // install
|
||||
Engine.ServiceConfig.Install();
|
||||
return;
|
||||
case "/r":
|
||||
Engine.Server.ReserveUrls();
|
||||
case "/r": // reserve port/url & install
|
||||
Engine.Server.ReserveUrls(doInstall: true);
|
||||
return;
|
||||
case "/u":
|
||||
Engine.Server.ReserveUrls(false);
|
||||
case "/c": // change port
|
||||
Engine.Server.ReserveUrls(doInstall: false);
|
||||
return;
|
||||
case "/u": // uninstall
|
||||
Engine.Server.ReserveUrls(doInstall: false);
|
||||
Engine.ServiceConfig.Uninstall();
|
||||
return;
|
||||
}
|
||||
|
@ -40,9 +43,9 @@ namespace JackettConsole
|
|||
Engine.RunTime.Spin();
|
||||
Engine.Logger.Info("Server thread exit");
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
Engine.Logger.Error(e, "Top level exception");
|
||||
Engine.Logger.Error(e, "Top level exception");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.22823.1
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.31101.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett", "Jackett\Jackett.csproj", "{E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}"
|
||||
EndProject
|
||||
|
@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CurlSharp", "CurlSharp\Curl
|
|||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BE7B0C8A-6144-47CD-821E-B09BA1B7BADE}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
..\Build.bat = ..\Build.bat
|
||||
..\Installer.iss = ..\Installer.iss
|
||||
..\LICENSE = ..\LICENSE
|
||||
..\README.md = ..\README.md
|
||||
EndProjectSection
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace Jackett.Indexers
|
|||
base(name: "RARBG",
|
||||
description: "RARBG",
|
||||
link: new Uri("https://rarbg.com"),
|
||||
rageid: true,
|
||||
rageid: false,
|
||||
manager: i,
|
||||
logger: l)
|
||||
{
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace Jackett.Indexers
|
|||
SearchUrl = SiteLink + "/V3/API/API.php";
|
||||
CommentsUrl = SiteLink + "/t/{0}";
|
||||
DownloadUrl = SiteLink + "/download.php?torrent={0}";
|
||||
|
||||
|
||||
cookies = new CookieContainer();
|
||||
handler = new HttpClientHandler
|
||||
{
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace Jackett.Services
|
|||
string ApplicationFolder();
|
||||
}
|
||||
|
||||
public class ConfigurationService: IConfigurationService
|
||||
public class ConfigurationService : IConfigurationService
|
||||
{
|
||||
private ISerializeService serializeService;
|
||||
private Logger logger;
|
||||
|
@ -61,13 +61,17 @@ namespace Jackett.Services
|
|||
foreach (var file in Directory.GetFiles(oldDir, "*", SearchOption.AllDirectories))
|
||||
{
|
||||
var path = file.Replace(oldDir, "");
|
||||
var destFolder = GetAppDataFolder()+ path;
|
||||
var destFolder = GetAppDataFolder() + path;
|
||||
if (!Directory.Exists(Path.GetDirectoryName(destFolder)))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(destFolder));
|
||||
}
|
||||
File.Move(file, destFolder);
|
||||
if (!File.Exists(destFolder))
|
||||
{
|
||||
File.Move(file, destFolder);
|
||||
}
|
||||
}
|
||||
Directory.Delete(oldDir, true);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -90,7 +94,7 @@ namespace Jackett.Services
|
|||
|
||||
return serializeService.DeSerialise<T>(File.ReadAllText(fullPath));
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
logger.Error(e, "Error reading config file " + fullPath);
|
||||
return default(T);
|
||||
|
@ -147,12 +151,12 @@ namespace Jackett.Services
|
|||
/// <returns></returns>
|
||||
public static string GetAppDataFolderStatic()
|
||||
{
|
||||
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Jackett");
|
||||
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Jackett");
|
||||
}
|
||||
|
||||
public string GetIndexerConfigDir()
|
||||
{
|
||||
return Path.Combine(GetAppDataFolder(), "Indexers");
|
||||
return Path.Combine(GetAppDataFolder(), "Indexers");
|
||||
}
|
||||
|
||||
public string GetConfigFile()
|
||||
|
@ -173,13 +177,13 @@ namespace Jackett.Services
|
|||
if (File.Exists(path))
|
||||
{
|
||||
jsonReply = JObject.Parse(File.ReadAllText(path));
|
||||
// Port = (int)jsonReply["port"];
|
||||
// ListenPublic = (bool)jsonReply["public"];
|
||||
// Port = (int)jsonReply["port"];
|
||||
// ListenPublic = (bool)jsonReply["public"];
|
||||
}
|
||||
else
|
||||
{
|
||||
// jsonReply["port"] = Port;
|
||||
// jsonReply["public"] = ListenPublic;
|
||||
// jsonReply["port"] = Port;
|
||||
// jsonReply["public"] = ListenPublic;
|
||||
}
|
||||
return jsonReply;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue