示例#1
0
        private void GetTorrentsAndLabelsFresh()
        {
            if (_token == null)
            {
                return;
            }

            try
            {
                TorrentsAndLabels CurrentTorrents = ServiceClient.GetAllTorrentsAndLabels(_token);

                _torrents = new TorrentCollection(this);
                _torrents.Parse(CurrentTorrents.Torrents, true);

                _labels = new TorrentLabelCollection(this);
                _labels.Parse(CurrentTorrents.Labels);

                SetCache(CurrentTorrents.CacheID);
            }
            catch (System.ServiceModel.ProtocolException e)
            {
                // Token possibly expired, get new token.
                Trace.TraceError(e.Message + e.StackTrace);
                GetToken();
            }
        }
示例#2
0
        private void GetTorrentsAndLabelsFresh()
        {
            TorrentsAndLabels CurrentTorrents = ServiceClient.GetAllTorrentsAndLabels(_token);

            _torrents = new TorrentCollection(this);
            _torrents.Parse(CurrentTorrents.Torrents, true);

            _labels = new TorrentLabelCollection();
            _labels.Parse(CurrentTorrents.Labels);

            SetCache(CurrentTorrents.CacheID);
        }
示例#3
0
        public TorrentCollection GetTorrentsByLabel(TorrentLabel Label)
        {
            TorrentCollection ReturnList = new TorrentCollection(ParentClient);

            foreach (Torrent CurrentTorrent in _torrentCollectionInternal)
            {
                if (CurrentTorrent.Label == Label.ToString())
                {
                    ReturnList.AddTorrent(CurrentTorrent);
                }
            }
            return(ReturnList);
        }
示例#4
0
 internal Torrent(string[] InputValues, TorrentCollection ParentCollection)
 {
     this.ParentCollection = ParentCollection;
     UpdateValuesFromStringArray(InputValues, true);
 }