def guessit(name, options=None): """Guess the episode information from a given release name. :param name: the release name :type name: str :param options: :type options: dict :return: the guessed properties :rtype: dict """ start_time = time() final_options = dict(options) if options else dict(show_type='normal') final_options.update(dict(type='episode', implicit=True, episode_prefer_number=final_options.get('show_type') == 'anime', expected_title=get_expected_titles(app.showList), expected_group=expected_groups, allowed_languages=allowed_languages, allowed_countries=allowed_countries)) result = guessit_cache.get_or_invalidate(name, final_options) if not result: result = default_api.guessit(name, options=final_options) guessit_cache.add(name, result) result['parsing_time'] = time() - start_time return result
def guessit(name, options=None): """Guess the episode information from a given release name. :param name: the release name :type name: str :param options: :type options: dict :return: the guessed properties :rtype: dict """ start_time = time() final_options = dict(options) if options else dict() final_options.update(dict(type='episode', implicit=True, episode_prefer_number=final_options.get('show_type') == 'anime', expected_title=get_expected_titles(app.showList), expected_group=expected_groups, allowed_languages=allowed_languages, allowed_countries=allowed_countries)) result = default_api.guessit(name, options=final_options) result['parsing_time'] = time() - start_time return result