Check if url is for product and removed test url parts.
This commit is contained in:
+7
-7
@@ -39,8 +39,9 @@ fn main() -> Result<(), csv::Error> {
|
||||
temp_target_url.remove(0);
|
||||
}
|
||||
|
||||
temp_target_url.insert(0, String::from("public/lgw")); // For testing environment
|
||||
temp_target_url.remove(temp_target_url.len() - 2); // Remove number before product name
|
||||
if temp_target_url.len() > 2 && temp_target_url[temp_target_url.len() - 2].parse::<i32>().ok().is_some() {
|
||||
temp_target_url.remove(temp_target_url.len() - 2); // Remove number before product name
|
||||
}
|
||||
|
||||
if !record.attr1.clone().unwrap().eq("NULL") {
|
||||
temp_target_url.push(record.attr1.unwrap()); // Add article number if not null
|
||||
@@ -52,7 +53,6 @@ fn main() -> Result<(), csv::Error> {
|
||||
|
||||
// Build source url
|
||||
let mut source_url_vec: Vec<String> = Vec::new();
|
||||
source_url_vec.insert(0, String::from("public/lgw")); // For testing environment
|
||||
source_url_vec.push(record.path);
|
||||
|
||||
// Combine source url
|
||||
@@ -62,13 +62,13 @@ fn main() -> Result<(), csv::Error> {
|
||||
let id = record.subshop_id.unwrap();
|
||||
|
||||
if id.clone().eq("3") { // Lodner Geschmackswelten
|
||||
sales_channel = "01963bc08ea57102bf347e203eaa9e63";
|
||||
sales_channel = "0197660872e672e9ba3140ddf689f4fb";
|
||||
} else if id.clone().eq("1") { // Lodner Gewürze
|
||||
sales_channel = "01963bc08e987236ac5285e480769684";
|
||||
sales_channel = "0197660872d9706581cbe77994a4caa1";
|
||||
} else if id.clone().eq("2") { // Pfefferkontor
|
||||
sales_channel = "01963bc08ea0717892a3c86b4eefbd06";
|
||||
sales_channel = "0197660872e1717c9854226725628bf7";
|
||||
} else if id.eq("4") { // Crazy Snack
|
||||
sales_channel = "01963bc08eab702d852109975a1b0527";
|
||||
sales_channel = "0197660872ea73468ba300fc2cb73d35";
|
||||
} else { // Set for all when no subshop id
|
||||
sales_channel = "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user