Exemple #1
0
def index(location_id):
#    return "<h1><b>That's all for tonight folks</b></h1>Thanks for playing!<p><a href='mailto:[email protected]'>Contact the team</a> behind milkshake.fm</p>"
    l = Location.from_id(location_id)
    if not l:
        l = Location(name="whatever")
        l.save()
    return render_template('client.html')
Exemple #2
0
def addTrack():
    l = Location.from_id(request.form["location_id"])
    uid = User.current_id()
    if User.is_admin() and request.form["special"] == "true":
        special = 1
        uid = 29 #MAGIC NUMBER!!! This is the ID of the MSS user on the server
    else:
        special = 0
    ret = l.add_track(request.form["provider_id"], uid, special)
    return ret
Exemple #3
0
def leaderboard(location_id):
    hrs = request.args.get('hours', 0, type=int)
    l = Location.from_id(location_id)
    return json.dumps(l.leaderboard(hrs))
Exemple #4
0
def getFlash(location_id):
    l = Location.from_id(location_id)
    return json.dumps(l.marketing_message)
Exemple #5
0
def getPlaylist(location_id):
    l = Location.from_id(location_id)
    try:
        return l.playlist().to_json()
    except:
        return common.fail()
Exemple #6
0
def vote():
    l = Location.from_id(request.form["location_id"])
    return l.vote(request.form["playlist_item_id"], request.form["direction"])
Exemple #7
0
def venue_flash():
    l = Location.from_id(request.form["location_id"])
    l.flash(request.form["message"])
    return ""
Exemple #8
0
def markPlaying():
    l = Location.from_id(request.form["location_id"])
    l.mark_playing(request.form["playlist_item_id"])
    return ""
Exemple #9
0
def bump():
    l = Location.from_id(request.form["location_id"])
    l.bump(request.form["playlist_item_id"])
    return ""