Skip to content

Commit

Permalink
#149:Issue processing discogs_20250101_artists.xml file failed on pro…
Browse files Browse the repository at this point in the history
…cessing members element

Fixed members so handles id element being moved to an attrbiute of the name element.
  • Loading branch information
ijabz authored Jan 23, 2025
1 parent 2352dae commit b2f7ab6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions discogsxml2db/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ class DiscogsArtistParser(DiscogsDumpEntityParser):

entity_tag = "artist"

# <members><id>26</id><name>Alexi Delano</name><id>27</id><name>Cari Lekebusch</name></members>
# <members><name id="26">Alexi Delano</name><name id="27">Cari Lekebusch</name></members>
def element_members(self, element):
for id, name in grouper([child.text for child in element.iterchildren()], 2):
yield int(id), name.strip()

for child in element.iterchildren():
yield int(child.get('id')), child.text.strip()
def build_entity(self, entity_id, element):
artist = Artist()
artist.id = entity_id
Expand Down

0 comments on commit b2f7ab6

Please sign in to comment.