Changed insert_hashes to fit the new data format

This commit is contained in:
Vin 2013-12-17 00:48:49 +00:00
parent 9faf2cd591
commit 3bc507d8e4

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

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