def find_and_play(self, video_filter): filtered_entities = self.find_entities(video_filter) entity = filtering.get_best_match(filtered_entities) logger.debug(u'Found Entity {}'.format(str(entity))) if not entity: notification(strings.NOTHING_FOUND) return False try: if 'movieid' in entity: self._set_last_playback_change_at() play_movie(entity) elif 'tvshowid' in entity: season, episode = _pick(video_filter, 'season', 'episode') self._set_last_playback_change_at() play_tvshow(entity, season, episode) else: logger.error( 'Invalid entity, not "movieid" nor "tvshowid" found') return False except Exception as error: logger.error(u'Failed to play entity: {}'.format(str(error))) return True
def previous_item(self): if not self.current_item: return False if 'tvshowid' in self.current_item: tvshow_id, season, episode = _pick(self.current_item, 'tvshowid', 'season', 'episode') if tvshow_id and season and episode: previous_episode_id = get_previous_episode_id( tvshow_id, season, episode) if previous_episode_id: play_episodeid(previous_episode_id) return True return False
def next_item(self): logger.debug('Next item, current_item: {}'.format( str(self.current_item))) if not self.current_item: return False if 'tvshowid' in self.current_item: tvshow_id, season, episode = _pick(self.current_item, 'tvshowid', 'season', 'episode') if tvshow_id and season and episode: next_episode_id = get_next_episode_id(tvshow_id, season, episode) if next_episode_id: play_episodeid(next_episode_id) return True return False
def find_and_play(self, video_filter): filtered_entities = self.find_entities(video_filter) entity = filtering.get_best_match(filtered_entities) logger.debug('Found Entity {}'.format(str(entity))) if not entity: notification(strings.NOTHING_FOUND) return False if 'movieid' in entity: play_movie(entity) elif 'tvshowid' in entity: season, episode = _pick(video_filter, 'season', 'episode') play_tvshow(entity, season, episode) else: return False return True