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')
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
def leaderboard(location_id): hrs = request.args.get('hours', 0, type=int) l = Location.from_id(location_id) return json.dumps(l.leaderboard(hrs))
def getFlash(location_id): l = Location.from_id(location_id) return json.dumps(l.marketing_message)
def getPlaylist(location_id): l = Location.from_id(location_id) try: return l.playlist().to_json() except: return common.fail()
def vote(): l = Location.from_id(request.form["location_id"]) return l.vote(request.form["playlist_item_id"], request.form["direction"])
def venue_flash(): l = Location.from_id(request.form["location_id"]) l.flash(request.form["message"]) return ""
def markPlaying(): l = Location.from_id(request.form["location_id"]) l.mark_playing(request.form["playlist_item_id"]) return ""
def bump(): l = Location.from_id(request.form["location_id"]) l.bump(request.form["playlist_item_id"]) return ""