Skip to content

Commit

Permalink
fix errors with random unwatched and others
Browse files Browse the repository at this point in the history
  • Loading branch information
im85288 committed Apr 20, 2016
1 parent 1891c68 commit c27e046
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 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.nextup.notification" name="Nextup Service Notification" provider-name="im85288" version="1.0.18">
<addon id="service.nextup.notification" name="Nextup Service Notification" provider-name="im85288" version="1.0.19">
<requires>
<import addon="xbmc.python" version="2.20.0"/>
<import addon="script.module.addon.signals" version="0.0.1"/>
Expand Down
12 changes: 9 additions & 3 deletions resources/lib/Player.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,11 @@ def displayRandomUnwatched(self):
unwatchedPage.setItem(episode[0])
self.logMsg("Calling display unwatched", 2)
unwatchedPage.show()
xbmc.Monitor().waitForAbort(10000)
monitor = xbmc.Monitor()
monitor.waitForAbort(10)
self.logMsg("Calling close unwatched", 2)
unwatchedPage.close()
del monitor

def strm_query(self, result):
try:
Expand Down Expand Up @@ -317,7 +319,9 @@ def autoPlayPlayback(self):
result = unicode(result, 'utf-8', errors='ignore')
result = json.loads(result)
self.logMsg("Got details of next up episode %s" % str(result), 2)
xbmc.Monitor().waitForAbort(100)
monitor = xbmc.Monitor()
monitor.waitForAbort(0.1)
del monitor

# Find the next unwatched and the newest added episodes
if "result" in result and "episodes" in result["result"]:
Expand Down Expand Up @@ -364,7 +368,9 @@ def autoPlayPlayback(self):
stillWatchingPage.show()
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.Monitor().waitForAbort(100)
monitor = xbmc.Monitor()
monitor.waitForAbort(0.1)
del monitor
try:
playTime = xbmc.Player().getTime()
totalTime = xbmc.Player().getTotalTime()
Expand Down
4 changes: 2 additions & 2 deletions service.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ def ServiceEntryPoint(self):
self.logMsg("Netflix style autoplay succeeded.", 2)
self.logMsg("playtime is %s" % (int(playTime)), 2)
self.logMsg("randomunwatchedtime is %s" % (int(randomunwatchedtime)), 2)
if (int(playTime) >= int(randomunwatchedtime)) and (int(playTime) < int(randomunwatchedtime+100)) and displayrandomunwatched and (
if (int(playTime) >= int(randomunwatchedtime)) and (int(playTime) < int(int(randomunwatchedtime)+100)) and displayrandomunwatched and (
lastUnwatchedFile is None or lastUnwatchedFile != currentFile):
self.logMsg("Calling display unwatched playtime is %s" % (int(playTime)), 2)
self.logMsg("Calling display unwatched", 2)
lastUnwatchedFile = currentFile
player.displayRandomUnwatched()

Expand Down

0 comments on commit c27e046

Please sign in to comment.