Ejemplo n.º 1
0
        private IQBittorrentProxy FetchProxy(QBittorrentSettings settings)
        {
            if (_proxyV2.IsApiSupported(settings))
            {
                _logger.Trace("Using qbitTorrent API v2");
                return(_proxyV2);
            }

            if (_proxyV1.IsApiSupported(settings))
            {
                _logger.Trace("Using qbitTorrent API v1");
                return(_proxyV1);
            }

            throw new DownloadClientException("Unable to determine qBittorrent API version");
        }
Ejemplo n.º 2
0
        private Tuple <IQBittorrentProxy, Version> FetchProxy(QBittorrentSettings settings)
        {
            if (_proxyV2.IsApiSupported(settings))
            {
                _logger.Trace("Using qbitTorrent API v2");
                return(Tuple.Create(_proxyV2, _proxyV2.GetApiVersion(settings)));
            }

            if (_proxyV1.IsApiSupported(settings))
            {
                _logger.Trace("Using qbitTorrent API v1");
                return(Tuple.Create(_proxyV1, _proxyV1.GetApiVersion(settings)));
            }

            throw new DownloadClientException("Unable to determine qBittorrent API version");
        }