Skip to content

Commit

Permalink
fixed issue with rowcount = 0 when using count queries
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricio-repetto committed Jan 8, 2020
1 parent acca344 commit b88f6b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dejavu/base_classes/common_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def get_num_songs(self) -> int:
: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

Expand All @@ -71,7 +71,7 @@ def get_num_fingerprints(self) -> int:
: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

Expand Down

0 comments on commit b88f6b6

Please sign in to comment.