From 46c161492be85137d9c38e88c60be80df378108a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Rodrigo?= Date: Mon, 8 Apr 2024 18:06:04 +0200 Subject: [PATCH] More hosting tags in apidae --- datasources/sources/apidae.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/datasources/sources/apidae.rb b/datasources/sources/apidae.rb index a8806c4..a6f75c6 100644 --- a/datasources/sources/apidae.rb +++ b/datasources/sources/apidae.rb @@ -359,12 +359,17 @@ def map_tags(feat) ] } || {}).compact_blank, 'capacity:persons': (jp(r, 'informationsHebergementLocatif.capacite.capaciteHebergement').first || jp(r, 'informationsHebergementLocatif.capacite.capaciteMaximumPossible').first)&.nonzero?, - 'capacity:rooms': jp(r, 'informationsHebergementLocatif.capacite.nombreChambres').first&.nonzero?, + 'capacity:rooms': (jp(r, 'informationsHebergementLocatif.capacite.nombreChambres').first || jp(r, 'informationsHotellerie.capacite.nombreChambresDeclareesHotelier').first)&.nonzero?, 'capacity:beds': [jp(r, 'informationsHebergementLocatif.capacite.nombreLitsSimples').first, jp(r, 'informationsHebergementLocatif.capacite.nombreLitsDoubles').first].compact_blank.presence&.sum&.nonzero?, + 'capacity:pitches': jp(r, 'informationsHotelleriePleinAir.capacite.nombreEmplacementsClasses').first&.nonzero?, opening_hours: osm_openning_hours, start_date: r['type'] == 'FETE_ET_MANIFESTATION' ? date_on : nil, end_date: r['type'] == 'FETE_ET_MANIFESTATION' ? date_off : nil, - stars: self.class.classs(r.dig('informationsHotellerie', 'classement', 'ordre')), + stars: self.class.classs( + r.dig('informationsHotellerie', 'classement', 'ordre') || + r.dig('informationsHebergementLocatif', 'classementPrefectoral', 'ordre') || + r.dig('informationsHotelleriePleinAir', 'classement', 'ordre') + ), # event: r.dig('informationsFeteEtManifestation', 'typesManifestation').nil? ? nil : self.class.event(r.dig('informationsFeteEtManifestation', 'typesManifestation')) } end