Skip to content

Commit

Permalink
fix: nutriscore misc_tags removal (#9765)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanegigandet authored and john-gom committed May 24, 2024
1 parent 282be68 commit a8fe455
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/ProductOpener/Food.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1693,6 +1693,11 @@ sub remove_nutriscore_fields ($product_ref) {
]
);

# remove misc_tags fields related to Nutri-Score
if (defined $product_ref->{misc_tags}) {
$product_ref->{misc_tags} = [grep {$_ !~ /^en:(nutriscore|nutrition)-/} @{$product_ref->{misc_tags}}];
}

return;
}

Expand Down
1 change: 0 additions & 1 deletion scripts/update_all_products.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,6 @@
}

if ($compute_nutriscore) {
$product_ref->{misc_tags} = [];
fix_salt_equivalent($product_ref);
compute_nutriscore($product_ref);
compute_nutrient_levels($product_ref);
Expand Down

0 comments on commit a8fe455

Please sign in to comment.