community: store versionsUrl in the database
This commit is contained in:
+12
-5
@@ -25,6 +25,7 @@ const apps = require('./apps.js'),
|
||||
BoxError = require('./boxerror.js'),
|
||||
backupSites = require('./backupsites.js'),
|
||||
backuptask = require('./backuptask.js'),
|
||||
community = require('./community.js'),
|
||||
constants = require('./constants.js'),
|
||||
cron = require('./cron.js'),
|
||||
{ CronTime } = require('cron'),
|
||||
@@ -313,11 +314,17 @@ async function checkAppUpdate(app, options) {
|
||||
assert.strictEqual(typeof app, 'object');
|
||||
assert.strictEqual(typeof options, 'object');
|
||||
|
||||
if (app.appStoreId === '') return null; // appStoreId can be '' for dev apps
|
||||
|
||||
const updateInfo = await appstore.getAppUpdate(app, options);
|
||||
await apps.update(app.id, { updateInfo });
|
||||
return updateInfo;
|
||||
if (app.appStoreId) {
|
||||
const updateInfo = await appstore.getAppUpdate(app, options);
|
||||
await apps.update(app.id, { updateInfo });
|
||||
return updateInfo;
|
||||
} else if (app.versionsUrl) {
|
||||
const updateInfo = await community.getAppUpdate(app, options);
|
||||
await apps.update(app.id, { updateInfo });
|
||||
return updateInfo;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async function checkBoxUpdate(options) {
|
||||
|
||||
Reference in New Issue
Block a user