Allow Custom Data Folder (#355)

Allow Custom Data Folder
This commit is contained in:
flightlevel 2016-05-28 19:40:55 +10:00
parent ac07cc34cd
commit 0fc3d224ab
4 changed files with 21 additions and 0 deletions

View File

@ -60,6 +60,9 @@ namespace Jackett.Console
[Option('n', "IgnoreSslErrors", HelpText = "[true/false] Linux Libcurl - Ignores invalid SSL certificates")]
public bool? IgnoreSslErrors { get; set; }
[Option('d', "DataFolder", HelpText = "Specify the location of the data folder (Must be admin on Windows) eg. --DataFolder=\"D:\\Your Data\\Jackett\\\"")]
public string DataFolder { get; set; }
[ParserState]
public IParserState LastParserState { get; set; }
}

View File

@ -99,6 +99,13 @@ namespace JackettConsole
Engine.Logger.Info("Curl will ignore SSL certificate errors.");
}
// Choose Data Folder
if (!string.IsNullOrWhiteSpace(options.DataFolder))
{
Startup.CustomDataFolder = options.DataFolder.Replace("\"", string.Empty).Replace("'", string.Empty).Replace(@"\\", @"\");
Engine.Logger.Info("Jackett Data will be stored in: " + Startup.CustomDataFolder);
}
/* ====== Actions ===== */
// Install service

View File

@ -213,6 +213,11 @@ namespace Jackett.Services
/// <returns></returns>
public static string GetAppDataFolderStatic()
{
if (!string.IsNullOrWhiteSpace(Startup.CustomDataFolder))
{
return Startup.CustomDataFolder;
}
if (System.Environment.OSVersion.Platform == PlatformID.Unix)
{
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Jackett");

View File

@ -58,6 +58,12 @@ namespace Jackett
set;
}
public static string CustomDataFolder
{
get;
set;
}
public static string BasePath
{
get;