You can now toggle notifications per user from the users profile page.

The PlexWatch importer will now also import those users into the PlexPy db.
This commit is contained in:
Tim 2015-07-26 00:34:34 +02:00
parent 2a613c117f
commit 881b25a8d4
7 changed files with 101 additions and 54 deletions

View file

@ -19,7 +19,7 @@ import plexpy
import time
def notify(stream_data=None, notify_action=None):
from plexpy import pmsconnect, common
from plexpy import pmsconnect, common, datafactory
if stream_data and notify_action:
# Get the server name
@ -41,6 +41,13 @@ def notify(stream_data=None, notify_action=None):
logger.info('PlexPy Notifier :: %s (%s) started playing %s.' % (stream_data['friendly_name'],
stream_data['player'], item_title))
# Check if notifications enabled for user
data_factory = datafactory.DataFactory()
user_details = data_factory.get_user_friendly_name(user=stream_data['user'])
if not user_details['do_notify']:
return
if stream_data['media_type'] == 'movie' or stream_data['media_type'] == 'episode':
if plexpy.CONFIG.MOVIE_NOTIFY_ENABLE or plexpy.CONFIG.TV_NOTIFY_ENABLE: