feat(discovery): persist video duration_s instead of discarding it (ADR-028)
ADR-023's filterLowValue already fetches each candidate's duration via the cheap videos.list quota call to drop Shorts/live, then threw it away — the videos.duration_s column (migration 001) was never written. Carry it onto the kept domain.Video and have UpsertVideo persist it, COALESCE-preserving a known value so an unknown (0) re-upsert never clobbers it (the channel_title backfill stance, migration 014). This is the enabling change for length-aware burst selection. No new migration — the column already exists.
This commit is contained in:
@@ -302,6 +302,10 @@ func (a *Adapter) filterLowValue(ctx context.Context, client *http.Client, video
|
||||
if m.seconds > 0 && m.seconds < a.cfg.MinVideoSeconds {
|
||||
continue // Short / sub-threshold clip
|
||||
}
|
||||
// Carry the duration we already fetched onto the kept video so the store
|
||||
// can persist it (ADR-028) — the burst's length-aware selection depends on
|
||||
// it. Discarding it here was the gap the onboarding investigation found.
|
||||
v.DurationSeconds = m.seconds
|
||||
kept = append(kept, v)
|
||||
}
|
||||
return kept
|
||||
|
||||
Reference in New Issue
Block a user