Skip to content

Commit

Permalink
fix: remove files
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-ding committed Dec 11, 2024
1 parent 6d127c6 commit 3cf48d1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/storage/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ func (l *LocalStorage) UploadProgress() float64 {
return 0
}

func (i *LocalStorage) RemoveAll(path string) error {
return os.RemoveAll(path)
func (l *LocalStorage) RemoveAll(path string) error {
return os.RemoveAll(filepath.Join(l.dir, path))
}
2 changes: 1 addition & 1 deletion pkg/storage/webdav.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ func (w *WebdavStorage) UploadProgress() float64 {
}

func (w *WebdavStorage) RemoveAll(path string) error {
return w.fs.RemoveAll(path)
return w.fs.RemoveAll(filepath.Join(w.dir, path))
}
2 changes: 2 additions & 0 deletions server/watchlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ func (s *Server) DeleteFromWatchlist(c *gin.Context) (interface{}, error) {
} else {
if err := st.RemoveAll(m.TargetDir); err != nil {
log.Warnf("remove all : %v", err)
} else {
log.Infof("delete media files success: %v", m.TargetDir)
}
}
}
Expand Down

0 comments on commit 3cf48d1

Please sign in to comment.