private void Handle(TorrentFinishedAlert alert) { var torrent = Torrent.CreateFromHandle(alert.Handle, _metadataRepository); if (_muted.Contains(torrent.InfoHash)) { return; } _messageBus.Publish(new TorrentCompletedMessage(torrent)); }
public ITorrent GetByInfoHash(string infoHash) { var handle = _session.FindTorrent(infoHash); return(handle == null ? null : Torrent.CreateFromHandle(handle, _metadataRepository)); }
public IEnumerable <ITorrent> GetAll() { return(_session.GetTorrents().Select(t => Torrent.CreateFromHandle(t, _metadataRepository))); }