mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-22 06:13:25 -07:00
Update plexpy/notification_handler.py
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
This commit is contained in:
parent
8c6bea3222
commit
b04447e100
1 changed files with 5 additions and 5 deletions
|
@ -188,13 +188,13 @@ def notify_conditions(notify_action=None, stream_data=None, timeline_data=None,
|
||||||
user_sessions = [s for s in result['sessions'] if s['user_id'] == stream_data['user_id']]
|
user_sessions = [s for s in result['sessions'] if s['user_id'] == stream_data['user_id']]
|
||||||
|
|
||||||
if plexpy.CONFIG.NOTIFY_CONCURRENT_BY_IP:
|
if plexpy.CONFIG.NOTIFY_CONCURRENT_BY_IP:
|
||||||
ip_addresses = []
|
ip_addresses = set()
|
||||||
for s in user_sessions:
|
for s in user_sessions:
|
||||||
if helpers.ip_type(s['ip_address']) == 'IPv6':
|
if helpers.ip_type(s['ip_address']) == 'IPv6':
|
||||||
ip_addresses.append(helpers.get_ipv6_network_address(s['ip_address']))
|
ip_addresses.add(helpers.get_ipv6_network_address(s['ip_address']))
|
||||||
if helpers.ip_type(s['ip_address']) == 'IPv4':
|
elif helpers.ip_type(s['ip_address']) == 'IPv4':
|
||||||
ip_addresses.append(s['ip_address'])
|
ip_addresses.add(s['ip_address'])
|
||||||
evaluated = len(Counter(ip_addresses)) >= plexpy.CONFIG.NOTIFY_CONCURRENT_THRESHOLD
|
evaluated = len(ip_addresses) >= plexpy.CONFIG.NOTIFY_CONCURRENT_THRESHOLD
|
||||||
else:
|
else:
|
||||||
evaluated = len(user_sessions) >= plexpy.CONFIG.NOTIFY_CONCURRENT_THRESHOLD
|
evaluated = len(user_sessions) >= plexpy.CONFIG.NOTIFY_CONCURRENT_THRESHOLD
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue