fix(gitlab): fetch media library images through API (#1433)

This commit is contained in:
Benaiah Mischenko
2018-08-22 12:28:52 -07:00
committed by Shawn Erquhart
parent a4ba66e1a6
commit 83d2adc0be
11 changed files with 225 additions and 35 deletions

View File

@ -52,7 +52,6 @@ export default class API {
processFile = file => ({
...file,
name: basename(file.path),
download_url: file.links.self.href,
// BitBucket does not return file SHAs, but it does give us the
// commit SHA. Since the commit SHA will change if any files do,

View File

@ -209,7 +209,7 @@ export default class Bitbucket {
const sem = semaphore(MAX_CONCURRENT_DOWNLOADS);
return this.api.listAllFiles(this.config.get('media_folder')).then(files =>
files.map(({ id, name, download_url, path }) => {
files.map(({ id, name, path }) => {
const getBlobPromise = () =>
new Promise((resolve, reject) =>
sem.take(() =>
@ -220,7 +220,7 @@ export default class Bitbucket {
),
);
return { id, name, getBlobPromise, url: download_url, path };
return { id, name, getBlobPromise, path };
}),
);
}