mirror of https://github.com/Xhofe/alist
feat: auto fix address in alist & smb storages (#2582)
parent
8c0dfe2f3d
commit
dc8d5106f9
|
@ -30,6 +30,9 @@ func (d *AListV2) Init(ctx context.Context, storage model.Storage) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(d.Addition.Address) > 0 && string(d.Addition.Address[len(d.Addition.Address)-1]) == "/" {
|
||||
d.Addition.Address = d.Addition.Address[0 : len(d.Addition.Address)-1]
|
||||
}
|
||||
// TODO login / refresh token
|
||||
//op.MustSaveDriverStorage(d)
|
||||
return err
|
||||
|
|
|
@ -30,6 +30,9 @@ func (d *AListV3) Init(ctx context.Context, storage model.Storage) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(d.Addition.Address) > 0 && string(d.Addition.Address[len(d.Addition.Address)-1]) == "/" {
|
||||
d.Addition.Address = d.Addition.Address[0 : len(d.Addition.Address)-1]
|
||||
}
|
||||
// TODO login / refresh token
|
||||
//op.MustSaveDriverStorage(d)
|
||||
return err
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/alist-org/alist/v3/internal/driver"
|
||||
|
@ -34,6 +35,9 @@ func (d *SMB) Init(ctx context.Context, storage model.Storage) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if strings.Index(d.Addition.Address, ":") < 0{
|
||||
d.Addition.Address = d.Addition.Address + ":445"
|
||||
}
|
||||
return d.initFS()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue