🐛 Forbid MediaTrack to create a new folder with the same name
This commit is contained in:
@ -156,6 +156,10 @@ func (driver MediaTrack) Preview(path string, account *model.Account) (interface
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (driver MediaTrack) MakeDir(path string, account *model.Account) error {
|
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)
|
parentFile, err := driver.File(utils.Dir(path), account)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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) {
|
func isPathExist(ctx context.Context, fs *FileSystem, path string) (bool, FileInfo) {
|
||||||
file, err := fs.File(path)
|
file, err := fs.File(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Debug(err)
|
log.Debug(path, err)
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
return true, file
|
return true, file
|
||||||
|
Reference in New Issue
Block a user