Replace os.Rename with util.SafeMove to allow cross device moving to not fail. (#745)

Fixed annoyingly noisy transcoding progress log messages.
Fixed minor minor issue with directories than are named "blah.mp4" being detected as files to be scanned.
This commit is contained in:
JoeSmithStarkers
2020-08-21 17:57:07 +10:00
committed by GitHub
parent 6a3588e4e0
commit 85aa1d8790
7 changed files with 70 additions and 14 deletions

View File

@@ -1,7 +1,6 @@
package manager
import (
"os"
"path/filepath"
"strconv"
"sync"
@@ -96,7 +95,7 @@ func (t *GenerateMarkersTask) generateMarker(videoFile *ffmpeg.VideoFile, scene
if err := encoder.SceneMarkerVideo(*videoFile, options); err != nil {
logger.Errorf("[generator] failed to generate marker video: %s", err)
} else {
_ = os.Rename(options.OutputPath, videoPath)
_ = utils.SafeMove(options.OutputPath, videoPath)
logger.Debug("created marker video: ", videoPath)
}
}
@@ -109,7 +108,7 @@ func (t *GenerateMarkersTask) generateMarker(videoFile *ffmpeg.VideoFile, scene
if err := encoder.SceneMarkerImage(*videoFile, options); err != nil {
logger.Errorf("[generator] failed to generate marker image: %s", err)
} else {
_ = os.Rename(options.OutputPath, imagePath)
_ = utils.SafeMove(options.OutputPath, imagePath)
logger.Debug("created marker image: ", imagePath)
}
}