From 9181861f47e1edcfbdd2ca9e256e2aecb530aeb4 Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Tue, 20 Sep 2022 20:14:38 +0800 Subject: [PATCH] fix: illegal files are not displayed (close #1729) --- drivers/quark/meta.go | 2 +- drivers/quark/util.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/quark/meta.go b/drivers/quark/meta.go index a8b64df2..31ed0eb6 100644 --- a/drivers/quark/meta.go +++ b/drivers/quark/meta.go @@ -8,7 +8,7 @@ import ( type Addition struct { Cookie string `json:"cookie" required:"true"` driver.RootID - OrderBy string `json:"order_by" type:"select" options:"file_type,file_name,updated_at" default:"file_name"` + OrderBy string `json:"order_by" type:"select" options:"none,file_type,file_name,updated_at" default:"none"` OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" default:"asc"` } diff --git a/drivers/quark/util.go b/drivers/quark/util.go index a97e4a79..0627c904 100644 --- a/drivers/quark/util.go +++ b/drivers/quark/util.go @@ -62,7 +62,9 @@ func (d *Quark) GetFiles(parent string) ([]File, error) { "pdir_fid": parent, "_size": strconv.Itoa(size), "_fetch_total": "1", - "_sort": "file_type:asc," + d.OrderBy + ":" + d.OrderDirection, + } + if d.OrderBy != "none" { + query["_sort"] = "file_type:asc," + d.OrderBy + ":" + d.OrderDirection } for { query["_page"] = strconv.Itoa(page)