Version and commit info is now generated during autobuilds and can be viewed in the about dialog

Prepared removal of JSON translations from repo to move towards XLIFF-only
This commit is contained in:
Isaac Abadi
2021-09-20 22:04:46 -06:00
parent 0e37d83740
commit 58a0dc4afe
8 changed files with 84 additions and 1 deletions

View File

@@ -142,6 +142,14 @@ var validDownloadingAgents = [
const subscription_timeouts = {};
let version_info = null;
if (fs.existsSync('version.json')) {
version_info = fs.readJSONSync('version.json');
logger.verbose(`Version info: ${JSON.stringify(version_info, null, 2)}`);
} else {
version_info = {'type': 'N/A', 'tag': 'N/A', 'commit': 'N/A', 'date': 'N/A'};
}
// don't overwrite config if it already happened.. NOT
// let alreadyWritten = db.get('configWriteFlag').value();
let writeConfigMode = process.env.write_ytdl_config;
@@ -932,6 +940,10 @@ app.post('/api/setConfig', optionalJwt, function(req, res) {
}
});
app.get('/api/versionInfo', (req, res) => {
res.send({version_info: version_info});
});
app.post('/api/restartServer', optionalJwt, (req, res) => {
// delayed by a little bit so that the client gets a response
setTimeout(() => {restartServer()}, 100);