Separate movie/episode/track watched percent

This commit is contained in:
JonnyWong16 2017-07-07 19:01:04 -07:00
parent 8348424758
commit 6f0c650a72
7 changed files with 74 additions and 36 deletions

View file

@ -226,7 +226,9 @@ class ActivityHandler(object):
if this_state != 'buffering':
progress_percent = helpers.get_percent(db_session['view_offset'], db_session['duration'])
notify_states = notification_handler.get_notify_state(session=db_session)
if progress_percent >= plexpy.CONFIG.NOTIFY_WATCHED_PERCENT \
if (db_session['media_type'] == 'movie' and progress_percent >= plexpy.CONFIG.MOVIE_WATCHED_PERCENT or
db_session['media_type'] == 'episode' and progress_percent >= plexpy.CONFIG.TV_WATCHED_PERCENT or
db_session['media_type'] == 'track' and progress_percent >= plexpy.CONFIG.MUSIC_WATCHED_PERCENT) \
and not any(d['notify_action'] == 'on_watched' for d in notify_states):
plexpy.NOTIFY_QUEUE.put({'stream_data': db_session, 'notify_action': 'on_watched'})