mirror of
https://github.com/Ellpeck/WoodpeckerPlugins.git
synced 2024-11-24 11:18:34 +01:00
fixed an empty directory crashing the retention system
This commit is contained in:
parent
e46a6b5130
commit
f8e0017340
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ async function upload() {
|
||||||
});
|
});
|
||||||
if (response.status != 404) {
|
if (response.status != 404) {
|
||||||
let data = JSON.parse(xml.toJson(response.data));
|
let data = JSON.parse(xml.toJson(response.data));
|
||||||
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)) {
|
||||||
|
|
Loading…
Reference in a new issue