mirror of
https://github.com/stashapp/stash.git
synced 2025-12-10 10:13:54 -06:00
[markers] ignore generating markers past end (#6290)
This commit is contained in:
parent
367b96df0f
commit
33b59e02af
@ -107,6 +107,12 @@ func (t *GenerateMarkersTask) generateMarker(videoFile *models.VideoFile, scene
|
||||
sceneHash := scene.GetHash(t.fileNamingAlgorithm)
|
||||
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
|
||||
|
||||
if err := g.MarkerPreviewVideo(context.TODO(), videoFile.Path, sceneHash, seconds, sceneMarker.EndSeconds, instance.Config.GetPreviewAudio()); err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user