From 1a24146e486c3bedca995df80f267eabf0e74172 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Sat, 18 Feb 2017 16:44:09 +0100 Subject: [PATCH] Move mark_played_at --- resources/lib/itemtypes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index a2437546..19ee59c8 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -21,6 +21,7 @@ import variables as v log = logging.getLogger("PLEX."+__name__) +MARK_PLAYED_AT = 0.90 ############################################################################### @@ -159,12 +160,11 @@ class Items(object): # If the playback was stopped, check whether we need to increment the # playcount. PMS won't tell us the playcount via websockets if item['state'] in ('stopped', 'ended'): - markPlayed = 0.90 complete = float(item['viewOffset']) / float(item['duration']) log.info('Item %s stopped with completion rate %s percent.' 'Mark item played at %s percent.' - % (item['ratingKey'], str(complete), markPlayed), 1) - if complete >= markPlayed: + % (item['ratingKey'], str(complete), MARK_PLAYED_AT), 1) + if complete >= MARK_PLAYED_AT: log.info('Marking as completely watched in Kodi', 1) try: item['viewCount'] += 1