mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-23 06:33:42 +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
@@ -60,7 +60,56 @@ public:
|
||||
|
||||
static double constexpr kInvalidRating = 0;
|
||||
double m_overallRating = kInvalidRating;
|
||||
uint32_t m_placeID = 0;
|
||||
};
|
||||
|
||||
class KayakPlace
|
||||
{
|
||||
enum Fields
|
||||
{
|
||||
CountryCode = 0,
|
||||
CountryFileName,
|
||||
CountryName,
|
||||
HasHotels,
|
||||
HasImage,
|
||||
Hierarchy,
|
||||
IataCode,
|
||||
KayakCityID,
|
||||
KayakPlaceID,
|
||||
Latitude,
|
||||
Longitude,
|
||||
NumberOfHotels,
|
||||
PlaceFileName,
|
||||
PlaceID,
|
||||
PlaceName,
|
||||
PlaceType,
|
||||
Searchable,
|
||||
|
||||
Counter
|
||||
};
|
||||
|
||||
public:
|
||||
explicit KayakPlace(std::string src);
|
||||
|
||||
friend std::string DebugPrint(KayakPlace const & p);
|
||||
|
||||
uint32_t m_placeID, m_kayakCityID;
|
||||
bool m_good = false;
|
||||
};
|
||||
|
||||
using BaseDatasetT = SponsoredDataset<KayakHotel>;
|
||||
class KayakDataset : public BaseDatasetT
|
||||
{
|
||||
std::unordered_map<uint32_t, uint32_t> m_place2kayak;
|
||||
|
||||
public:
|
||||
KayakDataset(std::string const & hotelsPath, std::string const & placesPath);
|
||||
|
||||
uint32_t GetKayakCityID(uint32_t placeID) const
|
||||
{
|
||||
auto it = m_place2kayak.find(placeID);
|
||||
return it != m_place2kayak.end() ? it->second : 0;
|
||||
}
|
||||
};
|
||||
|
||||
using KayakDataset = SponsoredDataset<KayakHotel>;
|
||||
} // namespace generator
|
||||
|
||||
Reference in New Issue
Block a user