mirror of https://github.com/Xhofe/alist
🐛 Forbid MediaTrack to create a new folder with the same name
parent
8245da485a
commit
07d6ca27db
|
@ -156,6 +156,10 @@ func (driver MediaTrack) Preview(path string, account *model.Account) (interface
|
|||
}
|
||||
|
||||
func (driver MediaTrack) MakeDir(path string, account *model.Account) error {
|
||||
_, err := driver.File(path, account)
|
||||
if err != base.ErrPathNotFound {
|
||||
return nil
|
||||
}
|
||||
parentFile, err := driver.File(utils.Dir(path), account)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -46,7 +46,7 @@ func (h *Handler) stripPrefix(p string) (string, int, error) {
|
|||
func isPathExist(ctx context.Context, fs *FileSystem, path string) (bool, FileInfo) {
|
||||
file, err := fs.File(path)
|
||||
if err != nil {
|
||||
log.Debug(err)
|
||||
log.Debug(path, err)
|
||||
return false, nil
|
||||
}
|
||||
return true, file
|
||||
|
|
Loading…
Reference in New Issue