'Returns an artist string (all artists) and an artist_id (the main
artist) for a list of discogs album or track artists.'

def get_artist(self, artists):

    artist_id = None
    bits = []
    for (i, artist) in enumerate(artists):
        if (not artist_id):
            artist_id = artist['id']
        name = artist['name']
        name = re.sub('    \\(\\d+\\)$', '', name)
        name = re.sub('(?i)^(.*?),    (a|an|the)$', '\\2    \\1', name)
        bits.append(name)
        if (artist['join'] and (i < (len(artists) - 1))):
            bits.append(artist['join'])
    artist = ('    '.join(bits).replace('    ,', ',') or None)
    return (artist, artist_id)
