Fix to catch exception when calling Google Analytics.

pull/551/head
Louis Vézina 5 years ago
parent 0650e2a380
commit b0c68c151f

@ -45,9 +45,13 @@ def track_event(category=None, action=None, label=None):
if settings.general.getboolean('use_radarr'): if settings.general.getboolean('use_radarr'):
tracker.add_custom_variable(CustomVariable(index=4, name='RadarrVersion', value=radarr_version, scope=1)) tracker.add_custom_variable(CustomVariable(index=4, name='RadarrVersion', value=radarr_version, scope=1))
tracker.add_custom_variable(CustomVariable(index=5, name='OSVersion', value=platform.platform(), scope=1)) tracker.add_custom_variable(CustomVariable(index=5, name='OSVersion', value=platform.platform(), scope=1))
tracker.track_event(event, session, visitor)
tracker.track_pageview(page, session, visitor)
settings.analytics.visitor = base64.b64encode(pickle.dumps(visitor)) try:
with open(os.path.join(args.config_dir, 'config', 'config.ini'), 'w+') as handle: tracker.track_event(event, session, visitor)
settings.write(handle) tracker.track_pageview(page, session, visitor)
except:
pass
else:
settings.analytics.visitor = base64.b64encode(pickle.dumps(visitor))
with open(os.path.join(args.config_dir, 'config', 'config.ini'), 'w+') as handle:
settings.write(handle)

Loading…
Cancel
Save