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