mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-10 07:22:37 -07:00
Add IP address to sessions for PMS 0.9.14
This commit is contained in:
parent
fd9cf7017b
commit
80df8f6191
4 changed files with 22 additions and 15 deletions
|
@ -39,6 +39,7 @@ class ActivityProcessor(object):
|
|||
'parent_title': session['parent_title'],
|
||||
'grandparent_title': session['grandparent_title'],
|
||||
'friendly_name': session['friendly_name'],
|
||||
'ip_address': session['ip_address'],
|
||||
'player': session['player'],
|
||||
'platform': session['platform'],
|
||||
'parent_rating_key': session['parent_rating_key'],
|
||||
|
@ -78,16 +79,16 @@ class ActivityProcessor(object):
|
|||
kwargs=dict(stream_data=values, notify_action='play')).start()
|
||||
|
||||
started = int(time.time())
|
||||
timestamp = {'started': started}
|
||||
|
||||
# Try and grab IP address from logs
|
||||
if plexpy.CONFIG.IP_LOGGING_ENABLE and plexpy.CONFIG.PMS_LOGS_FOLDER:
|
||||
ip_address = self.find_session_ip(rating_key=session['rating_key'],
|
||||
machine_id=session['machine_id'])
|
||||
else:
|
||||
ip_address = None
|
||||
|
||||
timestamp = {'started': started,
|
||||
'ip_address': ip_address}
|
||||
# Try and grab IP address from logs (fallback if not on PMS 0.9.14 and above)
|
||||
if not session['ip_address']:
|
||||
if plexpy.CONFIG.IP_LOGGING_ENABLE and plexpy.CONFIG.PMS_LOGS_FOLDER:
|
||||
ip_address = self.find_session_ip(rating_key=session['rating_key'],
|
||||
machine_id=session['machine_id'])
|
||||
timestamp.update({'ip_address': ip_address})
|
||||
else:
|
||||
timestamp.update({'ip_address': None})
|
||||
|
||||
# If it's our first write then time stamp it.
|
||||
self.db.upsert('sessions', timestamp, keys)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue