mirror of https://github.com/Xhofe/alist
🐛 fix can't get file
parent
f9945a14a8
commit
0b8d3a0a2c
|
@ -126,6 +126,7 @@ func (driver Pan123) GetFiles(parentId string, account *model.Account) ([]Pan123
|
||||||
|
|
||||||
func (driver Pan123) GetFile(path string, account *model.Account) (*Pan123File, error) {
|
func (driver Pan123) GetFile(path string, account *model.Account) (*Pan123File, error) {
|
||||||
dir, name := filepath.Split(path)
|
dir, name := filepath.Split(path)
|
||||||
|
dir = utils.ParsePath(dir)
|
||||||
_, err := driver.Files(dir, account)
|
_, err := driver.Files(dir, account)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -134,7 +135,7 @@ func (driver Pan123) GetFile(path string, account *model.Account) (*Pan123File,
|
||||||
parentFiles, _ := parentFiles_.([]Pan123File)
|
parentFiles, _ := parentFiles_.([]Pan123File)
|
||||||
for _, file := range parentFiles {
|
for _, file := range parentFiles {
|
||||||
if file.FileName == name {
|
if file.FileName == name {
|
||||||
if file.Type != 1 {
|
if file.Type != conf.FOLDER {
|
||||||
return &file, err
|
return &file, err
|
||||||
} else {
|
} else {
|
||||||
return nil, drivers.NotFile
|
return nil, drivers.NotFile
|
||||||
|
|
|
@ -112,6 +112,7 @@ func (driver AliDrive) GetFiles(fileId string, account *model.Account) ([]AliFil
|
||||||
|
|
||||||
func (driver AliDrive) GetFile(path string, account *model.Account) (*AliFile, error) {
|
func (driver AliDrive) GetFile(path string, account *model.Account) (*AliFile, error) {
|
||||||
dir, name := filepath.Split(path)
|
dir, name := filepath.Split(path)
|
||||||
|
dir = utils.ParsePath(dir)
|
||||||
_, err := driver.Files(dir, account)
|
_, err := driver.Files(dir, account)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue