Skip to content

Commit

Permalink
Update 115.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Sakura-Byte committed Feb 3, 2025
1 parent 326191f commit 34ad6e2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions backend/115/115.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ This enables separate client instances dedicated to downloading files`,
Help: `Disable proxy settings for the download-only client.
Use this flag with the "--115-download-cookie" option to bypass proxy settings for downloads.`,
}, {
Name: "no_check",
Default: false,
Advanced: true,
Help: "Disable post-upload directory listing check (f.listAll) in PutUnchecked",
}, {
Name: config.ConfigEncoding,
Help: config.ConfigEncodingHelp,
Expand Down Expand Up @@ -303,6 +308,7 @@ type Options struct {
UploadConcurrency int `config:"upload_concurrency"`
DownloadCookie fs.CommaSepList `config:"download_cookie"`
DownloadNoProxy bool `config:"download_no_proxy"`
NoCheck bool `config:"no_check"`
Enc encoder.MultiEncoder `config:"encoding"`
}

Expand Down Expand Up @@ -1018,6 +1024,10 @@ func (f *Fs) putUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo,
return nil
}

if f.opt.NoCheck {
return nil
}

var info *api.File
found, err := f.listAll(ctx, o.parent, f.opt.ListChunk, true, false, func(item *api.File) bool {
if strings.ToLower(item.Sha) == o.sha1sum {
Expand Down

0 comments on commit 34ad6e2

Please sign in to comment.