From 3b6effa81acb420f17dc3486626eb58baa91945a Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 28 Jun 2023 17:27:43 +0100 Subject: [PATCH] uptobox: fix rmdir declaring that directories weren't empty The API seems to have changed and the `totalFileCount` item no longer tracks the number of files in the directory so is useless for seeing if the directory is empty. This patch fixes the problem by seeing whether there are any files or directories in the folder instead. This problem was detected by the integration tests. --- backend/uptobox/uptobox.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/uptobox/uptobox.go b/backend/uptobox/uptobox.go index 0f7777cc0..29f83187d 100644 --- a/backend/uptobox/uptobox.go +++ b/backend/uptobox/uptobox.go @@ -678,7 +678,7 @@ func (f *Fs) Rmdir(ctx context.Context, dir string) error { if err != nil { return err } - if info.Data.CurrentFolder.FileCount > 0 { + if len(info.Data.Folders) > 0 || len(info.Data.Files) > 0 { return fs.ErrorDirectoryNotEmpty }