diff --git a/pkg/storage/local.go b/pkg/storage/local.go index 2b8f752..60d4cf0 100644 --- a/pkg/storage/local.go +++ b/pkg/storage/local.go @@ -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)) } \ No newline at end of file diff --git a/pkg/storage/webdav.go b/pkg/storage/webdav.go index 493040e..352b391 100644 --- a/pkg/storage/webdav.go +++ b/pkg/storage/webdav.go @@ -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)) } diff --git a/server/watchlist.go b/server/watchlist.go index 75de588..cdb8fb0 100644 --- a/server/watchlist.go +++ b/server/watchlist.go @@ -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) } } }