2023-03-13 15:35:37 +08:00
|
|
|
package alias
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/alist-org/alist/v3/internal/driver"
|
|
|
|
"github.com/alist-org/alist/v3/internal/op"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Addition struct {
|
|
|
|
// Usually one of two
|
|
|
|
// driver.RootPath
|
|
|
|
// define other
|
2025-01-27 20:08:39 +08:00
|
|
|
Paths string `json:"paths" required:"true" type:"text"`
|
|
|
|
ProtectSameName bool `json:"protect_same_name" default:"true" required:"false" help:"Protects same-name files from Delete or Rename"`
|
|
|
|
DownloadConcurrency int `json:"download_concurrency" default:"0" required:"false" type:"number" help:"Need to enable proxy"`
|
|
|
|
DownloadPartSize int `json:"download_part_size" default:"0" type:"number" required:"false" help:"Need to enable proxy. Unit: KB"`
|
2025-03-27 23:17:45 +08:00
|
|
|
Writable bool `json:"writable" type:"bool" default:"false"`
|
2023-03-13 15:35:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
var config = driver.Config{
|
2024-05-22 23:31:42 +08:00
|
|
|
Name: "Alias",
|
|
|
|
LocalSort: true,
|
|
|
|
NoCache: true,
|
2025-03-27 23:17:45 +08:00
|
|
|
NoUpload: false,
|
2024-05-22 23:31:42 +08:00
|
|
|
DefaultRoot: "/",
|
|
|
|
ProxyRangeOption: true,
|
2023-03-13 15:35:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
op.RegisterDriver(func() driver.Driver {
|
2024-05-22 09:27:48 +08:00
|
|
|
return &Alias{
|
|
|
|
Addition: Addition{
|
|
|
|
ProtectSameName: true,
|
|
|
|
},
|
|
|
|
}
|
2023-03-13 15:35:37 +08:00
|
|
|
})
|
|
|
|
}
|