fix
This commit is contained in:
@@ -879,6 +879,8 @@ type jobScopedCache struct {
|
||||
canUseAI bool
|
||||
allowEPREL bool
|
||||
remainingCredits int
|
||||
// omitSEOMeta skips meta_title / meta_description enhance + free-template fill (A1).
|
||||
omitSEOMeta bool
|
||||
}
|
||||
|
||||
func (c *jobScopedCache) stepPolicy() StepPolicy {
|
||||
@@ -927,6 +929,7 @@ func (p *Pipeline) loadJobScopedCache(ctx context.Context, companyID, jobID uuid
|
||||
}
|
||||
}
|
||||
}
|
||||
cache.omitSEOMeta = companyOmitsSEOMeta(ctx, p, companyID)
|
||||
if p.Prompts != nil {
|
||||
cache.enhanceByLang = make(map[string]PromptTemplates, len(cache.contentLanguages)+1)
|
||||
langs := cache.contentLanguages
|
||||
@@ -1526,6 +1529,9 @@ func (p *Pipeline) processOne(ctx context.Context, companyID, jobID uuid.UUID, i
|
||||
CompanyID: companyID.String(),
|
||||
RawProductID: it.RawID.String(),
|
||||
}
|
||||
if cache != nil {
|
||||
in.OmitSEOMeta = cache.omitSEOMeta
|
||||
}
|
||||
if it.hydrated {
|
||||
if it.hasPrior {
|
||||
in.PriorProcessedName = it.priorName
|
||||
@@ -1592,7 +1598,18 @@ func (p *Pipeline) processOne(ctx context.Context, companyID, jobID uuid.UUID, i
|
||||
result.ProcessedAttributes = result.Attributes
|
||||
}
|
||||
// Free template SEO meta when enhance did not emit meta_* (no FillMetaAI / no extra credits).
|
||||
if strings.TrimSpace(result.MetaTitle) == "" || strings.TrimSpace(result.MetaDescription) == "" {
|
||||
// A1 cohort omits SEO meta entirely (not needed for their storefront).
|
||||
if cache != nil && cache.omitSEOMeta {
|
||||
result.MetaTitle = ""
|
||||
result.MetaDescription = ""
|
||||
if result.LocalizedContent != nil {
|
||||
for lang, lf := range result.LocalizedContent {
|
||||
lf.MetaTitle = ""
|
||||
lf.MetaDescription = ""
|
||||
result.LocalizedContent[lang] = lf
|
||||
}
|
||||
}
|
||||
} else if strings.TrimSpace(result.MetaTitle) == "" || strings.TrimSpace(result.MetaDescription) == "" {
|
||||
mt, md := fillMetaFromResult(result)
|
||||
if strings.TrimSpace(result.MetaTitle) == "" {
|
||||
result.MetaTitle = mt
|
||||
|
||||
Reference in New Issue
Block a user