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