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.
This commit is contained in:
Nick Craig-Wood 2023-06-28 17:27:43 +01:00
parent 8308d5d640
commit 3b6effa81a

View File

@ -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
}