Private
Public Access
1
0

more changes

This commit is contained in:
2024-12-09 20:20:32 +01:00
parent 53e6fefbfe
commit 179361835b
5 changed files with 88 additions and 14 deletions

View File

@@ -146,6 +146,22 @@ def do_sync(w, options, quick=False):
except KeyError:
pass
do_icu_export = w.user.intervals_auto_export
try:
do_icu_export = options['upload_to_Intervals'] or do_icu_export
except KeyError:
pass
try:
if options['intervalsid'] != 0 and options['intervalsid'] != '': # pragma: no cover
w.uploadedtointervals = options['intervalsid']
# upload_to_icu = False
do_icu_export = False
w.save()
record = create_or_update_syncrecord(w.user, w, intervalsid=options['intervalsid'])
except KeyError:
pass
try:
if options['nkid'] != 0 and options['nkid'] != '': # pragma: no cover
w.uploadedtonk = options['nkid']
@@ -232,14 +248,29 @@ def do_sync(w, options, quick=False):
except NoTokenError: # pragma: no cover
id = 0
message = "Please connect to Strava first"
except:
e = sys.exc_info()[0]
t = time.localtime()
timestamp = time.strftime('%b-%d-%Y_%H%M', t)
with open('stravalog.log', 'a') as f:
f.write('\n')
f.write(timestamp)
f.write(str(e))
except Exception as e:
dologging('stravalog.log', e)
if do_icu_export:
intervals_integration = IntervalsIntegration(w.user.user)
try:
id = intervals_integration.workout_export(w)
dologging(
'intervals.icu.log',
'exporting workout {id} as {type}'.format(
id=w.id,
type=w.workouttype,
)
)
except NoTokenError:
id = 0
message = "Please connect to Intervals.icu first"
except Exception as e:
dologging(
'intervals.icu.log',
e
)
do_st_export = w.user.sporttracks_auto_export