feat: file down handle
This commit is contained in:
@ -88,7 +88,7 @@ func initialSettings() {
|
||||
{Key: "global_readme", Value: "This is global readme", Type: conf.TypeText, Group: model.GLOBAL},
|
||||
{Key: "customize_head", Type: conf.TypeText, Group: model.GLOBAL, Flag: model.PRIVATE},
|
||||
{Key: "customize_body", Type: conf.TypeText, Group: model.GLOBAL, Flag: model.PRIVATE},
|
||||
{Key: "link_expiration", Value: "4", Type: conf.TypeNumber, Group: model.GLOBAL, Flag: model.PRIVATE},
|
||||
{Key: "link_expiration", Value: "0", Type: conf.TypeNumber, Group: model.GLOBAL, Flag: model.PRIVATE},
|
||||
// single settings
|
||||
{Key: "token", Value: token, Type: conf.TypeString, Group: model.SINGLE, Flag: model.PRIVATE},
|
||||
}
|
||||
|
@ -9,3 +9,7 @@ type Config struct {
|
||||
NoCache bool
|
||||
NoUpload bool
|
||||
}
|
||||
|
||||
func (c Config) MustProxy() bool {
|
||||
return c.OnlyProxy || c.OnlyLocal
|
||||
}
|
||||
|
@ -2,7 +2,9 @@ package fs
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/alist-org/alist/v3/internal/driver"
|
||||
"github.com/alist-org/alist/v3/internal/model"
|
||||
"github.com/alist-org/alist/v3/internal/operations"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@ -92,3 +94,11 @@ func PutAsTask(dstDirPath string, file model.FileStreamer) error {
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func GetAccount(path string) (driver.Driver, error) {
|
||||
accountDriver, _, err := operations.GetAccountAndActualPath(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return accountDriver, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user