🔨 Clean at the end of upload

This commit is contained in:
Sebastien Clement 2020-01-10 19:52:42 +01:00
parent cdcbac4bc6
commit 4dec2579f5

View File

@ -8,6 +8,7 @@ const configPath = "./webdav_conf.json"
const path = require('path');
const settingsTools = require('./settingsTools');
const pathTools = require('./pathTools');
const hassioApiTools = require('./hassioApiTools');
const request = require('request');
@ -202,7 +203,17 @@ class WebdavTools {
statusTools.setStatus(status);
cleanTempFolder();
let autoCleanCloud = settingsTools.getSettings().auto_clean_backup;
if (autoCleanCloud != null && autoCleanCloud == "true") {
this.clean().catch();
}
let autoCleanlocal = settingsTools.getSettings().auto_clean_local;
if (autoCleanlocal != null && autoCleanlocal == "true") {
hassioApiTools.clean();
}
resolve();
}
})
});