Skip to content

Commit 3375c26

Browse files
authored
perf(quark_uc&quark_uc_tv): native proxy multithreading (#8287)
* perf(quark_uc): native proxy multithreading * perf(quark_uc_tv): native proxy multithreading * chore(fs): file query result add id
1 parent ab68fae commit 3375c26

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

drivers/quark_uc/driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (d *QuarkOrUC) Link(ctx context.Context, file model.Obj, args model.LinkArg
7474
"Referer": []string{d.conf.referer},
7575
"User-Agent": []string{ua},
7676
},
77-
Concurrency: 2,
77+
Concurrency: 3,
7878
PartSize: 10 * utils.MB,
7979
}, nil
8080
}

drivers/quark_uc_tv/driver.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ func (d *QuarkUCTV) List(ctx context.Context, dir model.Obj, args model.ListArgs
125125
}
126126

127127
func (d *QuarkUCTV) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) {
128-
files := &model.Link{}
129128
var fileLink FileLink
130129
_, err := d.request(ctx, "/file", "GET", func(req *resty.Request) {
131130
req.SetQueryParams(map[string]string{
@@ -139,8 +138,12 @@ func (d *QuarkUCTV) Link(ctx context.Context, file model.Obj, args model.LinkArg
139138
if err != nil {
140139
return nil, err
141140
}
142-
files.URL = fileLink.Data.DownloadURL
143-
return files, nil
141+
142+
return &model.Link{
143+
URL: fileLink.Data.DownloadURL,
144+
Concurrency: 3,
145+
PartSize: 10 * utils.MB,
146+
}, nil
144147
}
145148

146149
func (d *QuarkUCTV) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error) {

server/handles/fsread.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ type DirReq struct {
3333
}
3434

3535
type ObjResp struct {
36+
Id string `json:"id"`
37+
Path string `json:"path"`
3638
Name string `json:"name"`
3739
Size int64 `json:"size"`
3840
IsDir bool `json:"is_dir"`
@@ -210,6 +212,8 @@ func toObjsResp(objs []model.Obj, parent string, encrypt bool) []ObjResp {
210212
for _, obj := range objs {
211213
thumb, _ := model.GetThumb(obj)
212214
resp = append(resp, ObjResp{
215+
Id: obj.GetID(),
216+
Path: obj.GetPath(),
213217
Name: obj.GetName(),
214218
Size: obj.GetSize(),
215219
IsDir: obj.IsDir(),
@@ -326,6 +330,8 @@ func FsGet(c *gin.Context) {
326330
thumb, _ := model.GetThumb(obj)
327331
common.SuccessResp(c, FsGetResp{
328332
ObjResp: ObjResp{
333+
Id: obj.GetID(),
334+
Path: obj.GetPath(),
329335
Name: obj.GetName(),
330336
Size: obj.GetSize(),
331337
IsDir: obj.IsDir(),

0 commit comments

Comments
 (0)