def get_show_progress(self, slug): if not slug: return return use_lastupdated_cache( self._cache, self.get_response_json, 'shows', slug, 'progress/watched', sync_info=self.get_sync('watched', 'show', 'slug').get(slug), cache_name=u'TraktAPI.get_show_progress.response.{}'.format(slug))
def _is_inprogress_show(self, item, hidden_shows=None): """ Checks whether the show passed is in progress by comparing total and watched Optionally can pass a list of hidden_shows trakt slugs to ignore """ slug = item.get('show', {}).get('ids', {}).get('slug') if hidden_shows and slug in hidden_shows: return aired_episodes = item.get('show', {}).get('aired_episodes', 0) if not aired_episodes: return watch_episodes = use_lastupdated_cache( self._cache, self.get_episodes_watchcount, slug, 'slug', tvshow=item, count_progress=True, cache_name=u'TraktAPI.get_episodes_watchcount.response.slug.{}.True'.format(slug), sync_info=item) if aired_episodes <= watch_episodes: return return item