def render_show_info(self): if self.episode != None: server.emit('show-name', self.episode.name) parser = fmk.Parser() info = parser.parse_season_episode_info(self.season.number, self.episode.number) server.emit('season-episode-info', info) elif self.show_name != None: server.emit('show-name', self.show_name) server.emit('season-episode-info', "") else: server.emit('show-name', self.name) server.emit('season-episode-info', "")
def render_scan(self): start = self.last_show_parsed end = self.last_show_parsed + self.show_parse_length if self.last_show_parsed + self.show_parse_length >= len(self.shows): end = len(self.shows) self.last_show_parsed = end if start != end: # Create parser object parser = fmk.Parser() shows_json = parser.parse_shows(self.shows[start:end]) self.emit_scan_result(shows_json)
def render_opened_app(self): parser = fmk.Parser() opened_app_json = None if not self.created_open_app: opened_app_json = parser.parse_open_app(self.name, "", self.id_) self.created_open_app = True server.emit("opened-apps", opened_app_json) else: opened_app_json = None if self.episode != None: opened_app_json = parser.parse_open_app(self.name, self.episode.name, self.id_) elif self.show_name != None: opened_app_json = parser.parse_open_app(self.name, self.show_name, self.id_) else: opened_app_json = parser.parse_open_app(self.name, "", self.id_) server.emit("opened-apps-update", opened_app_json)
def start_show(self, name, url): show = None for iter_show in self.shows: if iter_show.name == name and iter_show.url == url: show = iter_show break if show != None: # Check if element contains episodes is_series = self.deep_scan(show) if not is_series: # It is not a series, open player self.get(show.url) else: # Create parser object parser = fmk.Parser() # Show the results scan_result = parser.parse_series(show) self.emit_scan_result(scan_result) else: self.get(url)