mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 11:39:46 +08:00
fix: remove files
This commit is contained in:
@@ -72,6 +72,6 @@ func (l *LocalStorage) UploadProgress() float64 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *LocalStorage) RemoveAll(path string) error {
|
func (l *LocalStorage) RemoveAll(path string) error {
|
||||||
return os.RemoveAll(path)
|
return os.RemoveAll(filepath.Join(l.dir, path))
|
||||||
}
|
}
|
||||||
@@ -87,5 +87,5 @@ func (w *WebdavStorage) UploadProgress() float64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *WebdavStorage) RemoveAll(path string) error {
|
func (w *WebdavStorage) RemoveAll(path string) error {
|
||||||
return w.fs.RemoveAll(path)
|
return w.fs.RemoveAll(filepath.Join(w.dir, path))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,6 +186,8 @@ func (s *Server) DeleteFromWatchlist(c *gin.Context) (interface{}, error) {
|
|||||||
} else {
|
} else {
|
||||||
if err := st.RemoveAll(m.TargetDir); err != nil {
|
if err := st.RemoveAll(m.TargetDir); err != nil {
|
||||||
log.Warnf("remove all : %v", err)
|
log.Warnf("remove all : %v", err)
|
||||||
|
} else {
|
||||||
|
log.Infof("delete media files success: %v", m.TargetDir)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user