mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
[markers] ignore generating markers past end (#6290)
This commit is contained in:
parent
367b96df0f
commit
33b59e02af
1 changed files with 6 additions and 0 deletions
|
|
@ -107,6 +107,12 @@ func (t *GenerateMarkersTask) generateMarker(videoFile *models.VideoFile, scene
|
||||||
sceneHash := scene.GetHash(t.fileNamingAlgorithm)
|
sceneHash := scene.GetHash(t.fileNamingAlgorithm)
|
||||||
seconds := float64(sceneMarker.Seconds)
|
seconds := float64(sceneMarker.Seconds)
|
||||||
|
|
||||||
|
// check if marker past duration
|
||||||
|
if seconds > float64(videoFile.Duration) {
|
||||||
|
logger.Warnf("[generator] scene marker at %.2f seconds exceeds video duration of %.2f seconds, skipping", seconds, float64(videoFile.Duration))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
g := t.generator
|
g := t.generator
|
||||||
|
|
||||||
if err := g.MarkerPreviewVideo(context.TODO(), videoFile.Path, sceneHash, seconds, sceneMarker.EndSeconds, instance.Config.GetPreviewAudio()); err != nil {
|
if err := g.MarkerPreviewVideo(context.TODO(), videoFile.Path, sceneHash, seconds, sceneMarker.EndSeconds, instance.Config.GetPreviewAudio()); err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue