mirror of
https://github.com/Findus23/RadioStats.git
synced 2024-09-19 16:03:48 +02:00
fix fm4
This commit is contained in:
parent
a8cd18ba45
commit
d5cf8425bd
2 changed files with 6 additions and 3 deletions
4
fetch.py
4
fetch.py
|
@ -72,7 +72,7 @@ for channel in Channel.select():
|
||||||
else:
|
else:
|
||||||
artist = ""
|
artist = ""
|
||||||
title = song["title"]
|
title = song["title"]
|
||||||
if channel.shortname == "fm4" and "|" in artist:
|
if channel.shortname == "fm4" and "|" in title:
|
||||||
artist = artist.split("|")[0]
|
title = title.split("|")[0]
|
||||||
|
|
||||||
add_entry(time, artist, title)
|
add_entry(time, artist, title)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from flask import jsonify
|
from flask import jsonify, request
|
||||||
from playhouse.shortcuts import model_to_dict
|
from playhouse.shortcuts import model_to_dict
|
||||||
|
|
||||||
from app import app
|
from app import app
|
||||||
|
@ -41,6 +41,9 @@ def popular(channel):
|
||||||
.join(Channel).switch(Play).join(Song) \
|
.join(Channel).switch(Play).join(Song) \
|
||||||
.where((Song.show == 0) & (Channel.shortname == channel)) \
|
.where((Song.show == 0) & (Channel.shortname == channel)) \
|
||||||
.group_by(Play.song).order_by(SQL('count').desc())
|
.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])
|
return query_to_response(get, extra_attrs=["count"], exclude=[Play.channel, Play.time, Play.id])
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue