Пример #1
0
 public Task ApplyConfiguration(JToken configJson)
 {
     var config = new ConfigurationDataUrl(SiteLink);
     config.LoadValuesFromJson(configJson);
     baseUrl = config.GetFormattedHostUrl();
     var configSaveData = new JObject();
     configSaveData["base_url"] = baseUrl;
     SaveConfig(configSaveData);
     IsConfigured = true;
     return Task.FromResult(0);
 }
Пример #2
0
        public async Task ApplyConfiguration(JToken configJson)
        {
            var config = new ConfigurationDataUrl(SiteLink);
            config.LoadValuesFromJson(configJson);

            var formattedUrl = config.GetFormattedHostUrl();
            IEnumerable<ReleaseInfo> releases = await PerformQuery(new TorznabQuery(), formattedUrl);
            if (releases.Count() == 0)
                throw new Exception("Could not find releases from this URL");

            BaseUrl = formattedUrl;
            var configSaveData = new JObject();
            configSaveData["base_url"] = BaseUrl;
            SaveConfig(configSaveData);
            IsConfigured = true;
        }
Пример #3
0
        public async Task ApplyConfiguration(JToken configJson)
        {
            var config = new ConfigurationDataUrl(DefaultUrl);
            config.LoadValuesFromJson(configJson);

            var formattedUrl = config.GetFormattedHostUrl();
            var token = await GetToken(formattedUrl);
            /*var releases = await PerformQuery(new TorznabQuery(), formattedUrl);
            if (releases.Length == 0)
                throw new Exception("Could not find releases from this URL");*/

            BaseUrl = formattedUrl;

            var configSaveData = new JObject();
            configSaveData["base_url"] = BaseUrl;
            SaveConfig(configSaveData);
            IsConfigured = true;
        }
Пример #4
0
 public Task<ConfigurationData> GetConfigurationForSetup()
 {
     var config = new ConfigurationDataUrl(SiteLink);
     return Task.FromResult<ConfigurationData>(config);
 }