mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
set up track logging
+ install flask restful
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
from flask_restful import Resource, reqparse
|
||||
from app.db.sqlite.logger.tracks import SQLiteTrackLogger as db
|
||||
|
||||
parser = reqparse.RequestParser()
|
||||
parser.add_argument("trackhash", type=str, required=True)
|
||||
parser.add_argument("duration", type=int, required=True)
|
||||
parser.add_argument("source", type=str, required=True)
|
||||
|
||||
|
||||
class LogTrack(Resource):
|
||||
def post(self):
|
||||
args = parser.parse_args(strict=True)
|
||||
|
||||
last_row = db.insert_track(
|
||||
args["trackhash"],
|
||||
args["duration"],
|
||||
args["source"],
|
||||
)
|
||||
|
||||
return {"last_row": last_row}
|
||||
Reference in New Issue
Block a user