Skip to content

Commit

Permalink
fix a typo, optimise progress control update a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
im85288 committed Oct 28, 2018
1 parent 5bb38e4 commit 8b224ee
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<addon id="service.upnext" name="Up Next" provider-name="im85288" version="0.1.3">
<addon id="service.upnext" name="Up Next" provider-name="im85288" version="0.1.4">
<requires>
<import addon="xbmc.python" version="2.20.0"/>
<import addon="script.module.requests" version="2.9.1" />
Expand Down
36 changes: 18 additions & 18 deletions resources/lib/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,36 +301,36 @@ def autoPlayPlayback(self):
nextUpPage.setItem(episode)
nextUpPage.setProgressStepSize(progressStepSize)
stillWatchingPage.setItem(episode)
nextUpPage.setProgressStepSize(progressStepSize)
stillWatchingPage.setProgressStepSize(progressStepSize)
playedinarownumber = utils.settings("playedInARow")
self.logMsg("played in a row settings %s" % str(playedinarownumber), 2)
self.logMsg("played in a row %s" % str(self.playedinarow), 2)

if int(self.playedinarow) <= int(playedinarownumber):
showingnextuppage = False
showingstillwatchingpage = False
hideforshortvideos = (self.shortplayNotification == "false") and (self.shortplayLength >= totalTime) and (self.shortplayMode == "true")
if int(self.playedinarow) <= int(playedinarownumber) and not hideforshortvideos:
self.logMsg(
"showing next up page as played in a row is %s" % str(self.playedinarow), 2)
if (self.shortplayNotification == "false") and (self.shortplayLength >= totalTime) and (self.shortplayMode == "true"):
self.logMsg("hiding notification for short videos")
else:
nextUpPage.show()
utils.window('service.upnext.dialog', 'true')
else:
nextUpPage.show()
utils.window('service.upnext.dialog', 'true')
showingnextuppage = True
elif not hideforshortvideos:
self.logMsg(
"showing still watching page as played in a row %s" % str(self.playedinarow), 2)
if (self.shortplayNotification == "false") and (self.shortplayLength >= totalTime) and (self.shortplayMode == "true"):
self.logMsg("hiding notification for short videos")
else:
stillWatchingPage.show()
utils.window('service.upnext.dialog', 'true')
stillWatchingPage.show()
utils.window('service.upnext.dialog', 'true')
showingstillwatchingpage = True

while xbmc.Player().isPlaying() and (
totalTime - playTime > 1) and not nextUpPage.isCancel() and not nextUpPage.isWatchNow() and not stillWatchingPage.isStillWatching() and not stillWatchingPage.isCancel():
xbmc.sleep(100)
nextUpPage.updateProgressControl()
stillWatchingPage.updateProgressControl()
try:
playTime = xbmc.Player().getTime()
totalTime = xbmc.Player().getTotalTime()
if showingnextuppage:
nextUpPage.updateProgressControl()
elif showingstillwatchingpage:
stillWatchingPage.updateProgressControl()
except:
pass
if self.shortplayLength >= totalTime and self.shortplayMode == "true":
Expand All @@ -341,12 +341,12 @@ def autoPlayPlayback(self):
self.playedinarow = 1
shouldPlayDefault = not nextUpPage.isCancel()
else:
if int(self.playedinarow) <= int(playedinarownumber):
if showingnextuppage:
nextUpPage.close()
utils.window('service.upnext.dialog', clear=True)
shouldPlayDefault = not nextUpPage.isCancel()
shouldPlayNonDefault = nextUpPage.isWatchNow()
else:
elif showingstillwatchingpage:
stillWatchingPage.close()
utils.window('service.upnext.dialog', clear=True)
shouldPlayDefault = stillWatchingPage.isStillWatching()
Expand Down

0 comments on commit 8b224ee

Please sign in to comment.