Example #1
0
def search(artist, title, config):
    if (not artist) or (not title):
        logging.warning('Skip search - song artist and title can\'t be empty string')
        return []

    [artist, title] = preprocessor.apply(artist, title, config.preprocessor_opts)

    if config.sync:
        results = search_sync(artist, title, config)
    else:
        results = search_async(artist, title, config)

    if not config.skip_cleanup:
        cleanup_cache(config)

    return results
Example #2
0
def search(artist, title, config):
    if (not artist) or (not title):
        logging.warning('Skip search - song artist and title can\'t be empty string')
        return []

    [artist, title] = preprocessor.apply(artist, title, config.preprocessor_opts)

    if config.sync:
        results = search_sync(artist, title, config)
    else:
        results = search_async(artist, title, config)

    if not config.skip_cleanup:
        cleanup_cache(config)

    return results
def check_em(artist: str, title: str, clean_artist: str, clean_title: str):
    (processed_artist, processed_title) = preprocessor.apply(artist, title, ['trim'])
    assert processed_artist == clean_artist
    assert processed_title == clean_title
Example #4
0
def check_em(artist: str, title: str, clean_artist: str, clean_title: str):
    (processed_artist,
     processed_title) = preprocessor.apply(artist, title, ['trim'])
    assert processed_artist == clean_artist
    assert processed_title == clean_title