mirror of
https://github.com/Sebclem/hassio-nextcloud-backup.git
synced 2024-11-26 10:56:55 +01:00
Compare commits
1 Commits
5b05d8adde
...
5502d20193
Author | SHA1 | Date | |
---|---|---|---|
|
5502d20193 |
@ -21,7 +21,7 @@ router.get("/formated-local-snap", function (req, res, next) {
|
|||||||
hassioApiTools.getSnapshots()
|
hassioApiTools.getSnapshots()
|
||||||
.then((snaps) => {
|
.then((snaps) => {
|
||||||
snaps.sort((a, b) => {
|
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 });
|
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)
|
.getFolderContent(webdav.getConf().back_dir + pathTools.manual)
|
||||||
.then((contents) => {
|
.then((contents) => {
|
||||||
contents.sort((a, b) => {
|
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 '"' at start and end ?
|
//TODO Remove this when bug is fixed, etag contain '"' at start and end ?
|
||||||
for (let backup of contents) {
|
for (let backup of contents) {
|
||||||
@ -67,7 +67,7 @@ router.get("/formated-backup-auto", function (req, res, next) {
|
|||||||
.getFolderContent(url)
|
.getFolderContent(url)
|
||||||
.then((contents) => {
|
.then((contents) => {
|
||||||
contents.sort((a, b) => {
|
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 '"' at start and end ?
|
//TODO Remove this when bug is fixed, etag contain '"' at start and end ?
|
||||||
for (let backup of contents) {
|
for (let backup of contents) {
|
||||||
|
@ -295,7 +295,7 @@ function clean() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
snaps.sort((a, b) => {
|
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);
|
let toDel = snaps.slice(limit);
|
||||||
for (let i of toDel) {
|
for (let i of toDel) {
|
||||||
|
@ -380,13 +380,12 @@ class WebdavTools {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.getFolderContent(this.getConf().back_dir + pathTools.auto)
|
this.getFolderContent(this.getConf().back_dir + pathTools.auto)
|
||||||
.then(async (contents) => {
|
.then(async (contents) => {
|
||||||
|
|
||||||
if (contents.length < limit) {
|
if (contents.length < limit) {
|
||||||
resolve();
|
resolve();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
contents.sort((a, b) => {
|
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);
|
let toDel = contents.slice(limit);
|
||||||
|
Loading…
Reference in New Issue
Block a user