Skip to content
This repository has been archived by the owner on Nov 9, 2019. It is now read-only.

Import activity category for fitlog files #1438

Merged
merged 1 commit into from Jul 26, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion inc/import/parser/class.ParserFITLOGSingle.php
Expand Up @@ -47,7 +47,11 @@ protected function throwNoFITLOGError() {
*/
protected function parseGeneralValues() {
$this->TrainingObject->setTimestamp( strtotime((string)$this->XML['StartTime']) );
$this->TrainingObject->setSportid( Configuration::General()->mainSport() );

if (!empty($this->XML['categoryName']))
$this->guessSportID( (string)$this->XML['categoryName'] );
else
$this->TrainingObject->setSportid( Configuration::General()->mainSport() );

if (!empty($this->XML->Duration['TotalSeconds']))
$this->TrainingObject->setTimeInSeconds(round((double)$this->XML->Duration['TotalSeconds']));
Expand Down