Skip to content

Commit

Permalink
progress control be more dynamic with remaining time for the skippers…
Browse files Browse the repository at this point in the history
… out there
  • Loading branch information
im85288 committed Oct 23, 2018
1 parent 53329ec commit 1b9183a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 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.0">
<addon id="service.upnext" name="Up Next" provider-name="im85288" version="0.1.1">
<requires>
<import addon="xbmc.python" version="2.20.0"/>
<import addon="script.module.requests" version="2.9.1" />
Expand Down
21 changes: 11 additions & 10 deletions resources/lib/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,13 @@ def setupFromSettings(self):
self.shortplayLength = int(utils.settings("shortPlayLength")) * 60
self.includeWatched = utils.settings("includeWatched") == "true"

def calculateProgressSteps(self):
notification_time = utils.settings("autoPlaySeasonTime")
self.logMsg("calculateProgressSteps notification time %s" % notification_time, 2)
part1 = (100.0 / int(notification_time))
def calculateProgressSteps(self, period):
self.logMsg("calculateProgressSteps notification time %s" % period, 2)
part1 = (100.0 / int(period))
self.logMsg("calculateProgressSteps 100 / notification time %s" % part1, 2)
part2 = (100.0 / int(notification_time))/10
part2 = (100.0 / int(period))/10
self.logMsg("calculateProgressSteps (100 / notification time) / 10 %s" % part2, 2)
return (100.0 / int(notification_time))/10
return (100.0 / int(period))/10

def autoPlayPlayback(self):
currentFile = xbmc.Player().getPlayingFile()
Expand Down Expand Up @@ -292,14 +291,15 @@ def autoPlayPlayback(self):
stillWatchingPage = StillWatching(
"script-upnext-stillwatching.xml",
utils.addon_path(), "default", "1080i")
progressStepSize = self.calculateProgressSteps()

playTime = xbmc.Player().getTime()
totalTime = xbmc.Player().getTotalTime()
progressStepSize = self.calculateProgressSteps(totalTime - playTime)
nextUpPage.setItem(episode)
nextUpPage.setProgressStepSize(progressStepSize)
stillWatchingPage.setItem(episode)
nextUpPage.setProgressStepSize(progressStepSize)
playedinarownumber = utils.settings("playedInARow")
playTime = xbmc.Player().getTime()
totalTime = xbmc.Player().getTotalTime()
self.logMsg("played in a row settings %s" % str(playedinarownumber), 2)
self.logMsg("played in a row %s" % str(self.playedinarow), 2)

Expand Down Expand Up @@ -385,7 +385,8 @@ def developerPlayPlayback(self):
nextUpPageSimple.setItem(episode)
stillWatchingPage.setItem(episode)
stillWatchingPageSimple.setItem(episode)
progressStepSize = self.calculateProgressSteps()
notification_time = utils.settings("autoPlaySeasonTime")
progressStepSize = self.calculateProgressSteps(notification_time)
self.logMsg("progressStepSize %s" % str(progressStepSize), 2)
nextUpPage.setProgressStepSize(progressStepSize)
nextUpPageSimple.setProgressStepSize(progressStepSize)
Expand Down

0 comments on commit 1b9183a

Please sign in to comment.