Merge branch 'development' into morpheus

# Conflicts:
#	bazarr/get_subtitle.py
This commit is contained in:
Louis Vézina 2019-09-04 22:28:11 -04:00
commit 30b94a62ff
3 changed files with 25 additions and 16 deletions

View File

@ -19,7 +19,6 @@ radarr_version = get_radarr_version()
def track_event(category=None, action=None, label=None): def track_event(category=None, action=None, label=None):
if not settings.analytics.getboolean('enabled'): if not settings.analytics.getboolean('enabled'):
print "no analytics"
return return
anonymousConfig = Config() anonymousConfig = Config()
@ -41,12 +40,18 @@ def track_event(category=None, action=None, label=None):
tracker.add_custom_variable(CustomVariable(index=1, name='BazarrVersion', value=os.environ["BAZARR_VERSION"], scope=1)) tracker.add_custom_variable(CustomVariable(index=1, name='BazarrVersion', value=os.environ["BAZARR_VERSION"], scope=1))
tracker.add_custom_variable(CustomVariable(index=2, name='PythonVersion', value=platform.python_version(), scope=1)) tracker.add_custom_variable(CustomVariable(index=2, name='PythonVersion', value=platform.python_version(), scope=1))
if settings.general.getboolean('use_sonarr'):
tracker.add_custom_variable(CustomVariable(index=3, name='SonarrVersion', value=sonarr_version, scope=1)) tracker.add_custom_variable(CustomVariable(index=3, name='SonarrVersion', value=sonarr_version, scope=1))
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))
try:
tracker.track_event(event, session, visitor) tracker.track_event(event, session, visitor)
tracker.track_pageview(page, session, visitor) tracker.track_pageview(page, session, visitor)
except:
pass
else:
settings.analytics.visitor = base64.b64encode(pickle.dumps(visitor)) settings.analytics.visitor = base64.b64encode(pickle.dumps(visitor))
with open(os.path.join(args.config_dir, 'config', 'config.ini'), 'w+') as handle: with open(os.path.join(args.config_dir, 'config', 'config.ini'), 'w+') as handle:
settings.write(handle) settings.write(handle)

View File

@ -485,7 +485,7 @@ def manual_download_subtitle(path, language, hi, forced, subtitle, provider, pro
else: else:
reversed_path = path_replace_reverse_movie(path) reversed_path = path_replace_reverse_movie(path)
track_event(category=downloaded_provider, action="downloaded", label=downloaded_language) track_event(category=downloaded_provider, action="manually_downloaded", label=downloaded_language)
return message, reversed_path, downloaded_language_code2, downloaded_provider, subtitle.score, subtitle.language.forced return message, reversed_path, downloaded_language_code2, downloaded_provider, subtitle.score, subtitle.language.forced
else: else:

View File

@ -679,12 +679,16 @@
<label></label> <label></label>
</div> </div>
</div> </div>
<div class="collapsed column"> </div>
<div class="collapsed center aligned column"> <div class="middle align row">
<div class="ui basic icon" data-tooltip="Send anonymous usage information, nothing that can identify you. This includes information on which providers you use, what languages you search for, Bazarr, Python, Sonarr, Radarr and OS version you are using. We will use this information to prioritize features and bug fixes. Please, keep this enabled as this is the only way we have to better understand how you use Bazarr." data-inverted=""> <div class="right aligned four wide column">
</div>
<div class="one wide column">
<i class="help circle large icon"></i> <i class="help circle large icon"></i>
</div> </div>
</div> <div class="ten wide column">
Send anonymous usage information, nothing that can identify you. This includes information on which providers you use, what languages you search for, Bazarr, Python, Sonarr, Radarr and OS version you are using. We will use this information to prioritize features and bug fixes. Please, keep this enabled as this is the only way we have to better understand how you use Bazarr.
</div> </div>
</div> </div>
</div> </div>