mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 12:59:42 -07:00
Separate system analytics
This commit is contained in:
parent
3f3d1962c7
commit
700547b63b
2 changed files with 16 additions and 4 deletions
|
@ -73,6 +73,7 @@ NOTIFY_QUEUE = Queue()
|
||||||
INIT_LOCK = threading.Lock()
|
INIT_LOCK = threading.Lock()
|
||||||
_INITIALIZED = False
|
_INITIALIZED = False
|
||||||
_STARTED = False
|
_STARTED = False
|
||||||
|
_UPDATE = False
|
||||||
|
|
||||||
DATA_DIR = None
|
DATA_DIR = None
|
||||||
|
|
||||||
|
@ -108,6 +109,7 @@ def initialize(config_file):
|
||||||
global LATEST_VERSION
|
global LATEST_VERSION
|
||||||
global PREV_RELEASE
|
global PREV_RELEASE
|
||||||
global UMASK
|
global UMASK
|
||||||
|
global _UPDATE
|
||||||
|
|
||||||
CONFIG = plexpy.config.Config(config_file)
|
CONFIG = plexpy.config.Config(config_file)
|
||||||
CONFIG_FILE = config_file
|
CONFIG_FILE = config_file
|
||||||
|
@ -251,6 +253,7 @@ def initialize(config_file):
|
||||||
if common.VERSION_NUMBER != PREV_RELEASE:
|
if common.VERSION_NUMBER != PREV_RELEASE:
|
||||||
CONFIG.UPDATE_SHOW_CHANGELOG = 1
|
CONFIG.UPDATE_SHOW_CHANGELOG = 1
|
||||||
CONFIG.write()
|
CONFIG.write()
|
||||||
|
_UPDATE = True
|
||||||
|
|
||||||
# Write current release version to file for update checking
|
# Write current release version to file for update checking
|
||||||
try:
|
try:
|
||||||
|
@ -456,7 +459,15 @@ def start():
|
||||||
if CONFIG.FIRST_RUN_COMPLETE:
|
if CONFIG.FIRST_RUN_COMPLETE:
|
||||||
activity_pinger.connect_server(log=True, startup=True)
|
activity_pinger.connect_server(log=True, startup=True)
|
||||||
|
|
||||||
send_analytics()
|
if CONFIG.SYSTEM_ANALYTICS:
|
||||||
|
# Send analytic events
|
||||||
|
if not CONFIG.FIRST_RUN_COMPLETE:
|
||||||
|
send_analytics(category='system', action='install')
|
||||||
|
|
||||||
|
if _UPDATE:
|
||||||
|
send_analytics(category='system', action='update')
|
||||||
|
|
||||||
|
send_analytics(category='system', action='start')
|
||||||
|
|
||||||
_STARTED = True
|
_STARTED = True
|
||||||
|
|
||||||
|
@ -1673,11 +1684,11 @@ def generate_uuid():
|
||||||
return uuid.uuid4().hex
|
return uuid.uuid4().hex
|
||||||
|
|
||||||
|
|
||||||
def send_analytics():
|
def send_analytics(category, action):
|
||||||
tracker = Tracker.create('UA-111522699-2', client_id=CONFIG.PMS_UUID, hash_client_id=True)
|
tracker = Tracker.create('UA-111522699-2', client_id=CONFIG.PMS_UUID, hash_client_id=True)
|
||||||
tracker.send('event', {
|
tracker.send('event', {
|
||||||
'category': 'system',
|
'category': category,
|
||||||
'action': 'install',
|
'action': action,
|
||||||
'appName': 'Tautulli',
|
'appName': 'Tautulli',
|
||||||
'appVersion': common.VERSION_NUMBER,
|
'appVersion': common.VERSION_NUMBER,
|
||||||
'appID': '{} {}'.format(common.PLATFORM, common.PLATFORM_VERSION),
|
'appID': '{} {}'.format(common.PLATFORM, common.PLATFORM_VERSION),
|
||||||
|
|
|
@ -615,6 +615,7 @@ _CONFIG_DEFINITIONS = {
|
||||||
'XBMC_ON_CONCURRENT': (int, 'XBMC', 0),
|
'XBMC_ON_CONCURRENT': (int, 'XBMC', 0),
|
||||||
'XBMC_ON_NEWDEVICE': (int, 'XBMC', 0),
|
'XBMC_ON_NEWDEVICE': (int, 'XBMC', 0),
|
||||||
'JWT_SECRET': (str, 'Advanced', ''),
|
'JWT_SECRET': (str, 'Advanced', ''),
|
||||||
|
'SYSTEM_ANALYTICS': (int, 'Advanced', 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
_BLACKLIST_KEYS = ['_APITOKEN', '_TOKEN', '_KEY', '_SECRET', '_PASSWORD', '_APIKEY', '_ID', '_HOOK']
|
_BLACKLIST_KEYS = ['_APITOKEN', '_TOKEN', '_KEY', '_SECRET', '_PASSWORD', '_APIKEY', '_ID', '_HOOK']
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue