Changed insert_hashes to fit the new data format

This commit is contained in:
Vin 2013-12-17 00:48:49 +00:00 committed by Wessie
parent 0bd7219b87
commit ab2cf9d58b

5
dejavu/database.py Normal file → Executable file
View file

@ -260,14 +260,13 @@ class SQLDatabase(Database):
"""
return self.query(None)
def insert_hashes(self, hashes):
def insert_hashes(self, sid, hashes):
"""
Insert series of hash => song_id, offset
values into the database.
"""
# TODO: Fix this when hashes will be a new format.
values = []
for hash, (sid, offset) in hashes:
for hash, offset in hashes:
values.append((hash, sid, offset))
with self.cursor() as cur: