1
0
Fork 0
mirror of https://github.com/Findus23/RadioStats.git synced 2024-09-19 16:03:48 +02:00
This commit is contained in:
Lukas Winkler 2018-02-08 16:41:13 +01:00
parent a8cd18ba45
commit d5cf8425bd
No known key found for this signature in database
GPG key ID: 94AFBE7C2656A5B5
2 changed files with 6 additions and 3 deletions

View file

@ -72,7 +72,7 @@ for channel in Channel.select():
else:
artist = ""
title = song["title"]
if channel.shortname == "fm4" and "|" in artist:
artist = artist.split("|")[0]
if channel.shortname == "fm4" and "|" in title:
title = title.split("|")[0]
add_entry(time, artist, title)

View file

@ -1,4 +1,4 @@
from flask import jsonify
from flask import jsonify, request
from playhouse.shortcuts import model_to_dict
from app import app
@ -41,6 +41,9 @@ def popular(channel):
.join(Channel).switch(Play).join(Song) \
.where((Song.show == 0) & (Channel.shortname == channel)) \
.group_by(Play.song).order_by(SQL('count').desc())
if request.args.get('offset'):
print(request.args.get('offset'))
get = get.offset(int(request.args.get('offset')))
return query_to_response(get, extra_attrs=["count"], exclude=[Play.channel, Play.time, Play.id])