From 9ed7f7f2f2e32197924468d8f7e2a82f498dc680 Mon Sep 17 00:00:00 2001 From: goulven Date: Tue, 8 Oct 2024 10:33:35 +0200 Subject: [PATCH] Categories cleanup --- .../open4goods/commons/services/VerticalsConfigService.java | 4 +++- verticals/src/main/resources/verticals/tv.yml | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/commons/src/main/java/org/open4goods/commons/services/VerticalsConfigService.java b/commons/src/main/java/org/open4goods/commons/services/VerticalsConfigService.java index a42fd151d..dbdad5b74 100644 --- a/commons/src/main/java/org/open4goods/commons/services/VerticalsConfigService.java +++ b/commons/src/main/java/org/open4goods/commons/services/VerticalsConfigService.java @@ -4,6 +4,7 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -220,8 +221,9 @@ public VerticalConfig getVerticalForCategories(Set categories) { // Discarding if unmatching category if (null != vc) { - if (vc.getUnmatchingCategories().contains(category)) { + if (!Collections.disjoint(vc.getUnmatchingCategories(), categories)) { vc = null; + break; } } diff --git a/verticals/src/main/resources/verticals/tv.yml b/verticals/src/main/resources/verticals/tv.yml index f8cf5130a..504c5ccec 100644 --- a/verticals/src/main/resources/verticals/tv.yml +++ b/verticals/src/main/resources/verticals/tv.yml @@ -51,6 +51,9 @@ matchingCategories: # The categories that disengage a mapping in this vertical unmatchingCategories: - "HIFI>APPAREILS-PHOTO" +- "TV - VIDEO - SON | TV - VIDEO - SON > ACCESSOIRES TV - VIDEO - SON > FIXATION TV - SUPPORT TV - SUPPORT MURAL POUR TV | ACCESSOIRES TV - VIDEO - SON | FIXATION TV - SUPPORT TV - SUPPORT MURAL POUR TV" +- "ACCESSOIRES DE TV" +- "TV, VIDEO, HOME CINEMA | TV, VIDEO, HOME CINEMA>TELEVISEUR>SUPPORT MURAL POUR ECRAN PLAT | TELEVISEUR | TV, VIDEO, HOME CINEMA" ##################################################################################################################################### # I18N CONFIGURATION