def get_personids_from_record(record):
    """Returns all the personids associated to a record.

    We limit the result length to 20 authors, after which it returns an
    empty set for performance reasons
    """
    ids = get_personids_from_bibrec(record)
    if 0 < len(ids) <= 20:
        person_ids = set(ids)
    else:
        person_ids = set()

    return person_ids
def get_authors_from_record(recID, tags):
    """Get all authors for a record

    We need this function because there's 3 different types of authors
    and to fetch each one of them we need look through MARC tags
    """
    authors = get_personids_from_bibrec(recID)

    if not authors:
        mainauth_list = get_fieldvalues(recID, tags['first_author'])
        coauth_list = get_fieldvalues(recID, tags['additional_author'])
        extauth_list = get_fieldvalues(recID, tags['alternative_author_name'])

        authors = set(mainauth_list)
        authors.update(coauth_list)
        authors.update(extauth_list)

    return authors
def get_authors_from_record(recID, tags):
    """Get all authors for a record

    We need this function because there's 3 different types of authors
    and to fetch each one of them we need look through MARC tags
    """
    authors = get_personids_from_bibrec(recID)

    if not authors:
        mainauth_list = get_fieldvalues(recID, tags['first_author'])
        coauth_list   = get_fieldvalues(recID, tags['additional_author'])
        extauth_list  = get_fieldvalues(recID, tags['alternative_author_name'])

        authors = set(mainauth_list)
        authors.update(coauth_list)
        authors.update(extauth_list)

    return authors