summaryrefslogtreecommitdiff
path: root/frontend/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/views.py')
-rw-r--r--frontend/views.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/frontend/views.py b/frontend/views.py
index 1b3c963..bc12b82 100644
--- a/frontend/views.py
+++ b/frontend/views.py
@@ -192,3 +192,37 @@ def roomlist(request):
)
response['Pragma'] = 'no-cache'
return response
+
+def room(request, roomname):
+ sjroom = SJRoom.objects.filter(name=roomname)[0];
+ jsPath = "/js/sj6.js"
+
+ title = sjroom.name.capitalize() + " room on ScannerJammer"
+ thumbnail = "http://scannerjammer.fm/img/plant.gif"
+ if sjroom.name == "glitter":
+ thumbnail = "http://scannerjammer.fm/img/glitter_flower.gif"
+ elif sjroom.name == "glasspopcorn":
+ thumbnail = "http://scannerjammer.fm/img/glasspopthumb.gif"
+ title = "GlassPopcorn TV"
+ elif room == "adult":
+ #serverPort = 6969
+ jsPath = "/js/sandbox/sj7.js"
+ elif room != "main":
+ s = json.loads(sjroom.settings_text)
+ if "bg" in s:
+ thumbnail = s["bg"]
+
+ response = render_to_response(
+ 'room.html',
+ {
+ 'SERVER_HOST': settings.SERVER_HOST,
+ 'SERVER_PORT': settings.SERVER_PORT,
+ 'JS_PATH': jsPath,
+ 'ROOM': sjroom.name.lower(),
+ 'UCROOM': sjroom.name.upper(),
+ 'OPENGRAPH_IMAGE': thumbnail,
+ 'OPENGRAPH_TITLE': title,
+ }
+ )
+ response['Pragma'] = 'no-cache'
+ return response