mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
save track logs to logged in user
+ rewrite migration collection + prevent logging invalid track logs + add jsoni
This commit is contained in:
@@ -3,7 +3,7 @@ from app.db.sqlite.utils import SQLiteManager
|
||||
|
||||
class SQLiteTrackLogger:
|
||||
@classmethod
|
||||
def insert_track(cls, trackhash: str, duration: int, source: str, timestamp: int):
|
||||
def insert_track(cls, trackhash: str, duration: int, source: str, timestamp: int, userid: int):
|
||||
"""
|
||||
Inserts a track into the database
|
||||
"""
|
||||
@@ -18,7 +18,7 @@ class SQLiteTrackLogger:
|
||||
) VALUES(?,?,?,?,?)
|
||||
"""
|
||||
|
||||
cur.execute(sql, (trackhash, duration, timestamp, source, 0))
|
||||
cur.execute(sql, (trackhash, duration, timestamp, source, userid))
|
||||
lastrowid = cur.lastrowid
|
||||
|
||||
return lastrowid
|
||||
|
||||
Reference in New Issue
Block a user