Skip to content

Commit

Permalink
优化Status函数
Browse files Browse the repository at this point in the history
  • Loading branch information
Muione committed Jun 23, 2024
1 parent dedce2f commit 27ef5a2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/offline_download/pikpak/pikpak.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ func (p *PikPak) Status(task *tool.DownloadTask) (*tool.Status, error) {
Progress: 0,
NewGID: "",
Completed: false,
Status: "",
Err: nil,
Status: "the task has been deleted",
Err: fmt.Errorf("the task has been deleted"),
}
for _, t := range tasks {
if t.ID == task.GID {
Expand All @@ -108,9 +108,7 @@ func (p *PikPak) Status(task *tool.DownloadTask) (*tool.Status, error) {
if t.Phase == "PHASE_TYPE_ERROR" {
s.Err = fmt.Errorf(t.Message)
}
} else {
s.Status = "the task has been deleted"
s.Err = fmt.Errorf("the task has been deleted")
return s, nil
}
}
return s, nil
Expand Down

0 comments on commit 27ef5a2

Please sign in to comment.