Get rid of obsolete setting markPlayed
- Instead, always mark played at 90%
This commit is contained in:
parent
ced650266f
commit
386f4ca5f0
4 changed files with 9 additions and 13 deletions
|
@ -262,13 +262,12 @@ class Items(object):
|
||||||
# If the playback was stopped, check whether we need to increment the
|
# If the playback was stopped, check whether we need to increment the
|
||||||
# playcount. PMS won't tell us the playcount via websockets
|
# playcount. PMS won't tell us the playcount via websockets
|
||||||
if item['state'] in ('stopped', 'ended'):
|
if item['state'] in ('stopped', 'ended'):
|
||||||
complete = float(item['viewOffset']) / float(item['duration'])*100
|
markPlayed = 0.90
|
||||||
|
complete = float(item['viewOffset']) / float(item['duration'])
|
||||||
self.logMsg('Item %s stopped with completion rate %s percent.'
|
self.logMsg('Item %s stopped with completion rate %s percent.'
|
||||||
'Mark item played at %s percent.'
|
'Mark item played at %s percent.'
|
||||||
% (item['ratingKey'],
|
% (item['ratingKey'], str(complete), markPlayed), 1)
|
||||||
str(complete),
|
if complete >= markPlayed:
|
||||||
utils.settings('markPlayed')), 1)
|
|
||||||
if complete >= float(utils.settings('markPlayed')):
|
|
||||||
self.logMsg('Marking as completely watched in Kodi', 1)
|
self.logMsg('Marking as completely watched in Kodi', 1)
|
||||||
try:
|
try:
|
||||||
item['viewCount'] += 1
|
item['viewCount'] += 1
|
||||||
|
|
|
@ -510,11 +510,11 @@ class Player(xbmc.Player):
|
||||||
except ZeroDivisionError:
|
except ZeroDivisionError:
|
||||||
# Runtime is 0.
|
# Runtime is 0.
|
||||||
percentComplete = 0
|
percentComplete = 0
|
||||||
|
|
||||||
markPlayedAt = float(settings('markPlayed')) / 100
|
markPlayed = 0.90
|
||||||
self.logMsg("Percent complete: %s Mark played at: %s"
|
self.logMsg("Percent complete: %s Mark played at: %s"
|
||||||
% (percentComplete, markPlayedAt), 1)
|
% (percentComplete, markPlayed), 1)
|
||||||
if percentComplete >= markPlayedAt:
|
if percentComplete >= markPlayed:
|
||||||
# Tell Kodi that we've finished watching (Plex knows)
|
# Tell Kodi that we've finished watching (Plex knows)
|
||||||
if (data['fileid'] is not None and
|
if (data['fileid'] is not None and
|
||||||
data['itemType'] in ('movie', 'episode')):
|
data['itemType'] in ('movie', 'episode')):
|
||||||
|
@ -539,7 +539,7 @@ class Player(xbmc.Player):
|
||||||
|
|
||||||
# Plex: never delete
|
# Plex: never delete
|
||||||
offerDelete = False
|
offerDelete = False
|
||||||
if percentComplete >= markPlayedAt and offerDelete:
|
if percentComplete >= markPlayed and offerDelete:
|
||||||
resp = xbmcgui.Dialog().yesno(
|
resp = xbmcgui.Dialog().yesno(
|
||||||
lang(30091),
|
lang(30091),
|
||||||
lang(33015),
|
lang(33015),
|
||||||
|
|
|
@ -114,8 +114,6 @@ class UserClient(threading.Thread):
|
||||||
# url = "{server}/emby/System/Configuration?format=json"
|
# url = "{server}/emby/System/Configuration?format=json"
|
||||||
# result = doUtils.downloadUrl(url)
|
# result = doUtils.downloadUrl(url)
|
||||||
|
|
||||||
# utils.settings('markPlayed', value=str(result['MaxResumePct']))
|
|
||||||
|
|
||||||
def hasAccess(self):
|
def hasAccess(self):
|
||||||
# Plex: always return True for now
|
# Plex: always return True for now
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -95,7 +95,6 @@
|
||||||
<setting id="transcodeHEVC" type="bool" label="39065" default="false"/>
|
<setting id="transcodeHEVC" type="bool" label="39065" default="false"/>
|
||||||
<setting id="audioBoost" type="slider" label="39001" default="0" range="0,10,100" option="int"/>
|
<setting id="audioBoost" type="slider" label="39001" default="0" range="0,10,100" option="int"/>
|
||||||
<setting id="subtitleSize" label="39002" type="slider" option="int" range="0,30,300" default="100" />
|
<setting id="subtitleSize" label="39002" type="slider" option="int" range="0,30,300" default="100" />
|
||||||
<setting id="markPlayed" type="number" visible="false" default="95" />
|
|
||||||
<setting id="failedCount" type="number" visible="false" default="0" />
|
<setting id="failedCount" type="number" visible="false" default="0" />
|
||||||
<setting id="networkCreds" type="text" visible="false" default="" />
|
<setting id="networkCreds" type="text" visible="false" default="" />
|
||||||
</category>
|
</category>
|
||||||
|
|
Loading…
Reference in a new issue