#NEWLINE# def lookup_meta( conn , meta_ids ) : #NEWLINE# #INDENT# if ( not meta_ids ) : #NEWLINE# #INDENT# return [ ] #NEWLINE# #UNINDENT# query = schema . meta . select ( schema . meta . c . id . in_ ( result ) ) #NEWLINE# results = [ ] #NEWLINE# for row in conn . execute ( query ) : #NEWLINE# #INDENT# result = { #NEWLINE# #INDENT# '_no_ids' : True , #NEWLINE# 'recording_id' : row [ 'id' ] , #NEWLINE# 'recording_title' : row [ 'track' ] , #NEWLINE# 'recording_artists' : [ ] , #NEWLINE# 'recording_duration' : None , #NEWLINE# 'track_id' : row [ 'id' ] , #NEWLINE# 'track_position' : row [ 'track_no' ] , #NEWLINE# 'track_title' : row [ 'track' ] , #NEWLINE# 'track_artists' : [ ] , #NEWLINE# 'track_duration' : None , #NEWLINE# 'medium_position' : row [ 'disc_no' ] , #NEWLINE# 'medium_format' : None , #NEWLINE# 'medium_title' : None , #NEWLINE# 'medium_track_count' : None , #NEWLINE# 'release_rid' : row [ 'id' ] , #NEWLINE# 'release_id' : row [ 'id' ] , #NEWLINE# 'release_title' : row [ 'album' ] , #NEWLINE# 'release_artists' : [ ] , #NEWLINE# 'release_medium_count' : None , #NEWLINE# 'release_track_count' : None , #NEWLINE# 'release_events' : [ { #NEWLINE# #INDENT# 'release_date_year' : row [ 'year' ] , #NEWLINE# 'release_date_month' : None , #NEWLINE# 'release_date_day' : None , #NEWLINE# 'release_country' : '' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'release_group_id' : row [ 'id' ] , #NEWLINE# 'release_group_title' : row [ 'album' ] , #NEWLINE# 'release_group_artists' : [ ] , #NEWLINE# 'release_group_primary_type' : None , #NEWLINE# 'release_group_secondary_types' : [ ] , #NEWLINE# #UNINDENT# } #NEWLINE# if row [ 'artist' ] : #NEWLINE# #INDENT# result [ 'recording_artists' ] . append ( row [ 'artist' ] ) #NEWLINE# result [ 'track_artists' ] . append ( row [ 'artist' ] ) #NEWLINE# #UNINDENT# if row [ 'album_artist' ] : #NEWLINE# #INDENT# result [ 'release_artists' ] . append ( row [ 'album_artist' ] ) #NEWLINE# result [ 'release_group_artists' ] . append ( row [ 'album_artist' ] ) #NEWLINE# #UNINDENT# results . append ( result ) #NEWLINE# #UNINDENT# return results