diff --git a/pkg/api/files.go b/pkg/api/files.go index 7e3e2a16c..4d41e7d33 100644 --- a/pkg/api/files.go +++ b/pkg/api/files.go @@ -323,6 +323,7 @@ func removeFileByFileId(fileId uint) models.Scene { err := db.Preload("Volume").Where(&models.File{ID: fileId}).First(&file).Error if err == nil { + log.Infof("Deleting file %s", filepath.Join(file.Path, file.Filename)) deleted := false switch file.Volume.Type { case "local": diff --git a/pkg/api/heresphere.go b/pkg/api/heresphere.go index 0581a5fa2..e6fcd5975 100644 --- a/pkg/api/heresphere.go +++ b/pkg/api/heresphere.go @@ -238,6 +238,7 @@ func (i HeresphereResource) getHeresphereFile(req *restful.Request, resp *restfu Media: media, } if requestData.DeleteFiles != nil && config.Config.Interfaces.Heresphere.AllowFileDeletes { + log.Infof("Got request by HereSphere to delete file %v", file.Filename) removeFileByFileId(file.ID) } @@ -879,6 +880,7 @@ func ProcessHeresphereUpdates(scene *models.Scene, requestData HereSphereAuthReq } if requestData.DeleteFiles != nil && config.Config.Interfaces.Heresphere.AllowFileDeletes { + log.Infof("Got request by HereSphere to delete files for scene %v", scene.ID) for _, sceneFile := range scene.Files { removeFileByFileId(sceneFile.ID) } @@ -887,7 +889,7 @@ func ProcessHeresphereUpdates(scene *models.Scene, requestData HereSphereAuthReq if requestData.Hsp != nil && config.Config.Interfaces.Heresphere.AllowHspData { hspContent, err := base64.StdEncoding.DecodeString(*requestData.Hsp) if err != nil { - log.Error("Error decoding heresphere hsp data %v", err) + log.Errorf("Error decoding heresphere hsp data %v", err) } fName := filepath.Join(scene.Files[0].Path, strings.TrimSuffix(scene.Files[0].Filename, filepath.Ext(videoFile.Filename))+".hsp")