mirror of
https://github.com/correl/dejavu.git
synced 2024-11-23 11:09:52 +00:00
fixed issue with rowcount = 0 when using count queries
This commit is contained in:
parent
acca344f23
commit
b88f6b6ac4
1 changed files with 2 additions and 2 deletions
|
@ -59,7 +59,7 @@ class CommonDatabase(BaseDatabase, metaclass=abc.ABCMeta):
|
|||
|
||||
:return: the amount of songs in the database.
|
||||
"""
|
||||
with self.cursor() as cur:
|
||||
with self.cursor(buffered=True) as cur:
|
||||
cur.execute(self.SELECT_UNIQUE_SONG_IDS)
|
||||
count = cur.fetchone()[0] if cur.rowcount != 0 else 0
|
||||
|
||||
|
@ -71,7 +71,7 @@ class CommonDatabase(BaseDatabase, metaclass=abc.ABCMeta):
|
|||
|
||||
:return: the number of fingerprints in the database.
|
||||
"""
|
||||
with self.cursor() as cur:
|
||||
with self.cursor(buffered=True) as cur:
|
||||
cur.execute(self.SELECT_NUM_FINGERPRINTS)
|
||||
count = cur.fetchone()[0] if cur.rowcount != 0 else 0
|
||||
|
||||
|
|
Loading…
Reference in a new issue