Skip to content

Commit

Permalink
feat(pikpak): allow disable media link (close #4735)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jul 11, 2023
1 parent 3e0de5e commit 6887f14
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/pikpak/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (d *PikPak) Link(ctx context.Context, file model.Obj, args model.LinkArgs)
link := model.Link{
URL: resp.WebContentLink,
}
if len(resp.Medias) > 0 && resp.Medias[0].Link.Url != "" {
if !d.DisableMediaLink && len(resp.Medias) > 0 && resp.Medias[0].Link.Url != "" {
log.Debugln("use media link")
link.URL = resp.Medias[0].Link.Url
}
Expand Down
5 changes: 3 additions & 2 deletions drivers/pikpak/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (

type Addition struct {
driver.RootID
Username string `json:"username" required:"true"`
Password string `json:"password" required:"true"`
Username string `json:"username" required:"true"`
Password string `json:"password" required:"true"`
DisableMediaLink bool `json:"disable_media_link"`
}

var config = driver.Config{
Expand Down

0 comments on commit 6887f14

Please sign in to comment.