コード例 #1
0
		public void SetTorrentSettings_Test()
		{
			var torrentsInfo = client.GetTorrents(TorrentFields.ALL_FIELDS);
			var torrentInfo = torrentsInfo.Torrents.FirstOrDefault();
			Assert.IsNotNull(torrentInfo, "Torrent not found");

			var trackerInfo = torrentInfo.Trackers.FirstOrDefault();
			Assert.IsNotNull(trackerInfo, "Tracker not found");

			TorrentSettings settings = new TorrentSettings()
			{
				IDs = new int[] { torrentInfo.ID },
				TrackerRemove = new int[] { trackerInfo.ID }
			};

			client.SetTorrents(settings);

			torrentsInfo = client.GetTorrents(TorrentFields.ALL_FIELDS, torrentInfo.ID);
			torrentInfo = torrentsInfo.Torrents.FirstOrDefault();

			trackerInfo = torrentInfo.Trackers.FirstOrDefault(t=>t.ID == trackerInfo.ID);
			Assert.IsNull(trackerInfo);
		}
コード例 #2
0
 /// <summary>
 /// Set torrent params (API: torrent-set)
 /// </summary>
 /// <param name="torrentSet">New torrent params</param>
 public async void TorrentSetAsync(TorrentSettings settings)
 {
     var request = new TransmissionRequest("torrent-set", settings.ToDictionary());
     var response = await SendRequestAsync(request);
 }
コード例 #3
0
 /// <summary>
 /// Set torrent params (API: torrent-set)
 /// </summary>
 /// <param name="torrentSet">New torrent params</param>
 public void SetTorrents(TorrentSettings settings)
 {
     var request = new TransmissionRequest("torrent-set", settings.ToDictionary());
     var response = SendRequest(request);
 }