Skip to content

Commit

Permalink
bugfix: don't append Default Title to product names
Browse files Browse the repository at this point in the history
  • Loading branch information
densumesh authored and skeptrunedev committed Jan 9, 2025
1 parent a0c2173 commit 394b940
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions server/src/bin/crawl-worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,20 @@ fn create_chunk_req_payload(
variant.id
);

let mut chunk_html = format!(
"<h1>{} - {}</h1>{}",
product.title.clone().unwrap_or_default(),
variant.title.clone().unwrap_or_default(),
product.body_html.clone().unwrap_or_default()
);
let mut chunk_html = if variant.title == Some("Default Title".to_string()) {
format!(
"<h1>{}</h1>{}",
product.title.clone().unwrap_or_default(),
product.body_html.clone().unwrap_or_default()
)
} else {
format!(
"<h1>{} - {}</h1>{}",
product.title.clone().unwrap_or_default(),
variant.title.clone().unwrap_or_default(),
product.body_html.clone().unwrap_or_default()
)
};

if let Some(ScrapeOptions::Shopify(CrawlShopifyOptions {
tag_regexes: Some(tag_regexes),
Expand Down

0 comments on commit 394b940

Please sign in to comment.