Move mark_played_at
This commit is contained in:
parent
c359c6fff8
commit
1a24146e48
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue