mirror of
https://github.com/Ellpeck/WoodpeckerPlugins.git
synced 2024-11-21 18:13:30 +01:00
actually delete the right amount of files
This commit is contained in:
parent
02621d4d2e
commit
249b14c27e
1 changed files with 1 additions and 1 deletions
|
@ -53,7 +53,7 @@ async function upload() {
|
||||||
let dirs = data["d:multistatus"]["d:response"].slice(1);
|
let dirs = data["d:multistatus"]["d:response"].slice(1);
|
||||||
// sort directories by last modified
|
// sort directories by last modified
|
||||||
dirs.sort((a, b) => new Date(a["d:propstat"]["d:prop"]["d:getlastmodified"]) - new Date(b["d:propstat"]["d:prop"]["d:getlastmodified"]));
|
dirs.sort((a, b) => new Date(a["d:propstat"]["d:prop"]["d:getlastmodified"]) - new Date(b["d:propstat"]["d:prop"]["d:getlastmodified"]));
|
||||||
while (dirs.length > parseInt(retentionAmount)) {
|
while (dirs.length >= parseInt(retentionAmount)) {
|
||||||
let dir = serverEnv + dirs[0]["d:href"];
|
let dir = serverEnv + dirs[0]["d:href"];
|
||||||
let dirName = dir.substring(retentionPath.length - retentionBase.length).replace(/\/$/, "");
|
let dirName = dir.substring(retentionPath.length - retentionBase.length).replace(/\/$/, "");
|
||||||
await axios.request({
|
await axios.request({
|
||||||
|
|
Loading…
Reference in a new issue