From 07749fedf78104afef3f92e0e2ce7c740ad1236d Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 3 Jun 2012 04:42:59 +0200 Subject: [PATCH] Add tags into database --- jamendoparser.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jamendoparser.py b/jamendoparser.py index 0baa021..4365b9e 100644 --- a/jamendoparser.py +++ b/jamendoparser.py @@ -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)) - alltags = [] taglist = track.find('Tags') if taglist is not None: @@ -113,6 +112,6 @@ for event, element in iterparse(xml, tag="artist"): # idstr, weight tagid = get_attribute(tag, 'idstr') tagweight = get_attribute(tag, 'weight') - alltags.append("%s (weight %s)" % (tagid, tagweight)) + cursor.execute("INSERT INTO tags VALUES (?, ?, ?)", (trackid, tagid, tagweight)) element.clear()