Exemple #1
0
def get_populated_artist(mbid):
    """
    Make sure artist document is present and contains data required by mmda.artists.show_artist

    @param mbid:    a string containing a MusicBrainz ID of an artist

    @return: a CachedArtist object containing required minimal data set
    """
    artist = get_basic_artist(mbid)

    artist = populate_abstract(artist)
    artist = populate_artist_lastfm(artist)

    artist.save_any_changes()

    return artist
Exemple #2
0
def get_populated_releasegroup_with_release(mbid):
    """
    Return populated objects required by mmda.artists.show_release

    @param mbid: a string containing a MusicBrainz ID of a release

    @return:  a tuple: (release group, release)
    """

    release_group   = get_basic_release(mbid)
    release_group   = _populate_deep_release_mb(release_group, mbid)

    # used only by mmda.artists.show_release
    release_group   = populate_abstract(release_group)
    release_group   = populate_release_lastfm(release_group, mbid)

    release_group.save_any_changes()

    return (release_group, release_group.releases[mbid])