speed up extension query

fixes #439
This commit is contained in:
Joao Moreno
2015-12-03 11:29:48 +01:00
parent 4d90894543
commit 42ff2b415b
3 changed files with 5 additions and 2 deletions
@@ -20,6 +20,7 @@ export interface IExtensionManifest {
export interface IGalleryInformation {
galleryApiUrl: string;
id: string;
downloadUrl: string;
publisherId: string;
publisherDisplayName: string;
date: string;
@@ -117,7 +117,7 @@ export class ExtensionsService implements IExtensionsService {
return TPromise.wrapError(new Error(nls.localize('missingGalleryInformation', "Gallery information is missing")));
}
const url = `${ galleryInformation.galleryApiUrl }/publisher/${ extension.publisher }/extension/${ extension.name }/latest/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage?install=true`;
const url = galleryInformation.downloadUrl;
const zipPath = path.join(tmpdir(), galleryInformation.id);
const extensionPath = path.join(this.extensionsPath, `${ extension.publisher }.${ extension.name }`);
const manifestPath = path.join(extensionPath, 'package.json');
@@ -21,6 +21,7 @@ export interface IGalleryExtensionFile {
export interface IGalleryExtensionVersion {
version: string;
lastUpdated: string;
assetUri: string;
files: IGalleryExtensionFile[];
}
@@ -68,7 +69,7 @@ export class GalleryService implements IGalleryService {
value: 'vscode'
}]
}],
flags: 0x1 | 0x2 | 0x4 | 0x8 | 0x10
flags: 0x1 | 0x4 | 0x80
});
const request = {
@@ -94,6 +95,7 @@ export class GalleryService implements IGalleryService {
galleryInformation: {
galleryApiUrl: this.extensionsGalleryUrl,
id: extension.extensionId,
downloadUrl: `${ extension.versions[0].assetUri }/Microsoft.VisualStudio.Services.VSIXPackage?install=true`,
publisherId: extension.publisher.publisherId,
publisherDisplayName: extension.publisher.displayName,
date: extension.versions[0].lastUpdated