Move MARK_PLAYED_AT to variables.py
This commit is contained in:
parent
ee9be516aa
commit
aa83776a8b
3 changed files with 5 additions and 7 deletions
|
@ -22,7 +22,6 @@ import state
|
|||
|
||||
log = logging.getLogger("PLEX."+__name__)
|
||||
|
||||
MARK_PLAYED_AT = 0.90
|
||||
###############################################################################
|
||||
|
||||
|
||||
|
@ -168,8 +167,8 @@ class Items(object):
|
|||
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), MARK_PLAYED_AT), 1)
|
||||
if complete >= MARK_PLAYED_AT:
|
||||
% (item['ratingKey'], str(complete), v.MARK_PLAYED_AT), 1)
|
||||
if complete >= v.MARK_PLAYED_AT:
|
||||
log.info('Marking as completely watched in Kodi')
|
||||
try:
|
||||
item['viewCount'] += 1
|
||||
|
|
|
@ -347,11 +347,9 @@ class Player(xbmc.Player):
|
|||
except ZeroDivisionError:
|
||||
# Runtime is 0.
|
||||
percentComplete = 0
|
||||
|
||||
markPlayed = 0.90
|
||||
log.info("Percent complete: %s Mark played at: %s"
|
||||
% (percentComplete, markPlayed))
|
||||
if percentComplete >= markPlayed:
|
||||
% (percentComplete, v.MARK_PLAYED_AT))
|
||||
if percentComplete >= v.MARK_PLAYED_AT:
|
||||
# Kodi seems to sometimes overwrite our playstate, so wait
|
||||
xbmc.sleep(500)
|
||||
# Tell Kodi that we've finished watching (Plex knows)
|
||||
|
|
|
@ -21,6 +21,7 @@ def tryDecode(string, encoding='utf-8'):
|
|||
string = string.decode()
|
||||
return string
|
||||
|
||||
MARK_PLAYED_AT = 0.9
|
||||
|
||||
_ADDON = Addon()
|
||||
ADDON_NAME = 'PlexKodiConnect'
|
||||
|
|
Loading…
Reference in a new issue