diff --git a/CHANGELOG.md b/CHANGELOG.md index e8590e6ee..46e257ae8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ at anytime. * integration tests for bootstrapping the dht * configurable `concurrent_announcers` and `s3_headers_depth` settings * `peer_ping` command + * linux distro and desktop name added to analytics ### Removed * `announce_all` argument from `blob_announce` diff --git a/lbrynet/analytics.py b/lbrynet/analytics.py index 6cd1f1e69..cec87199c 100644 --- a/lbrynet/analytics.py +++ b/lbrynet/analytics.py @@ -185,7 +185,7 @@ class Manager(object): @staticmethod def _make_context(platform, wallet): - return { + context = { 'app': { 'name': 'lbrynet', 'version': platform['lbrynet_version'], @@ -206,6 +206,10 @@ class Manager(object): 'version': '1.0.0' }, } + if 'desktop' in platform and 'distro' in platform: + context['os']['desktop'] = platform['desktop'] + context['os']['distro'] = platform['distro'] + return context @staticmethod def _if_deferred(maybe_deferred, callback, *args, **kwargs): diff --git a/lbrynet/core/system_info.py b/lbrynet/core/system_info.py index 95cd74bc9..3e81e8011 100644 --- a/lbrynet/core/system_info.py +++ b/lbrynet/core/system_info.py @@ -36,6 +36,10 @@ def get_platform(get_ip=True): "lbryschema_version": lbryschema_version, "build": build_type.BUILD, # CI server sets this during build step } + if p["os_system"] == "Linux": + import distro + p["distro"] = distro.info() + p["desktop"] = os.environ.get('XDG_CURRENT_DESKTOP', 'Unknown') # TODO: remove this from get_platform and add a get_external_ip function using treq if get_ip: diff --git a/setup.py b/setup.py index d4e4c0f43..7076b14b5 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ from setuptools import setup, find_packages requires = [ 'Twisted', 'appdirs', + 'distro', 'base58', 'envparse', 'jsonrpc',