add methods to get recently played items

This commit is contained in:
mungai-njoroge
2023-12-03 20:35:13 +03:00
parent 5a420214f2
commit ddfa7f1b03
10 changed files with 277 additions and 101 deletions
+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