Advertisement
Guest User

tvtunes - diff - don't repeat tune

a guest
Jul 17th, 2011
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. 30a31,32
  2. > self.lastplayedpath = ""
  3. > self.lastplaytime = 0
  4. 118,123c120,130
  5. < if not self.loud: self.lower_volume()
  6. < xbmcgui.Window( 10025 ).setProperty( "TvTunesIsAlive", "true" )
  7. < print "### start playing %s" % self.playpath
  8. < xbmc.Player().play(self.playpath)
  9. < if params.get("loop", "false" ) == "true" : xbmc.executebuiltin('XBMC.PlayerControl(Repeat)')
  10. < else: xbmc.executebuiltin('XBMC.PlayerControl(RepeatOff)')
  11. ---
  12. > if (self.lastplayedpath != self.playpath) or (time.time() - 300 >= self.lastplaytime):
  13. > self.lastplayedpath = self.playpath
  14. > self.lastplaytime = time.time()
  15. >
  16. > if not self.loud: self.lower_volume()
  17. > xbmcgui.Window( 10025 ).setProperty( "TvTunesIsAlive", "true" )
  18. > print "### start playing %s" % self.playpath
  19. > xbmc.Player().play(self.playpath)
  20. > if params.get("loop", "false" ) == "true" : xbmc.executebuiltin('XBMC.PlayerControl(Repeat)')
  21. > else: xbmc.executebuiltin('XBMC.PlayerControl(RepeatOff)')
  22. > else: print "### Not playing theme %s, since it has already been played recently " % ( self.playpath )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement