mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Added scene and image file deletion logging (#4004)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user