From 9f8acb2b793d5d2cde22a7a970af006b7360ebb9 Mon Sep 17 00:00:00 2001 From: Speck Pratt Date: Wed, 29 Apr 2026 08:34:44 -0400 Subject: [PATCH] Use default duration on zero-interval markers; trim setting copy The marker form already permits end == start, so refusing to render in the generator was an inconsistent gate. Treat non-positive intervals the same as a missing end (fall back to markerPreviewDefaultDuration) while keeping the warning log for visibility into unexpected data. Also trims the max_marker_preview_duration_desc copy to match the tone of neighboring setting descriptions. Co-Authored-By: Claude Opus 4.7 (1M context) --- pkg/scene/generate/marker_preview.go | 16 +++++++--------- ui/v2.5/src/locales/en-GB.json | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/pkg/scene/generate/marker_preview.go b/pkg/scene/generate/marker_preview.go index 0f7e612a6..316816093 100644 --- a/pkg/scene/generate/marker_preview.go +++ b/pkg/scene/generate/marker_preview.go @@ -37,18 +37,16 @@ func (g Generator) MarkerPreviewVideo(ctx context.Context, input string, hash st duration := float64(markerPreviewDefaultDuration) - // Honor the marker's explicit interval when present and positive, capped - // by the configured safety ceiling. maxDuration <= 0 disables the ceiling. - // Non-positive intervals are treated as "no video wanted" and skipped — - // if the user intentionally set end = start they didn't want a preview, - // and if it's a data mistake we'd rather surface it than silently default. + // Honor the marker's explicit interval when present, capped by the configured + // safety ceiling. maxDuration <= 0 disables the ceiling. The marker form + // permits end == start, so a non-positive interval is treated the same as + // a missing end (fall back to the default duration) rather than refusing to + // render; the warning surfaces unexpected data without breaking generation. if endSeconds != nil { interval := *endSeconds - seconds if interval <= 0 { - logger.Warnf("[generator] marker at %.2fs has non-positive interval (end=%.2f); skipping video preview generation", seconds, *endSeconds) - return nil - } - if maxDuration <= 0 || interval <= float64(maxDuration) { + logger.Warnf("[generator] marker at %.2fs has non-positive interval (end=%.2f); using default duration", seconds, *endSeconds) + } else if maxDuration <= 0 || interval <= float64(maxDuration) { duration = interval } else { duration = float64(maxDuration) diff --git a/ui/v2.5/src/locales/en-GB.json b/ui/v2.5/src/locales/en-GB.json index d0e044dcc..330fa423f 100644 --- a/ui/v2.5/src/locales/en-GB.json +++ b/ui/v2.5/src/locales/en-GB.json @@ -418,7 +418,7 @@ "include_audio_desc": "Includes audio stream when generating previews.", "include_audio_head": "Include audio", "logging": "Logging", - "max_marker_preview_duration_desc": "Optional ceiling (in seconds) for marker preview videos with explicit end times. Default is 0 (no ceiling, the marker's end time is honored verbatim). Set a positive value to cap preview duration as a safety against imports or data entry mistakes. Markers without an end time use a fixed 20-second default, unaffected by this setting.", + "max_marker_preview_duration_desc": "Maximum duration (seconds) for marker previews. 0 disables the limit.", "max_marker_preview_duration_head": "Max marker preview duration", "maximum_streaming_transcode_size_desc": "Maximum size for transcoded streams.", "maximum_streaming_transcode_size_head": "Maximum streaming transcode size",