add methods to get recently played items

This commit is contained in:
mungai-njoroge committed 2023-12-03 20:35:13 +03:00
1 parent 5a420214f2
commit ddfa7f1b03
10 files changed
+277 -101

No files matched your search

+14
View File
@@ -24,3 +24,17 @@ class SQLiteTrackLogger:
lastrowid = cur.lastrowid
return lastrowid
@classmethod
def get_all(cls):
"""
Returns all tracks from the database
"""
with SQLiteManager(userdata_db=True) as cur:
sql = """SELECT * FROM track_logger ORDER BY timestamp DESC"""
cur.execute(sql)
rows = cur.fetchall()
return rows