[guides on map] fix track duration parsing
This commit is contained in:
parent
4c975b40d6
commit
9d5109bdb5
1 changed files with 2 additions and 2 deletions
|
@ -57,14 +57,14 @@ void ParseGallery(std::string const & src, guides_on_map::GuidesOnMap & result)
|
|||
FromJSONObjectOptionalField(extraObj, "bookmark_count", info.m_bookmarksCount);
|
||||
FromJSONObject(extraObj, "has_track", info.m_hasTrack);
|
||||
FromJSONObjectOptionalField(extraObj, "tracks_length", info.m_tracksLength);
|
||||
auto const durationObj = json_object_get(obj, "tour_duration");
|
||||
auto const durationObj = json_object_get(extraObj, "tour_duration");
|
||||
if (json_is_object(durationObj))
|
||||
{
|
||||
int duration;
|
||||
FromJSONObject(durationObj, "hours", duration);
|
||||
info.m_tourDuration = duration * 60 * 60; // convert hours to seconds
|
||||
|
||||
FromJSONObject(extraObj, "minutes", duration);
|
||||
FromJSONObject(durationObj, "minutes", duration);
|
||||
info.m_tourDuration += duration * 60; // convert minutes to seconds
|
||||
}
|
||||
FromJSONObjectOptionalField(extraObj, "ascent", info.m_ascent);
|
||||
|
|
Reference in a new issue