예제 #1
0
        public async Task <NextResult> CreateData(DownloadingFileData info, DownloadResult result)
        {
            try
            {
                foreach (var url in result.DownloadUrlList)
                {
                    var httpInfo = await HttpDownload.CreateTaskInfo(url.Value.UrlLists, info.DownloadPath, _user.DownloadThreadNumber,
                                                                     result.Cookies);

                    info.Info = httpInfo;
                    info.Save();
                    return(new NextResult(httpInfo, 0, string.Empty));
                }
                return(null);
            }
            catch (NullReferenceException)
            {
                return(null);
            }
        }
        public async Task <NextResult> CreateData(DownloadingFileData info, DownloadResult result)
        {
            try
            {
                foreach (var url in result.DownloadUrlList)
                {
                    var httpInfo = await HttpDownload.CreateTaskInfo(url.Value.UrlLists, info.DownloadPath, (int)Container.Resolve <ILocalConfigInfo>().SpeedLimit,
                                                                     result.Cookies);

                    info.Info = httpInfo;
                    info.Save();
                    return(new NextResult(httpInfo, 0, string.Empty));
                }
                return(null);
            }
            catch (NullReferenceException)
            {
                return(null);
            }
        }