2020-02-09 02:35:16 +00:00
|
|
|
using System.Collections.Generic;
|
2018-04-06 14:47:59 +00:00
|
|
|
using System.Runtime.Serialization;
|
2017-11-06 10:51:26 +00:00
|
|
|
using Jackett.Common.Models.Config;
|
2017-08-08 15:02:16 +00:00
|
|
|
|
2018-03-10 08:05:56 +00:00
|
|
|
namespace Jackett.Common.Models.DTO
|
2017-08-08 15:02:16 +00:00
|
|
|
{
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataContract]
|
2017-08-08 15:02:16 +00:00
|
|
|
public class ServerConfig
|
|
|
|
{
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2017-08-08 15:02:16 +00:00
|
|
|
public IEnumerable<string> notices { get; set; }
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2017-08-08 15:02:16 +00:00
|
|
|
public int port { get; set; }
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2017-08-08 15:02:16 +00:00
|
|
|
public bool external { get; set; }
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2017-08-08 15:02:16 +00:00
|
|
|
public string api_key { get; set; }
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2017-08-08 15:02:16 +00:00
|
|
|
public string blackholedir { get; set; }
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2017-08-08 15:02:16 +00:00
|
|
|
public bool updatedisabled { get; set; }
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2017-08-08 15:02:16 +00:00
|
|
|
public bool prerelease { get; set; }
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2017-08-08 15:02:16 +00:00
|
|
|
public string password { get; set; }
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2017-08-08 15:02:16 +00:00
|
|
|
public bool logging { get; set; }
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2017-08-08 15:02:16 +00:00
|
|
|
public string basepathoverride { get; set; }
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2017-08-08 15:02:16 +00:00
|
|
|
public string omdbkey { get; set; }
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2018-07-09 10:37:24 +00:00
|
|
|
public string omdburl { get; set; }
|
|
|
|
[DataMember]
|
2017-08-08 15:02:16 +00:00
|
|
|
public string app_version { get; set; }
|
2019-04-27 10:59:33 +00:00
|
|
|
[DataMember]
|
|
|
|
public bool can_run_netcore { get; set; }
|
2017-08-08 15:02:16 +00:00
|
|
|
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2017-11-06 10:51:26 +00:00
|
|
|
public ProxyType proxy_type { get; set; }
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2017-10-31 09:45:30 +00:00
|
|
|
public string proxy_url { get; set; }
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2017-10-31 09:45:30 +00:00
|
|
|
public int? proxy_port { get; set; }
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2017-10-31 09:45:30 +00:00
|
|
|
public string proxy_username { get; set; }
|
2018-04-06 14:47:59 +00:00
|
|
|
[DataMember]
|
2017-10-31 09:45:30 +00:00
|
|
|
public string proxy_password { get; set; }
|
|
|
|
|
2017-08-08 15:02:16 +00:00
|
|
|
public ServerConfig()
|
|
|
|
{
|
|
|
|
notices = new string[0];
|
|
|
|
}
|
|
|
|
|
2019-04-27 10:59:33 +00:00
|
|
|
public ServerConfig(IEnumerable<string> notices, Models.Config.ServerConfig config, string version, bool canRunNetCore)
|
2017-08-08 15:02:16 +00:00
|
|
|
{
|
|
|
|
this.notices = notices;
|
|
|
|
port = config.Port;
|
|
|
|
external = config.AllowExternal;
|
|
|
|
api_key = config.APIKey;
|
|
|
|
blackholedir = config.BlackholeDir;
|
|
|
|
updatedisabled = config.UpdateDisabled;
|
|
|
|
prerelease = config.UpdatePrerelease;
|
|
|
|
password = string.IsNullOrEmpty(config.AdminPassword) ? string.Empty : config.AdminPassword.Substring(0, 10);
|
2017-11-13 08:38:38 +00:00
|
|
|
logging = config.RuntimeSettings.TracingEnabled;
|
2017-08-08 15:02:16 +00:00
|
|
|
basepathoverride = config.BasePathOverride;
|
|
|
|
omdbkey = config.OmdbApiKey;
|
2018-07-09 10:37:24 +00:00
|
|
|
omdburl = config.OmdbApiUrl;
|
2017-08-08 15:02:16 +00:00
|
|
|
app_version = version;
|
2019-04-27 10:59:33 +00:00
|
|
|
can_run_netcore = canRunNetCore;
|
2017-10-31 09:45:30 +00:00
|
|
|
|
2017-11-06 10:51:26 +00:00
|
|
|
proxy_type = config.ProxyType;
|
2017-10-31 09:45:30 +00:00
|
|
|
proxy_url = config.ProxyUrl;
|
|
|
|
proxy_port = config.ProxyPort;
|
|
|
|
proxy_username = config.ProxyUsername;
|
|
|
|
proxy_password = config.ProxyPassword;
|
2017-08-08 15:02:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|