Added scene and image file deletion logging (#4004)

This commit is contained in:
Flashy78 2023-08-07 16:34:05 -07:00 committed by GitHub
parent d0c60bab50
commit 8ac3353103
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -5,6 +5,7 @@ import (
"github.com/stashapp/stash/pkg/file"
"github.com/stashapp/stash/pkg/fsutil"
"github.com/stashapp/stash/pkg/logger"
"github.com/stashapp/stash/pkg/models"
"github.com/stashapp/stash/pkg/models/paths"
)
@ -106,6 +107,7 @@ func (s *Service) deleteFiles(ctx context.Context, i *models.Image, fileDeleter
// don't delete files in zip archives
const deleteFile = true
if f.Base().ZipFileID == nil {
logger.Info("Deleting image file: ", f.Base().Path)
if err := file.Destroy(ctx, s.File, f, fileDeleter.Deleter, deleteFile); err != nil {
return err
}

View file

@ -7,6 +7,7 @@ import (
"github.com/stashapp/stash/pkg/file"
"github.com/stashapp/stash/pkg/file/video"
"github.com/stashapp/stash/pkg/fsutil"
"github.com/stashapp/stash/pkg/logger"
"github.com/stashapp/stash/pkg/models"
"github.com/stashapp/stash/pkg/models/paths"
)
@ -166,6 +167,7 @@ func (s *Service) deleteFiles(ctx context.Context, scene *models.Scene, fileDele
}
const deleteFile = true
logger.Info("Deleting scene file: ", f.Path)
if err := file.Destroy(ctx, s.File, f, fileDeleter.Deleter, deleteFile); err != nil {
return err
}