Compare commits

..

1 Commits

Author SHA1 Message Date
renovate[bot]
5502d20193
⬆️ Update dependency bootstrap to v5.2.2 2022-10-03 09:29:50 +00:00
3 changed files with 5 additions and 6 deletions

View File

@ -21,7 +21,7 @@ router.get("/formated-local-snap", function (req, res, next) {
hassioApiTools.getSnapshots()
.then((snaps) => {
snaps.sort((a, b) => {
return Date.parse(b.date) - Date.parse(a.date);
return a.date < b.date ? 1 : -1
});
res.render("localSnaps", { snaps: snaps, DateTime: DateTime });
@ -43,7 +43,7 @@ router.get("/formated-backup-manual", function (req, res, next) {
.getFolderContent(webdav.getConf().back_dir + pathTools.manual)
.then((contents) => {
contents.sort((a, b) => {
return Date.parse(b.lastmod) - Date.parse(a.lastmod)
return a.date < b.date ? 1 : -1
});
//TODO Remove this when bug is fixed, etag contain '&quot;' at start and end ?
for (let backup of contents) {
@ -67,7 +67,7 @@ router.get("/formated-backup-auto", function (req, res, next) {
.getFolderContent(url)
.then((contents) => {
contents.sort((a, b) => {
return Date.parse(b.lastmod) - Date.parse(a.lastmod)
return a.date < b.date ? 1 : -1
});
//TODO Remove this when bug is fixed, etag contain '&quot;' at start and end ?
for (let backup of contents) {

View File

@ -295,7 +295,7 @@ function clean() {
return;
}
snaps.sort((a, b) => {
return Date.parse(b.date) - Date.parse(a.date);
return a.date < b.date ? 1 : -1
});
let toDel = snaps.slice(limit);
for (let i of toDel) {

View File

@ -380,13 +380,12 @@ class WebdavTools {
return new Promise((resolve, reject) => {
this.getFolderContent(this.getConf().back_dir + pathTools.auto)
.then(async (contents) => {
if (contents.length < limit) {
resolve();
return;
}
contents.sort((a, b) => {
return Date.parse(b.lastmod) - Date.parse(a.lastmod)
return a.date < b.date ? 1 : -1
});
let toDel = contents.slice(limit);