예제 #1
0
 public void TryChangeDownloadPackage(Hash packageId, bool start)
 {
     if (!packageRegistry.TryGetPackage(packageId, out LocalPackageInfo package) || package.LockProvider.IsMarkedToDelete)
     {
         return;
     }
     if (start)
     {
         packageDownloadManager.StartDownloadPackage(package);
     }
     else
     {
         packageDownloadManager.StopDownloadPackage(package);
     }
 }
예제 #2
0
        public PackageResponse Package([FromBody] PackageRequest request)
        {
            if (!packageRegistry.TryGetPackage(request.PackageId, out LocalPackageInfo package) || package.LockProvider.IsMarkedToDelete)
            {
                return(new PackageResponse()
                {
                    Found = false
                });
            }

            return(new PackageResponse()
            {
                Found = true,
                Hashes = package.Hashes,
                BytesDownloaded = package.DownloadStatus.Data.DownloadedBytes
            });
        }