handle favorites on recently played

+ use client side timestamp on track logger
This commit is contained in:
mungai-njoroge
2023-12-10 13:27:54 +03:00
parent 312df06fc3
commit 4412902312
6 changed files with 44 additions and 22 deletions
+13
View File
@@ -86,3 +86,16 @@ class SQLiteFavoriteMethods:
with SQLiteManager(userdata_db=True) as cur:
cur.execute(sql, (fav_hash, fav_type))
cur.close()
@classmethod
def get_track_count(cls) -> int:
"""
Returns the number of favorite tracks.
"""
sql = """SELECT COUNT(*) FROM favorites WHERE type = ?"""
with SQLiteManager(userdata_db=True) as cur:
cur.execute(sql, (FavType.track,))
count = cur.fetchone()[0]
cur.close()
return count