Skip to content

Commit

Permalink
Fix scene marker merging (stashapp#4446)
Browse files Browse the repository at this point in the history
  • Loading branch information
DingDongSoLong4 authored and dogwithakeyboard committed Feb 18, 2024
1 parent c2f13b5 commit 707323b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/scene/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"os"
"path/filepath"

"github.com/stashapp/stash/pkg/fsutil"
"github.com/stashapp/stash/pkg/logger"
Expand Down Expand Up @@ -129,6 +130,12 @@ func (s *Service) mergeSceneMarkers(ctx context.Context, dest *models.Scene, src
destExists, _ := fsutil.FileExists(e.dest)

if srcExists && !destExists {
destDir := filepath.Dir(e.dest)
if err := fsutil.EnsureDir(destDir); err != nil {
logger.Errorf("Error creating generated marker folder %s: %v", destDir, err)
continue
}

if err := os.Rename(e.src, e.dest); err != nil {
logger.Errorf("Error renaming generated marker file from %s to %s: %v", e.src, e.dest, err)
}
Expand Down

0 comments on commit 707323b

Please sign in to comment.