mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-10 07:22:37 -07:00
Fix IP logging again
* Really this time...
This commit is contained in:
parent
fae3f38a88
commit
c827c9e825
1 changed files with 7 additions and 7 deletions
|
@ -39,7 +39,7 @@ class ActivityProcessor(object):
|
||||||
'parent_title': session['parent_title'],
|
'parent_title': session['parent_title'],
|
||||||
'grandparent_title': session['grandparent_title'],
|
'grandparent_title': session['grandparent_title'],
|
||||||
'friendly_name': session['friendly_name'],
|
'friendly_name': session['friendly_name'],
|
||||||
'ip_address': session['ip_address'],
|
#'ip_address': session['ip_address'],
|
||||||
'player': session['player'],
|
'player': session['player'],
|
||||||
'platform': session['platform'],
|
'platform': session['platform'],
|
||||||
'parent_rating_key': session['parent_rating_key'],
|
'parent_rating_key': session['parent_rating_key'],
|
||||||
|
@ -67,6 +67,10 @@ class ActivityProcessor(object):
|
||||||
'transcode_height': session['transcode_height']
|
'transcode_height': session['transcode_height']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Add ip_address back into values
|
||||||
|
if session['ip_address']:
|
||||||
|
values.update({'ip_address': session['ip_address']})
|
||||||
|
|
||||||
keys = {'session_key': session['session_key'],
|
keys = {'session_key': session['session_key'],
|
||||||
'rating_key': session['rating_key']}
|
'rating_key': session['rating_key']}
|
||||||
|
|
||||||
|
@ -88,12 +92,8 @@ class ActivityProcessor(object):
|
||||||
if plexpy.CONFIG.IP_LOGGING_ENABLE and plexpy.CONFIG.PMS_LOGS_FOLDER:
|
if plexpy.CONFIG.IP_LOGGING_ENABLE and plexpy.CONFIG.PMS_LOGS_FOLDER:
|
||||||
ip_address = self.find_session_ip(rating_key=session['rating_key'],
|
ip_address = self.find_session_ip(rating_key=session['rating_key'],
|
||||||
machine_id=session['machine_id'])
|
machine_id=session['machine_id'])
|
||||||
else:
|
ip_address = {'ip_address': ip_address}
|
||||||
ip_adress = None
|
self.db.upsert('sessions', ip_address, keys)
|
||||||
|
|
||||||
query = 'UPDATE sessions SET ip_address = ? WHERE session_key = ? AND rating_key = ? '
|
|
||||||
args = [ip_address, session['session_key'], session['rating_key']]
|
|
||||||
self.db.action(query=query, args=args)
|
|
||||||
|
|
||||||
def write_session_history(self, session=None, import_metadata=None, is_import=False, import_ignore_interval=0):
|
def write_session_history(self, session=None, import_metadata=None, is_import=False, import_ignore_interval=0):
|
||||||
from plexpy import users
|
from plexpy import users
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue