mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 05:13:58 +00:00
Assign external URI for Kayak hotels.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
e7c04c5459
commit
6368ba477f
@@ -594,7 +594,7 @@ size_t FeatureBuilder::GetPointsCount() const
|
||||
return counter;
|
||||
}
|
||||
|
||||
void FeatureBuilder::SetHotelInfo(Metadata::ESource src, uint64_t id, double rating, uint8_t priceCategory)
|
||||
void FeatureBuilder::SetHotelInfo(std::string uri, double rating)
|
||||
{
|
||||
// Normalize rating [0, 100]
|
||||
if (rating < 0 || rating > 10)
|
||||
@@ -603,18 +603,21 @@ void FeatureBuilder::SetHotelInfo(Metadata::ESource src, uint64_t id, double rat
|
||||
rating *= 10;
|
||||
|
||||
auto & meta = GetMetadata();
|
||||
auto const append = [src, &meta](Metadata::EType type, auto val)
|
||||
auto const append = [src = Metadata::ESource::SRC_KAYAK, &meta](Metadata::EType type, auto val)
|
||||
{
|
||||
indexer::CustomKeyValue kv(meta.Get(type));
|
||||
kv.Add(src, val);
|
||||
meta.Set(type, kv.ToString());
|
||||
};
|
||||
|
||||
append(Metadata::FMD_CUSTOM_IDS, id);
|
||||
meta.Set(Metadata::FMD_EXTERNAL_URI, std::move(uri));
|
||||
|
||||
// append(Metadata::FMD_CUSTOM_IDS, id);
|
||||
|
||||
if (rating > 0)
|
||||
append(Metadata::FMD_RATINGS, static_cast<uint8_t>(std::round(rating)));
|
||||
if (priceCategory > 0)
|
||||
append(Metadata::FMD_PRICE_RATES, priceCategory);
|
||||
// if (priceCategory > 0)
|
||||
// append(Metadata::FMD_PRICE_RATES, priceCategory);
|
||||
}
|
||||
|
||||
bool FeatureBuilder::IsDrawableInRange(int lowScale, int highScale) const
|
||||
|
||||
Reference in New Issue
Block a user