Normalize briefing module options and weather stories

This commit is contained in:
2026-08-13 00:53:31 +00:00
parent 730929e2ed
commit 9b4e53702b
12 changed files with 188 additions and 19 deletions

View File

@@ -305,16 +305,20 @@ func (b *bundleBuilder) fetchDiscussion(ctx context.Context) error {
func (b *bundleBuilder) fetchWeatherStory(ctx context.Context) error {
var story weatherdata.WeatherStory
fetched, ok, err := b.fetchDecodedSource(ctx, sourceRequest{
request := sourceRequest{
name: config.MissingSourceWeatherStory,
endpoint: "/weatherstories/latest",
query: queryOptions{omitUnits: true},
missingMessage: "NWS weather story data is missing",
}, &story)
}
fetched, ok, err := b.fetchDecodedSource(ctx, request, &story)
if err != nil || !ok {
return err
}
source := fetched.source
if !story.HasUsableContent() {
return b.handleMalformed(&source, fmt.Errorf("weather story has no usable content"), request)
}
if !story.StartTime.IsZero() {
source.IssuedAt = &story.StartTime
}