mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-31 03:50:11 -07:00
Add notification for user streaming from a new device
This commit is contained in:
parent
f4273cafb6
commit
3ccc82f343
9 changed files with 207 additions and 26 deletions
|
@ -1306,4 +1306,19 @@ class DataFactory(object):
|
|||
return True
|
||||
except Exception as e:
|
||||
logger.warn(u"PlexPy DataFactory :: Unable to execute database query for delete_notification_log: %s." % e)
|
||||
return False
|
||||
return False
|
||||
|
||||
def get_user_devices(self, user_id=''):
|
||||
monitor_db = database.MonitorDatabase()
|
||||
|
||||
if user_id:
|
||||
try:
|
||||
query = 'SELECT machine_id FROM session_history WHERE user_id = ? GROUP BY machine_id'
|
||||
result = monitor_db.select(query=query, args=[user_id])
|
||||
except Exception as e:
|
||||
logger.warn(u"PlexPy DataFactory :: Unable to execute database query for get_user_devices: %s." % e)
|
||||
return []
|
||||
else:
|
||||
return []
|
||||
|
||||
return [d['machine_id'] for d in result]
|
Loading…
Add table
Add a link
Reference in a new issue