mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-15 05:41:28 +03:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user