Пример #1
0
 def post(self):
     info.attach_info_to_request(self,
                                 extra_list=self.get_cookie("r5_list"),
                                 live_voting=True)
     self.append("stream_filename",
                 config.get_station(self.sid, "stream_filename"))
     self.append("station_list", config.station_list)
     self.append("relays", config.public_relays[self.sid])
Пример #2
0
	def get(self):
		info.attach_info_to_request(self, all_lists=True)
		self.append("api_info", { "time": int(time.time()) })
		self.render("index.html", request=self,
					site_description=self.locale.translate("station_description_id_%s" % self.sid),
					revision_number=config.build_number,
					api_url=config.get("api_external_url_prefix"),
					cookie_domain=config.get("cookie_domain"),
					locales=api.locale.locale_names_json)
Пример #3
0
	def get(self):
		info.attach_info_to_request(self, playlist=True, artists=True)
		self.append("api_info", { "time": int(time.time()) })
		self.render("beta_index.html", request=self,
					site_description=self.locale.translate("station_description_id_%s" % self.sid),
					jsfiles=jsfiles,
					revision_number=config.get("revision_number"),
					api_url=config.get("api_external_url_prefix"),
					cookie_domain=config.get("cookie_domain"))
Пример #4
0
 def get(self):
     info.attach_info_to_request(self, playlist=True, artists=True)
     self.append("api_info", {"time": int(time.time())})
     self.render("beta_index.html",
                 request=self,
                 site_description=self.locale.translate(
                     "station_description_id_%s" % self.sid),
                 jsfiles=jsfiles,
                 revision_number=config.get("revision_number"),
                 api_url=config.get("api_external_url_prefix"),
                 cookie_domain=config.get("cookie_domain"))
Пример #5
0
 def get(self):
     info.attach_info_to_request(self, all_lists=True)
     self.append("api_info", {"time": int(time.time())})
     self.render("index.html",
                 request=self,
                 site_description=self.locale.translate(
                     "station_description_id_%s" % self.sid),
                 revision_number=config.build_number,
                 api_url=config.get("api_external_url_prefix"),
                 cookie_domain=config.get("cookie_domain"),
                 locales=api.locale.locale_names_json)
Пример #6
0
	def get(self):
		info.attach_info_to_request(self, extra_list=self.get_cookie("r4_active_list"))
		self.append("api_info", { "time": int(time.time()) })
		self.render("r4_index.html", request=self,
					site_description=self.locale.translate("station_description_id_%s" % self.sid),
					revision_number=config.build_number,
					jsfiles=self.jsfiles,
					api_url=config.get("api_external_url_prefix"),
					cookie_domain=config.get("cookie_domain"),
					locales=api.locale.locale_names_json,
					relays=config.public_relays_json[self.sid],
					stream_filename=config.get_station(self.sid, "stream_filename"),
					station_list=config.station_list_json)
Пример #7
0
	def get(self):
		info.attach_info_to_request(self)
		self.set_header("Content-Type", "text/plain")
		self.render("index.html", user=self.user, info=tornado.escape.json_encode(self.info), sid=self.sid)
		
# @handle_url("authtest_beta")
# class BetaIndex(MainIndex):
	# def get(self):
		# if self.user.data['group_id'] not in (5, 4, 8, 12, 15, 14, 17):
			# self.send_error(403)
		# else:
			# info.attach_info_to_request(self)
			# self.set_header("Content-Type", "text/plain")
			# self.render("index.html", user=self.user, info=tornado.escape.json_encode(self.info), sid=self.sid)
Пример #8
0
	def get(self):
		self.mobile = self.request.headers.get("User-Agent").lower().find("mobile") != -1 or self.request.headers.get("User-Agent").lower().find("android") != -1
		info.attach_info_to_request(self, extra_list=self.get_cookie("r4_active_list"))
		self.append("api_info", { "time": int(time.time()) })
		self.render(self.page_template, request=self,
					site_description=self.locale.translate("station_description_id_%s" % self.sid),
					revision_number=config.build_number,
					jsfiles=self.jsfiles,
					api_url=config.get("api_external_url_prefix"),
					cookie_domain=config.get("cookie_domain"),
					locales=api.locale.locale_names_json,
					relays=config.public_relays_json[self.sid],
					stream_filename=config.get_station(self.sid, "stream_filename"),
					station_list=config.station_list_json,
					apple_home_screen_icon=config.get_station(self.sid, "apple_home_screen_icon"),
					mobile=self.mobile)
Пример #9
0
	def post(self):
		info.attach_info_to_request(self, live_voting=True)
		self.append("build_version", config.build_number)
		self.append("locale", self.locale.code)
		self.append("locales", api.locale.locale_names)
		self.append("cookie_domain", config.get("cookie_domain"))
		self.append("on_init", [])
		self.append("on_measure", [])
		self.append("on_draw", [])
		self.append("websocket_host", config.get("websocket_host"))
		self.append("stream_filename", config.get_station(self.sid, "stream_filename"))
		self.append("station_list", config.station_list)
		self.append("relays", config.public_relays[self.sid])
		if self.is_mobile:
			self.append("mobile", True)
		else:
			self.append("mobile", False)
Пример #10
0
	def post(self):
		info.attach_info_to_request(self, live_voting=True)
		self.append("build_version", config.build_number)
		self.append("locale", self.locale.code)
		self.append("locales", api.locale.locale_names)
		self.append("cookie_domain", config.get("cookie_domain"))
		self.append("on_init", [])
		self.append("on_measure", [])
		self.append("on_draw", [])
		self.append("websocket_host", config.get("websocket_host"))
		self.append("stream_filename", config.get_station(self.sid, "stream_filename"))
		self.append("station_list", config.station_list)
		self.append("relays", config.public_relays[self.sid])
		if self.is_mobile:
			self.append("mobile", True)
		else:
			self.append("mobile", False)
Пример #11
0
 def get(self):
     info.attach_info_to_request(
         self, extra_list=self.get_cookie("r4_active_list"))
     self.append("api_info", {"time": int(time.time())})
     self.render("r4_index.html",
                 request=self,
                 site_description=self.locale.translate(
                     "station_description_id_%s" % self.sid),
                 revision_number=config.build_number,
                 jsfiles=self.jsfiles,
                 api_url=config.get("api_external_url_prefix"),
                 cookie_domain=config.get("cookie_domain"),
                 locales=api.locale.locale_names_json,
                 relays=config.public_relays_json[self.sid],
                 stream_filename=config.get_station(self.sid,
                                                    "stream_filename"),
                 station_list=config.station_list_json)
Пример #12
0
 def get(self):
     self.mobile = self.request.headers.get("User-Agent").lower().find(
         "mobile") != -1 or self.request.headers.get(
             "User-Agent").lower().find("android") != -1
     info.attach_info_to_request(
         self, extra_list=self.get_cookie("r4_active_list"))
     self.append("api_info", {"time": int(time.time())})
     self.render(self.page_template,
                 request=self,
                 site_description=self.locale.translate(
                     "station_description_id_%s" % self.sid),
                 revision_number=config.build_number,
                 jsfiles=self.jsfiles,
                 api_url=config.get("api_external_url_prefix"),
                 cookie_domain=config.get("cookie_domain"),
                 locales=api.locale.locale_names_json,
                 relays=config.public_relays_json[self.sid],
                 stream_filename=config.get_station(self.sid,
                                                    "stream_filename"),
                 station_list=config.station_list_json,
                 mobile=self.mobile)
Пример #13
0
 def post(self):
     info.attach_info_to_request(self, extra_list=self.get_cookie("r4_active_list"))
     self.append("stream_filename", config.get_station(self.sid, "stream_filename"))
     self.append("station_list", config.station_list)
     self.append("relays", config.public_relays[self.sid])
Пример #14
0
 def post(self):
     info.attach_info_to_request(self, live_voting=True)
     self.append("stream_filename", config.get_station(self.sid, "stream_filename"))
     self.append("station_list", config.station_list)
     self.append("relays", config.public_relays[self.sid])