mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
add methods to get recently played items
This commit is contained in:
+10
-1
@@ -1,6 +1,7 @@
|
||||
from flask_restful import Resource, reqparse
|
||||
|
||||
from app.lib.home.recents import get_recent_items
|
||||
from app.lib.home.recentlyadded import get_recent_items
|
||||
from app.lib.home.recentlyplayed import get_recently_played
|
||||
|
||||
parser = reqparse.RequestParser()
|
||||
|
||||
@@ -15,3 +16,11 @@ class RecentlyAdded(Resource):
|
||||
limit = args["limit"]
|
||||
|
||||
return {"items": get_recent_items(cutoff, limit), "cutoff": cutoff}
|
||||
|
||||
|
||||
class RecentlyPlayed(Resource):
|
||||
def get(self):
|
||||
args = parser.parse_args()
|
||||
limit = args["limit"]
|
||||
|
||||
return {"items": get_recently_played(limit)}
|
||||
|
||||
Reference in New Issue
Block a user