Skip to content

Commit af16a1d

Browse files
committed
bugfix: don't append Default Title to product names
1 parent 26f35d3 commit af16a1d

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

server/src/bin/crawl-worker.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,20 @@ fn create_chunk_req_payload(
102102
variant.id
103103
);
104104

105-
let mut chunk_html = format!(
106-
"<h1>{} - {}</h1>{}",
107-
product.title.clone().unwrap_or_default(),
108-
variant.title.clone().unwrap_or_default(),
109-
product.body_html.clone().unwrap_or_default()
110-
);
105+
let mut chunk_html = if variant.title == "Default Title" {
106+
format!(
107+
"<h1>{}</h1>{}",
108+
product.title.clone().unwrap_or_default(),
109+
product.body_html.clone().unwrap_or_default()
110+
)
111+
} else {
112+
format!(
113+
"<h1>{} - {}</h1>{}",
114+
product.title.clone().unwrap_or_default(),
115+
variant.title.clone().unwrap_or_default(),
116+
product.body_html.clone().unwrap_or_default()
117+
)
118+
};
111119

112120
if let Some(ScrapeOptions::Shopify(CrawlShopifyOptions {
113121
tag_regexes: Some(tag_regexes),

0 commit comments

Comments
 (0)