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; } }
public Dictionary <string, object> GetConfig(DelugeSettings settings) { var response = ProcessRequest <Dictionary <string, object> >(settings, "core.get_config"); return(response); }
public string GetVersion(DelugeSettings settings) { var response = ProcessRequest <string>(settings, "daemon.info"); return(response); }
public void SetLabel(string hash, string label, DelugeSettings settings) { ProcessRequest <object>(settings, "label.set_torrent", hash, label); }
public void AddLabel(string label, DelugeSettings settings) { ProcessRequest <object>(settings, "label.add", label); }
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); } }
public string[] GetAvailableLabels(DelugeSettings settings) { var response = ProcessRequest <string[]>(settings, "label.get_labels"); return(response); }
public string[] GetEnabledPlugins(DelugeSettings settings) { var response = ProcessRequest <string[]>(settings, "core.get_enabled_plugins"); return(response); }
public string[] GetAvailablePlugins(DelugeSettings settings) { var response = ProcessRequest <string[]>(settings, "core.get_available_plugins"); return(response); }
public void MoveTorrentToTopInQueue(string hash, DelugeSettings settings) { ProcessRequest <object>(settings, "core.queue_top", (object)new string[] { hash }); }
public bool RemoveTorrent(string hash, bool removeData, DelugeSettings settings) { var response = ProcessRequest <bool>(settings, "core.remove_torrent", hash, removeData); return(response); }
public string AddTorrentFromFile(string filename, byte[] fileContent, DelugeSettings settings) { var response = ProcessRequest <string>(settings, "core.add_torrent_file", filename, fileContent, new JObject()); return(response); }
public string AddTorrentFromMagnet(string magnetLink, DelugeSettings settings) { var response = ProcessRequest <string>(settings, "core.add_torrent_magnet", magnetLink, new JObject()); return(response); }
public DelugeLabel GetLabelOptions(DelugeSettings settings) { var response = ProcessRequest <DelugeLabel>(settings, "label.get_options", settings.Category); return(response); }
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); }
public Boolean RemoveTorrent(String hashString, Boolean removeData, DelugeSettings settings) { var response = ProcessRequest <Boolean>(settings, "core.remove_torrent", hashString, removeData); return(response.Result); }