コード例 #1
0
        public string GetVersion(DelugeSettings settings)
        {
            try
            {
                var response = ProcessRequest <string>(settings, "daemon.info");

                return(response);
            }
            catch (DownloadClientException ex)
            {
                if (ex.Message.Contains("Unknown method"))
                {
                    // Deluge v2 beta replaced 'daemon.info' with 'daemon.get_version'.
                    // It may return or become official, for now we just retry with the get_version api.
                    var response = ProcessRequest <string>(settings, "daemon.get_version");

                    return(response);
                }

                throw;
            }
        }
コード例 #2
0
ファイル: DelugeProxy.cs プロジェクト: zamil2200/Sonarr
        public Dictionary <string, object> GetConfig(DelugeSettings settings)
        {
            var response = ProcessRequest <Dictionary <string, object> >(settings, "core.get_config");

            return(response);
        }
コード例 #3
0
ファイル: DelugeProxy.cs プロジェクト: zamil2200/Sonarr
        public string GetVersion(DelugeSettings settings)
        {
            var response = ProcessRequest <string>(settings, "daemon.info");

            return(response);
        }
コード例 #4
0
ファイル: DelugeProxy.cs プロジェクト: zamil2200/Sonarr
 public void SetLabel(string hash, string label, DelugeSettings settings)
 {
     ProcessRequest <object>(settings, "label.set_torrent", hash, label);
 }
コード例 #5
0
ファイル: DelugeProxy.cs プロジェクト: zamil2200/Sonarr
 public void AddLabel(string label, DelugeSettings settings)
 {
     ProcessRequest <object>(settings, "label.add", label);
 }
コード例 #6
0
ファイル: DelugeProxy.cs プロジェクト: zamil2200/Sonarr
        public void SetTorrentSeedingConfiguration(string hash, TorrentSeedConfiguration seedConfiguration, DelugeSettings settings)
        {
            if (seedConfiguration.Ratio != null)
            {
                var ratioArguments = new Dictionary <string, object>();
                ratioArguments.Add("stop_ratio", seedConfiguration.Ratio.Value);

                ProcessRequest <object>(settings, "core.set_torrent_options", new string[] { hash }, ratioArguments);
            }
        }
コード例 #7
0
ファイル: DelugeProxy.cs プロジェクト: zamil2200/Sonarr
        public string[] GetAvailableLabels(DelugeSettings settings)
        {
            var response = ProcessRequest <string[]>(settings, "label.get_labels");

            return(response);
        }
コード例 #8
0
ファイル: DelugeProxy.cs プロジェクト: zamil2200/Sonarr
        public string[] GetEnabledPlugins(DelugeSettings settings)
        {
            var response = ProcessRequest <string[]>(settings, "core.get_enabled_plugins");

            return(response);
        }
コード例 #9
0
ファイル: DelugeProxy.cs プロジェクト: zamil2200/Sonarr
        public string[] GetAvailablePlugins(DelugeSettings settings)
        {
            var response = ProcessRequest <string[]>(settings, "core.get_available_plugins");

            return(response);
        }
コード例 #10
0
ファイル: DelugeProxy.cs プロジェクト: zamil2200/Sonarr
 public void MoveTorrentToTopInQueue(string hash, DelugeSettings settings)
 {
     ProcessRequest <object>(settings, "core.queue_top", (object)new string[] { hash });
 }
コード例 #11
0
ファイル: DelugeProxy.cs プロジェクト: zamil2200/Sonarr
        public bool RemoveTorrent(string hash, bool removeData, DelugeSettings settings)
        {
            var response = ProcessRequest <bool>(settings, "core.remove_torrent", hash, removeData);

            return(response);
        }
コード例 #12
0
        public string AddTorrentFromFile(string filename, byte[] fileContent, DelugeSettings settings)
        {
            var response = ProcessRequest <string>(settings, "core.add_torrent_file", filename, fileContent, new JObject());

            return(response);
        }
コード例 #13
0
        public string AddTorrentFromMagnet(string magnetLink, DelugeSettings settings)
        {
            var response = ProcessRequest <string>(settings, "core.add_torrent_magnet", magnetLink, new JObject());

            return(response);
        }
コード例 #14
0
        public DelugeLabel GetLabelOptions(DelugeSettings settings)
        {
            var response = ProcessRequest <DelugeLabel>(settings, "label.get_options", settings.Category);

            return(response);
        }
コード例 #15
0
        public String AddTorrentFromFile(String filename, Byte[] fileContent, DelugeSettings settings)
        {
            var response = ProcessRequest <String>(settings, "core.add_torrent_file", filename, Convert.ToBase64String(fileContent), new JObject());

            return(response.Result);
        }
コード例 #16
0
        public Boolean RemoveTorrent(String hashString, Boolean removeData, DelugeSettings settings)
        {
            var response = ProcessRequest <Boolean>(settings, "core.remove_torrent", hashString, removeData);

            return(response.Result);
        }