mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-10 08:47:52 +08:00
Fix to catch exception when calling Google Analytics.
This commit is contained in:
parent
0650e2a380
commit
b0c68c151f
1 changed files with 9 additions and 5 deletions
|
@ -45,9 +45,13 @@ def track_event(category=None, action=None, label=None):
|
|||
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=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))
|
||||
with open(os.path.join(args.config_dir, 'config', 'config.ini'), 'w+') as handle:
|
||||
settings.write(handle)
|
||||
try:
|
||||
tracker.track_event(event, session, visitor)
|
||||
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…
Reference in a new issue