def smartplay(self, mode='next'): if mode == 'scrape_next_episode': try: if self.content == 'movie': raise Exception() from resources.lib.modules import smartplay smartplay.scrape_next_episode(self.tvshowtitle, self.year, self.imdb, self.tvdb, 'en', season=self.season, episode=self.episode) except: pass elif mode == 'nextup': try: if self.content == 'movie': raise Exception() from resources.lib.modules import smartplay self.next_episode = smartplay.next_episode( self.tvshowtitle, self.year, self.imdb, self.tvdb, 'en', season=self.season, episode=self.episode) self.playNext = nextup.nextup(self.next_episode) except: pass elif mode == 'next_episode': try: from resources.lib.modules import smartplay self.next_episode = smartplay.next_episode( self.tvshowtitle, self.year, self.imdb, self.tvdb, 'en', season=self.season, episode=self.episode) except: pass elif mode == 'inprogress_next_episode': try: from resources.lib.modules import smartplay if len(self.next_episode) < 1: self.next_episode = smartplay.next_episode( self.tvshowtitle, self.year, self.imdb, self.tvdb, 'en', season=self.season, episode=self.episode) self.add_nextup_episode(self.next_episode) except: pass
def smartplay(self, mode='next'): if mode == 'scrape_next_episode': try: if self.content == 'movie': raise Exception() from resources.lib.modules import smartplay t = libThread.Thread(smartplay.scrape_next_episode, self.tvshowtitle, self.year, self.imdb, self.tvdb, 'en', season=self.season, episode=self.episode) t.start() except: pass elif mode == 'next_episode': try: if self.content == 'movie': raise Exception() from resources.lib.modules import smartplay if len(self.next_episode) > 0: raise Exception() self.next_episode = smartplay.next_episode( self.tvshowtitle, self.year, self.imdb, self.tvdb, 'en', season=self.season, episode=self.episode) return self.next_episode except: pass elif mode == 'play_next': try: from resources.lib.modules import smartplay self.next_episode = smartplay.next_episode( self.tvshowtitle, self.year, self.imdb, self.tvdb, 'en', season=self.season, episode=self.episode) smartplay.play_next_episode(self.next_episode) except: pass