def post(self): artist_id = request.form.get('artist', None) try: a = api.Artist.get(tag=artist_id) except: meta = Archive.item_metadata(artist_id) name = meta['metadata']['title'] a = api.Artist(name=name, tag=artist_id) a.create() results = [] cids = [c['identifier'] for c in a.get_concerts()] for cid in cids: try: c = api.Concert.get(tag=cid) except: c = api.Concert(tag=cid, artist_id=a.id) c.create() c.register_tracks() return a.dict()
def get_metadata(self): return Archive.get_metadata(self.tag)