예제 #1
0
        private void Handle(TorrentFinishedAlert alert)
        {
            var torrent = Torrent.CreateFromHandle(alert.Handle, _metadataRepository);

            if (_muted.Contains(torrent.InfoHash))
            {
                return;
            }

            _messageBus.Publish(new TorrentCompletedMessage(torrent));
        }
예제 #2
0
        public ITorrent GetByInfoHash(string infoHash)
        {
            var handle = _session.FindTorrent(infoHash);

            return(handle == null ? null : Torrent.CreateFromHandle(handle, _metadataRepository));
        }
예제 #3
0
 public IEnumerable <ITorrent> GetAll()
 {
     return(_session.GetTorrents().Select(t => Torrent.CreateFromHandle(t, _metadataRepository)));
 }