def _recordings_for_artist(self, artistid): recordings = [] artist = carnatic.get_artist(artistid) releases = artist["concerts"] for r in releases: release = carnatic.get_concert(r["mbid"]) relrecs = release["recordings"] for t in relrecs: recordings.append(t["mbid"]) return recordings
def _artists_for_recording(self, recordingid): recording = carnatic.get_recording(recordingid) concert = recording.get("concert") if concert: concertid = concert[0]["mbid"] concert = carnatic.get_concert(concertid) artists = concert["concert_artists"] return [a["mbid"] for a in artists] else: return []