<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def album_to_ref(album):
 """Convert a mopidy album to a mopidy ref."""

    name = ''
    for artist in album.artists:
        if len(name) > 0:
            name += ', '
        name += artist.name
    if (len(name)) > 0:
        name += ' - '
    if album.name:
        name += album.name
    else:
        name += 'Unknown Album'
    return Ref.directory(uri=album.uri, name=name)