mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 16:34:02 +01:00
Added scene and image file deletion logging (#4004)
This commit is contained in:
parent
d0c60bab50
commit
8ac3353103
2 changed files with 4 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ import (
|
||||||
|
|
||||||
"github.com/stashapp/stash/pkg/file"
|
"github.com/stashapp/stash/pkg/file"
|
||||||
"github.com/stashapp/stash/pkg/fsutil"
|
"github.com/stashapp/stash/pkg/fsutil"
|
||||||
|
"github.com/stashapp/stash/pkg/logger"
|
||||||
"github.com/stashapp/stash/pkg/models"
|
"github.com/stashapp/stash/pkg/models"
|
||||||
"github.com/stashapp/stash/pkg/models/paths"
|
"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
|
// don't delete files in zip archives
|
||||||
const deleteFile = true
|
const deleteFile = true
|
||||||
if f.Base().ZipFileID == nil {
|
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 {
|
if err := file.Destroy(ctx, s.File, f, fileDeleter.Deleter, deleteFile); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"github.com/stashapp/stash/pkg/file"
|
"github.com/stashapp/stash/pkg/file"
|
||||||
"github.com/stashapp/stash/pkg/file/video"
|
"github.com/stashapp/stash/pkg/file/video"
|
||||||
"github.com/stashapp/stash/pkg/fsutil"
|
"github.com/stashapp/stash/pkg/fsutil"
|
||||||
|
"github.com/stashapp/stash/pkg/logger"
|
||||||
"github.com/stashapp/stash/pkg/models"
|
"github.com/stashapp/stash/pkg/models"
|
||||||
"github.com/stashapp/stash/pkg/models/paths"
|
"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
|
const deleteFile = true
|
||||||
|
logger.Info("Deleting scene file: ", f.Path)
|
||||||
if err := file.Destroy(ctx, s.File, f, fileDeleter.Deleter, deleteFile); err != nil {
|
if err := file.Destroy(ctx, s.File, f, fileDeleter.Deleter, deleteFile); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue