mirror of https://github.com/Xhofe/alist
chore: add is it support upload config for driver
parent
31ff31d3dd
commit
a61bb6ab1f
|
@ -7,4 +7,5 @@ type Config struct {
|
||||||
OnlyProxy bool
|
OnlyProxy bool
|
||||||
NoNeedSetLink bool
|
NoNeedSetLink bool
|
||||||
NoCache bool
|
NoCache bool
|
||||||
|
NoUpload bool
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,9 @@ var UploadTaskManager = task.NewTaskManager()
|
||||||
// Put add as a put task
|
// Put add as a put task
|
||||||
func Put(ctx context.Context, account driver.Driver, parentPath string, file model.FileStreamer) error {
|
func Put(ctx context.Context, account driver.Driver, parentPath string, file model.FileStreamer) error {
|
||||||
account, actualParentPath, err := operations.GetAccountAndActualPath(parentPath)
|
account, actualParentPath, err := operations.GetAccountAndActualPath(parentPath)
|
||||||
|
if account.Config().NoUpload {
|
||||||
|
return errors.New("upload is not supported")
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.WithMessage(err, "failed get account")
|
return errors.WithMessage(err, "failed get account")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue