mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
[feature-274] 5 to 20 concurent downlaod + write metadata on after downloading bs via oculus
This commit is contained in:
@@ -169,7 +169,7 @@ export class OculusDownloader {
|
||||
return EMPTY;
|
||||
})
|
||||
);
|
||||
}, 5),
|
||||
}, 20),
|
||||
scan((acc, curr) => acc + curr.diff, 0),
|
||||
);
|
||||
|
||||
|
||||
@@ -145,6 +145,8 @@ export class BsOculusDownloaderService {
|
||||
|
||||
public downloadVersion(downloadInfo: DownloadInfo): Observable<Progression<BSVersion>>{
|
||||
|
||||
let downloadVersion: BSVersion
|
||||
|
||||
return from(this.getUserTokenFromMetaAuth(downloadInfo.stay)).pipe(
|
||||
switchMap(token => {
|
||||
if(!downloadInfo.isVerification){
|
||||
@@ -153,10 +155,12 @@ export class BsOculusDownloaderService {
|
||||
return this.versions.getVersionPath(downloadInfo.bsVersion).then(path => ({token, version: downloadInfo.bsVersion, dest: path}));
|
||||
}),
|
||||
switchMap(({token, version, dest}) => {
|
||||
downloadVersion = version;
|
||||
return this.oculusDownloader.downloadApp({ accessToken: token, binaryId: version.OculusBinaryId, destination: dest }).pipe(map(
|
||||
progress => ({...progress, data: version})
|
||||
));
|
||||
}),
|
||||
finalize(() => downloadVersion && this.versions.setVersionMetadata(downloadInfo.bsVersion, "store", BsStore.OCULUS)),
|
||||
finalize(() => this.oculusDownloader.stopDownload())
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user