mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 06:00:51 -07:00
Add IP address to current activity
This commit is contained in:
parent
0c33e7492a
commit
fd9cf7017b
4 changed files with 34 additions and 1 deletions
|
@ -998,4 +998,21 @@ class DataFactory(object):
|
|||
else:
|
||||
return 'No updated rating key needed in database. No changes were made.'
|
||||
# for debugging
|
||||
#return mapping
|
||||
#return mapping
|
||||
|
||||
def get_session_ip(self, session_key=''):
|
||||
monitor_db = database.MonitorDatabase()
|
||||
|
||||
if session_key:
|
||||
query = 'SELECT CASE WHEN ip_address IS NULL THEN "N/A" ELSE ip_address END ' \
|
||||
'FROM sessions WHERE session_key = %d' % int(session_key)
|
||||
result = monitor_db.select(query)
|
||||
else:
|
||||
return None
|
||||
|
||||
ip_address = 'N/A'
|
||||
|
||||
for item in result:
|
||||
ip_address = item[0]
|
||||
|
||||
return ip_address
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue