Don't sleep before updating playstate to fully watched
This commit is contained in:
parent
14fc334422
commit
a3514ec104
1 changed files with 3 additions and 3 deletions
|
@ -161,8 +161,9 @@ class Items(object):
|
||||||
|
|
||||||
# If offset exceeds duration skip update
|
# If offset exceeds duration skip update
|
||||||
if item['viewOffset'] > item['duration']:
|
if item['viewOffset'] > item['duration']:
|
||||||
log.error("Error while updating play state, viewOffset exceeded duration")
|
log.error("Error while updating play state, viewOffset "
|
||||||
return
|
"exceeded duration")
|
||||||
|
return
|
||||||
|
|
||||||
complete = float(item['viewOffset']) / float(item['duration'])
|
complete = float(item['viewOffset']) / float(item['duration'])
|
||||||
log.info('Item %s stopped with completion rate %s percent.'
|
log.info('Item %s stopped with completion rate %s percent.'
|
||||||
|
@ -170,7 +171,6 @@ class Items(object):
|
||||||
% (item['ratingKey'], str(complete), MARK_PLAYED_AT), 1)
|
% (item['ratingKey'], str(complete), MARK_PLAYED_AT), 1)
|
||||||
if complete >= MARK_PLAYED_AT:
|
if complete >= MARK_PLAYED_AT:
|
||||||
log.info('Marking as completely watched in Kodi')
|
log.info('Marking as completely watched in Kodi')
|
||||||
sleep(500)
|
|
||||||
try:
|
try:
|
||||||
item['viewCount'] += 1
|
item['viewCount'] += 1
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
|
Loading…
Reference in a new issue