Add tags into database

master
Sven Slootweg 13 years ago
parent 577ceda8aa
commit 07749fedf7

@ -105,7 +105,6 @@ for event, element in iterparse(xml, tag="artist"):
cursor.execute("INSERT INTO tracks VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", (trackid, artistid, albumid, trackname, trackfilename, trackmbgid, tracknumber, trackgenre, tracklicense)) cursor.execute("INSERT INTO tracks VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", (trackid, artistid, albumid, trackname, trackfilename, trackmbgid, tracknumber, trackgenre, tracklicense))
alltags = []
taglist = track.find('Tags') taglist = track.find('Tags')
if taglist is not None: if taglist is not None:
@ -113,6 +112,6 @@ for event, element in iterparse(xml, tag="artist"):
# idstr, weight # idstr, weight
tagid = get_attribute(tag, 'idstr') tagid = get_attribute(tag, 'idstr')
tagweight = get_attribute(tag, 'weight') tagweight = get_attribute(tag, 'weight')
alltags.append("%s (weight %s)" % (tagid, tagweight)) cursor.execute("INSERT INTO tags VALUES (?, ?, ?)", (trackid, tagid, tagweight))
element.clear() element.clear()

Loading…
Cancel
Save