mirror of https://github.com/Xhofe/alist
fix(vtencent): only show 50 files (close #5805)
parent
fd96a7ccf4
commit
126cfe9f93
|
@ -100,27 +100,35 @@ func (d *Vtencent) LoadUser() (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Vtencent) GetFiles(dirId string) ([]File, error) {
|
func (d *Vtencent) GetFiles(dirId string) ([]File, error) {
|
||||||
api := "https://api.vs.tencent.com/PaaS/Material/SearchResource"
|
var res []File
|
||||||
form := fmt.Sprintf(`{
|
//offset := 0
|
||||||
|
for {
|
||||||
|
api := "https://api.vs.tencent.com/PaaS/Material/SearchResource"
|
||||||
|
form := fmt.Sprintf(`{
|
||||||
"Text":"",
|
"Text":"",
|
||||||
"Text":"",
|
"Text":"",
|
||||||
"Offset":0,
|
"Offset":%d,
|
||||||
"Limit":20000,
|
"Limit":50,
|
||||||
"Sort":{"Field":"%s","Order":"%s"},
|
"Sort":{"Field":"%s","Order":"%s"},
|
||||||
"CreateTimeRanges":[],
|
"CreateTimeRanges":[],
|
||||||
"MaterialTypes":[],
|
"MaterialTypes":[],
|
||||||
"ReviewStatuses":[],
|
"ReviewStatuses":[],
|
||||||
"Tags":[],
|
"Tags":[],
|
||||||
"SearchScopes":[{"Owner":{"Type":"PERSON","Id":"%s"},"ClassId":%s,"SearchOneDepth":true}]
|
"SearchScopes":[{"Owner":{"Type":"PERSON","Id":"%s"},"ClassId":%s,"SearchOneDepth":true}]
|
||||||
}`, d.Addition.OrderBy, d.Addition.OrderDirection, d.TfUid, dirId)
|
}`, len(res), d.Addition.OrderBy, d.Addition.OrderDirection, d.TfUid, dirId)
|
||||||
var resps RspFiles
|
var resp RspFiles
|
||||||
_, err := d.request(api, http.MethodPost, func(req *resty.Request) {
|
_, err := d.request(api, http.MethodPost, func(req *resty.Request) {
|
||||||
req.SetBody(form).ForceContentType("application/json")
|
req.SetBody(form).ForceContentType("application/json")
|
||||||
}, &resps)
|
}, &resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return []File{}, err
|
return nil, err
|
||||||
|
}
|
||||||
|
res = append(res, resp.Data.ResourceInfoSet...)
|
||||||
|
if len(resp.Data.ResourceInfoSet) <= 0 || len(res) >= resp.Data.TotalCount {
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return resps.Data.ResourceInfoSet, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Vtencent) CreateUploadMaterial(classId int, fileName string, UploadSummaryKey string) (RspCreatrMaterial, error) {
|
func (d *Vtencent) CreateUploadMaterial(classId int, fileName string, UploadSummaryKey string) (RspCreatrMaterial, error) {
|
||||||
|
|
Loading…
Reference in New Issue