🐛 Forbid MediaTrack to create a new folder with the same name

This commit is contained in:
微凉
2022-01-16 13:21:29 +08:00
parent 8245da485a
commit 07d6ca27db
2 changed files with 5 additions and 1 deletions

View File

@ -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