Exemple #1
0
        public int CoreRevision()
        {
            var response = _jdClient.Post <DefaultReturnDto <int> >("/jd/getCoreRevision", _device, _context.SessionToken, _context.DeviceEncryptionToken);

            if (response == null)
            {
                return(-1);
            }

            return(response.Data);
        }
Exemple #2
0
        /// <summary>
        /// Adds a download link to the given device.
        /// </summary>
        /// <param name="requestDto">
        /// Contains informations like the link itself or the priority.
        /// If you want to use multiple links sperate them with an ';' char.
        /// </param>
        public bool AddLinks(AddLinkRequestDto requestDto)
        {
            requestDto.Links = requestDto.Links.Replace(";", "\\r\\n");
            var response = _jdClient.Post <DefaultReturnDto <object> >("/linkgrabberv2/addLinks", _device, requestDto, _context.SessionToken, _context.DeviceEncryptionToken);

            return(response != null);
        }
Exemple #3
0
        /// <summary>
        /// Gets the current state of the device
        /// </summary>
        /// <returns>The current state of the device.</returns>
        public string GetCurrentState()
        {
            var response = _jdClient.Post <DefaultReturnDto <string> >("/downloadcontroller/getCurrentState", _device, _context.SessionToken, _context.DeviceEncryptionToken);

            if (response != null)
            {
                return(response.Data);
            }

            return("UNKOWN_STATE");
        }
        /// <summary>
        /// Gets all packages that are currently in the download list.
        /// </summary>
        /// <param name="linkQuery">An object which allows you to filter the return object.</param>
        /// <returns>An enumerable of the FilePackageDto which contains infos about the packages.</returns>
        public IEnumerable <FilePackageDto> QueryPackages(LinkQueryDto linkQuery)
        {
            var response = _jdClient.Post <DefaultReturnDto <IEnumerable <FilePackageDto> > >("/downloadsV2/queryPackages", _device, linkQuery, _context.SessionToken, _context.DeviceEncryptionToken);

            return(response?.Data);
        }