Example #1
0
        public async Task <IEnumerable <TorrentContent> > GetTorrentContents(string hash)
        {
            var torrentContents = await _client.Get <IEnumerable <qBittorrentContent> >("admin", "8tfunqBessie", null, "/query/propertiesFiles/" + hash);

            List <TorrentContent> contentList = new List <TorrentContent>();

            foreach (var torrentContent in torrentContents)
            {
                TorrentContent content = new TorrentContent();
                content.Name     = torrentContent.Name;
                content.Progress = torrentContent.Progress;
                content.Size     = torrentContent.Size;
                content.Seeding  = torrentContent.Is_seed;

                contentList.Add(content);
            }

            return(contentList);
        }
 public TorrentContentViewModel(TorrentContent wrappedObject, int id)
 {
     _wrappedObject = wrappedObject ?? throw new ArgumentNullException(nameof(wrappedObject));
     Id             = id;
 }