community: store versionsUrl in the database

This commit is contained in:
Girish Ramakrishnan
2026-02-05 17:29:00 +01:00
parent 91b8f1a457
commit d6eb6d3e3e
13 changed files with 249 additions and 118 deletions
+12 -5
View File
@@ -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) {