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
+1 -3
View File
@@ -1,10 +1,9 @@
from app.db.sqlite.utils import SQLiteManager
import time
class SQLiteTrackLogger:
@classmethod
def insert_track(cls, trackhash: str, duration: int, source: str):
def insert_track(cls, trackhash: str, duration: int, source: str, timestamp: int):
"""
Inserts a track into the database
"""
@@ -18,7 +17,6 @@ class SQLiteTrackLogger:
userid
) VALUES(?,?,?,?,?)
"""
timestamp = int(time.time())
cur.execute(sql, (trackhash, duration, timestamp, source, 0))
lastrowid = cur.lastrowid