def _artists_for_recording(self, recordingid): recording = hindustani.get_recording(recordingid) release = recording.get("release") if release: release = hindustani.get_release(release[0]["mbid"]) artists = release["release_artists"] return [a["mbid"] for a in artists] else: return []
def _recordings_for_artist(self, artistid): recordings = [] artist = hindustani.get_artist(artistid) releases = artist["releases"] for r in releases: release = hindustani.get_release(r["mbid"]) tracks = release["recordings"] for t in tracks: recordings.append(t["mbid"]) return recordings