From 1d7d37e6422e3cb0fc3f5897a81d8f2d54b7f0a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=AE=E5=87=89?= <927625802@qq.com> Date: Wed, 1 Dec 2021 11:25:33 +0800 Subject: [PATCH] :bug: fix onedrive sort --- drivers/one_driver.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/one_driver.go b/drivers/one_driver.go index 294895ee..55c2d885 100644 --- a/drivers/one_driver.go +++ b/drivers/one_driver.go @@ -165,7 +165,9 @@ func (driver Onedrive) Files(path string, account *model.Account) ([]model.File, for _, file := range rawFiles { files = append(files, *driver.FormatFile(&file)) } - _ = conf.Cache.Set(conf.Ctx, fmt.Sprintf("%s%s", account.Name, path), files, nil) + if len(files) > 0 { + _ = conf.Cache.Set(conf.Ctx, fmt.Sprintf("%s%s", account.Name, path), files, nil) + } return files, nil }