Exemple #1
0
 public override async Task DownloadLibrary(LibraryInfo library, string savePath)
 {
     if (library.HasLibrary())
     {
         var url = library.GetLibrary()?.Url;
         if (string.IsNullOrEmpty(url))
         {
             url = $"{Server}{library.GetLibraryPath().Replace('\\', '/')}";
         }
         url = _vanillaServer.Replace(url, Server);
         url = _forgeServeRegex.Replace(url, Server);
         Logger.Info(url);
         await Downloader.DownloadFileTaskAsync(url, savePath);
     }
     if (library.IsNative)
     {
         var url = library.GetNative().Url;
         if (string.IsNullOrEmpty(url))
         {
             url = $"{Server}{library.GetNativePath().Replace('\\', '/')}";
         }
         url = _vanillaServer.Replace(url, Server);
         url = _forgeServeRegex.Replace(url, Server);
         await Downloader.DownloadFileTaskAsync(url, savePath);
     }
 }
Exemple #2
0
 public override async Task DownloadLibrary(LibraryInfo library, string savePath)
 {
     if (library.HasLibrary())
     {
         var url = library.GetLibrary()?.Url ?? Server + library.GetLibraryPath();
         await Downloader.DownloadFileTaskAsync(url, savePath);
     }
     if (library.IsNative)
     {
         var url = library.GetNative().Url ?? Server + library.GetNativePath();
         await Downloader.DownloadFileTaskAsync(url, savePath);
     }
 }