fix
This commit is contained in:
@@ -1591,8 +1591,32 @@ func (p *Pipeline) processOne(ctx context.Context, companyID, jobID uuid.UUID, i
|
||||
if len(result.ProcessedAttributes) == 0 {
|
||||
result.ProcessedAttributes = result.Attributes
|
||||
}
|
||||
// Free template SEO meta (no FillMetaAI / no extra credits).
|
||||
result.MetaTitle, result.MetaDescription = fillMetaFromResult(result)
|
||||
// Free template SEO meta when enhance did not emit meta_* (no FillMetaAI / no extra credits).
|
||||
if strings.TrimSpace(result.MetaTitle) == "" || strings.TrimSpace(result.MetaDescription) == "" {
|
||||
mt, md := fillMetaFromResult(result)
|
||||
if strings.TrimSpace(result.MetaTitle) == "" {
|
||||
result.MetaTitle = mt
|
||||
}
|
||||
if strings.TrimSpace(result.MetaDescription) == "" {
|
||||
result.MetaDescription = md
|
||||
}
|
||||
}
|
||||
// Keep primary localized meta in sync with row-level fields used by upsert.
|
||||
if primary := company.NormalizeLanguage(language); primary != "" && result.LocalizedContent != nil {
|
||||
lf := company.FieldsForLanguage(result.LocalizedContent, primary)
|
||||
changed := false
|
||||
if lf.MetaTitle == "" && result.MetaTitle != "" {
|
||||
lf.MetaTitle = result.MetaTitle
|
||||
changed = true
|
||||
}
|
||||
if lf.MetaDescription == "" && result.MetaDescription != "" {
|
||||
lf.MetaDescription = result.MetaDescription
|
||||
changed = true
|
||||
}
|
||||
if changed {
|
||||
result.LocalizedContent[primary] = lf
|
||||
}
|
||||
}
|
||||
|
||||
attrsJSON, procAttrsJSON, gptJSON, sourcesJSON, err := marshalProcessOnePayload(result)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user