Set checked value for notify by concurrent IP address

This commit is contained in:
JonnyWong16 2016-07-16 11:22:38 -07:00
parent eb0b88bfcf
commit cd3938eb33
2 changed files with 4 additions and 4 deletions

View file

@ -110,8 +110,8 @@ class ActivityProcessor(object):
# Check if any notification agents have notifications enabled # Check if any notification agents have notifications enabled
if notify and any(d['on_concurrent'] for d in notifiers.available_notification_agents()): if notify and any(d['on_concurrent'] for d in notifiers.available_notification_agents()):
# Check if any concurrent streams by the user # Check if any concurrent streams by the user
ip = True if plexpy.CONFIG.NOTIFY_CONCURRENT_BY_IP else None user_sessions = self.get_session_by_user_id(user_id=session['user_id'],
user_sessions = self.get_session_by_user_id(user_id=session['user_id'], ip_address=ip) ip_address=plexpy.CONFIG.NOTIFY_CONCURRENT_BY_IP)
if len(user_sessions) >= plexpy.CONFIG.NOTIFY_CONCURRENT_THRESHOLD: if len(user_sessions) >= plexpy.CONFIG.NOTIFY_CONCURRENT_THRESHOLD:
# Push any notifications - Push it on it's own thread so we don't hold up our db actions # Push any notifications - Push it on it's own thread so we don't hold up our db actions
threading.Thread(target=notification_handler.notify, threading.Thread(target=notification_handler.notify,

View file

@ -2570,7 +2570,7 @@ class WebInterface(object):
"notify_recently_added": checked(plexpy.CONFIG.NOTIFY_RECENTLY_ADDED), "notify_recently_added": checked(plexpy.CONFIG.NOTIFY_RECENTLY_ADDED),
"notify_recently_added_grandparent": checked(plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_GRANDPARENT), "notify_recently_added_grandparent": checked(plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_GRANDPARENT),
"notify_recently_added_delay": plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_DELAY, "notify_recently_added_delay": plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_DELAY,
"notify_concurrent_by_ip": plexpy.CONFIG.NOTIFY_CONCURRENT_BY_IP, "notify_concurrent_by_ip": checked(plexpy.CONFIG.NOTIFY_CONCURRENT_BY_IP),
"notify_concurrent_threshold": plexpy.CONFIG.NOTIFY_CONCURRENT_THRESHOLD, "notify_concurrent_threshold": plexpy.CONFIG.NOTIFY_CONCURRENT_THRESHOLD,
"notify_watched_percent": plexpy.CONFIG.NOTIFY_WATCHED_PERCENT, "notify_watched_percent": plexpy.CONFIG.NOTIFY_WATCHED_PERCENT,
"notify_on_start_subject_text": plexpy.CONFIG.NOTIFY_ON_START_SUBJECT_TEXT, "notify_on_start_subject_text": plexpy.CONFIG.NOTIFY_ON_START_SUBJECT_TEXT,
@ -2634,7 +2634,7 @@ class WebInterface(object):
"ip_logging_enable", "movie_logging_enable", "tv_logging_enable", "music_logging_enable", "ip_logging_enable", "movie_logging_enable", "tv_logging_enable", "music_logging_enable",
"notify_consecutive", "notify_upload_posters", "notify_recently_added", "notify_recently_added_grandparent", "notify_consecutive", "notify_upload_posters", "notify_recently_added", "notify_recently_added_grandparent",
"monitor_pms_updates", "monitor_remote_access", "get_file_sizes", "log_blacklist", "http_hash_password", "monitor_pms_updates", "monitor_remote_access", "get_file_sizes", "log_blacklist", "http_hash_password",
"allow_guest_access", "cache_images", "http_proxy", "http_basic_auth" "allow_guest_access", "cache_images", "http_proxy", "http_basic_auth", "notify_concurrent_by_ip"
] ]
for checked_config in checked_configs: for checked_config in checked_configs:
if checked_config not in kwargs: if checked_config not in kwargs: