mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
[Files Refactor] Bug fixes (#2868)
* Return error if multiple rows returned for id * Add missing LoadFiles calls * Show id if path is empty
This commit is contained in:
@@ -161,6 +161,10 @@ func (s *Service) Destroy(ctx context.Context, scene *models.Scene, fileDeleter
|
||||
|
||||
// deleteFiles deletes files from the database and file system
|
||||
func (s *Service) deleteFiles(ctx context.Context, scene *models.Scene, fileDeleter *FileDeleter) error {
|
||||
if err := scene.LoadFiles(ctx, s.Repository); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, f := range scene.Files.List() {
|
||||
// only delete files where there is no other associated scene
|
||||
otherScenes, err := s.Repository.FindByFileID(ctx, f.ID)
|
||||
|
||||
Reference in New Issue
Block a user