workouttype detection fit
This commit is contained in:
@@ -1426,13 +1426,17 @@ def get_workouttype_from_fit(filename, workouttype=None):
|
||||
if record.name in ['sport', 'lap','session']:
|
||||
try:
|
||||
fittype = record.get_values()['sport'].lower()
|
||||
try:
|
||||
workouttype = mytypes.fitmappinginv[fittype]
|
||||
except KeyError:
|
||||
workouttype = ''
|
||||
try:
|
||||
subsporttype = record.get_values()['sub_sport'].lower()
|
||||
except KeyError:
|
||||
subsporttype = ''
|
||||
except (KeyError, AttributeError): # pragma: no cover
|
||||
pass
|
||||
if subsporttype:
|
||||
if subsporttype and workouttype == '':
|
||||
try:
|
||||
workouttype = mytypes.fitmappinginv[subsporttype]
|
||||
except KeyError:
|
||||
@@ -1442,8 +1446,8 @@ def get_workouttype_from_fit(filename, workouttype=None):
|
||||
workouttype = mytypes.fitmappinginv[fittype]
|
||||
except KeyError:
|
||||
pass
|
||||
if workouttype_orig in ['water', 'rower']:
|
||||
workouttype = workouttype_orig
|
||||
#if workouttype_orig in ['water', 'rower']:
|
||||
# workouttype = workouttype_orig
|
||||
|
||||
return workouttype
|
||||
|
||||
|
||||
Reference in New Issue
Block a user