Skip to content

Commit

Permalink
完善所有功能,目前测试无BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
Muione committed Jun 23, 2024
1 parent 27ef5a2 commit fc85499
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/pikpak/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ func (d *PikPak) OfflineDownload(ctx context.Context, fileUrl string, parentDir
"parent_id": parentDir.GetID(),
}
if parentDir.GetID() == "" {
requestBody["folder_type"] = ""
} else {
requestBody["folder_type"] = "DOWNLOAD"
} else {
requestBody["folder_type"] = ""
}

var resp OfflineDownloadResp
Expand Down
5 changes: 3 additions & 2 deletions internal/offline_download/pikpak/pikpak.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (p *PikPak) AddURL(args *tool.AddUrlArgs) (string, error) {
}

ctx := context.Background()
parentDir, err := op.Get(ctx, storage, actualPath)
parentDir, err := op.GetUnwrap(ctx, storage, actualPath)
if err != nil {
return "", err
}
Expand Down Expand Up @@ -98,7 +98,7 @@ func (p *PikPak) Status(task *tool.DownloadTask) (*tool.Status, error) {
NewGID: "",
Completed: false,
Status: "the task has been deleted",
Err: fmt.Errorf("the task has been deleted"),
Err: nil,
}
for _, t := range tasks {
if t.ID == task.GID {
Expand All @@ -111,6 +111,7 @@ func (p *PikPak) Status(task *tool.DownloadTask) (*tool.Status, error) {
return s, nil
}
}
s.Err = fmt.Errorf("the task has been deleted")
return s, nil
}

Expand Down

0 comments on commit fc85499

Please sign in to comment.