chore!: change root folder
This commit is contained in:
@ -10,7 +10,7 @@ type Addition struct {
|
||||
Password string `json:"password" required:"true"`
|
||||
OrderBy string `json:"order_by" type:"select" options:"name,fileId,updateAt,createAt" default:"name"`
|
||||
OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" default:"asc"`
|
||||
driver.RootFolderID
|
||||
driver.RootID
|
||||
// define other
|
||||
StreamUpload bool `json:"stream_upload"`
|
||||
//Field string `json:"field" type:"select" required:"true" options:"a,b,c" default:"a"`
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
type Addition struct {
|
||||
driver.RootFolderID
|
||||
driver.RootID
|
||||
RefreshToken string `json:"refresh_token" required:"true"`
|
||||
OrderBy string `json:"order_by" type:"select" options:"name,size,updated_at,created_at"`
|
||||
OrderDirection string `json:"order_direction" type:"select" options:"ASC,DESC"`
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
|
||||
type Addition struct {
|
||||
RefreshToken string `json:"refresh_token" required:"true"`
|
||||
driver.RootFolderPath
|
||||
driver.RootPath
|
||||
OrderBy string `json:"order_by" type:"select" options:"name,time,size" default:"name"`
|
||||
OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" default:"asc"`
|
||||
DownloadAPI string `json:"download_api" type:"select" options:"official,crack" default:"official"`
|
||||
|
@ -9,7 +9,7 @@ type Addition struct {
|
||||
Address string `json:"address" required:"true"`
|
||||
Username string `json:"username" required:"true"`
|
||||
Password string `json:"password" required:"true"`
|
||||
driver.RootFolderPath
|
||||
driver.RootPath
|
||||
}
|
||||
|
||||
var config = driver.Config{
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
type Addition struct {
|
||||
driver.RootFolderID
|
||||
driver.RootID
|
||||
RefreshToken string `json:"refresh_token" required:"true"`
|
||||
OrderBy string `json:"order_by" type:"string" help:"such as: folder,name,modifiedTime"`
|
||||
OrderDirection string `json:"order_direction" type:"select" options:"asc,desc"`
|
||||
|
@ -18,7 +18,6 @@ import (
|
||||
"github.com/alist-org/alist/v3/internal/driver"
|
||||
"github.com/alist-org/alist/v3/internal/errs"
|
||||
"github.com/alist-org/alist/v3/internal/model"
|
||||
"github.com/alist-org/alist/v3/internal/op"
|
||||
"github.com/alist-org/alist/v3/pkg/utils"
|
||||
"github.com/alist-org/alist/v3/server/common"
|
||||
"github.com/disintegration/imaging"
|
||||
@ -39,17 +38,17 @@ func (d *Local) Init(ctx context.Context, storage model.Storage) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !utils.Exists(d.RootFolder) {
|
||||
err = fmt.Errorf("root folder %s not exists", d.RootFolder)
|
||||
if !utils.Exists(d.GetRootPath()) {
|
||||
err = fmt.Errorf("root folder %s not exists", d.GetRootPath())
|
||||
} else {
|
||||
if !filepath.IsAbs(d.RootFolder) {
|
||||
d.RootFolder, err = filepath.Abs(d.RootFolder)
|
||||
if !filepath.IsAbs(d.GetRootPath()) {
|
||||
abs, err := filepath.Abs(d.GetRootPath())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
d.SetRootPath(abs)
|
||||
}
|
||||
}
|
||||
op.MustSaveDriverStorage(d)
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
type Addition struct {
|
||||
driver.RootFolderPath
|
||||
driver.RootPath
|
||||
Thumbnail bool `json:"thumbnail" required:"true" help:"enable thumbnail"`
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
type Addition struct {
|
||||
driver.RootFolderPath
|
||||
driver.RootPath
|
||||
Region string `json:"region" type:"select" required:"true" options:"global,cn,us,de"`
|
||||
IsSharepoint bool `json:"is_sharepoint"`
|
||||
ClientID string `json:"client_id" required:"true"`
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
type Addition struct {
|
||||
driver.RootFolderID
|
||||
driver.RootID
|
||||
Username string `json:"username" required:"true"`
|
||||
Password string `json:"password" required:"true"`
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
|
||||
type Addition struct {
|
||||
Cookie string `json:"cookie" required:"true"`
|
||||
driver.RootFolderID
|
||||
driver.RootID
|
||||
OrderBy string `json:"order_by" type:"select" options:"file_type,file_name,updated_at" default:"file_name"`
|
||||
OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" default:"asc"`
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
type Addition struct {
|
||||
driver.RootFolderPath
|
||||
driver.RootPath
|
||||
Bucket string `json:"bucket" required:"true"`
|
||||
Endpoint string `json:"endpoint" required:"true"`
|
||||
Region string `json:"region"`
|
||||
|
@ -10,7 +10,7 @@ type Addition struct {
|
||||
Username string `json:"username" required:"true"`
|
||||
PrivateKey string `json:"private_key" type:"text"`
|
||||
Password string `json:"password"`
|
||||
driver.RootFolderPath
|
||||
driver.RootPath
|
||||
}
|
||||
|
||||
var config = driver.Config{
|
||||
|
@ -9,7 +9,7 @@ type Addition struct {
|
||||
Region string `json:"region" type:"select" options:"china,international" required:"true"`
|
||||
Cookie string `json:"cookie" required:"true"`
|
||||
ProjectID string `json:"project_id" required:"true"`
|
||||
driver.RootFolderID
|
||||
driver.RootID
|
||||
OrderBy string `json:"order_by" type:"select" options:"fileName,fileSize,updated,created" default:"fileName"`
|
||||
OrderDirection string `json:"order_direction" type:"select" options:"Asc,Desc" default:"Asc"`
|
||||
}
|
||||
|
@ -7,8 +7,8 @@ import (
|
||||
|
||||
type Addition struct {
|
||||
// Usually one of two
|
||||
driver.RootFolderPath
|
||||
driver.RootFolderID
|
||||
driver.RootPath
|
||||
driver.RootID
|
||||
// define other
|
||||
Field string `json:"field" type:"select" required:"true" options:"a,b,c" default:"a"`
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
type Addition struct {
|
||||
driver.RootFolderPath
|
||||
driver.RootPath
|
||||
Bucket string `json:"bucket" required:"true"`
|
||||
Endpoint string `json:"endpoint" required:"true"`
|
||||
OperatorName string `json:"operator_name" required:"true"`
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
)
|
||||
|
||||
type Addition struct {
|
||||
driver.RootFolderPath
|
||||
driver.RootPath
|
||||
NumFile int `json:"num_file" type:"number" default:"30" required:"true"`
|
||||
NumFolder int `json:"num_folder" type:"number" default:"30" required:"true"`
|
||||
MaxFileSize int64 `json:"max_file_size" type:"number" default:"1073741824" required:"true"`
|
||||
|
Reference in New Issue
Block a user