From 6007d4294682b74ac017461eaa78a09807db0397 Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Fri, 21 Jun 2013 12:12:27 +0100 Subject: [PATCH] Fixed up icecast stream parser Added debug filter to logging --- dss/logsettings.py | 9 ++++++++- spa/ajax.py | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/dss/logsettings.py b/dss/logsettings.py index 0f5fdc5..525fc21 100644 --- a/dss/logsettings.py +++ b/dss/logsettings.py @@ -15,10 +15,17 @@ LOGGING = { 'format': '%(levelname)s %(message)s' }, }, + 'filters': { + 'require_debug_false': { + '()': 'django.utils.log.RequireDebugFalse' + } + }, 'handlers': { 'mail_admins': { 'level': 'ERROR', - 'class': 'django.utils.log.AdminEmailHandler' + 'filters': ['require_debug_false'], + 'class': 'django.utils.log.AdminEmailHandler', + 'include_html': True }, 'console': { 'level': 'DEBUG', diff --git a/spa/ajax.py b/spa/ajax.py index 328f63a..3f8a3b3 100644 --- a/spa/ajax.py +++ b/spa/ajax.py @@ -126,11 +126,11 @@ def live_now_playing(request): return HttpResponse( simplejson.dumps({ 'stream_url': 'http://%s:%s/%s' % ( - localsettings.JS_SETTINGS['LIVE_STREAM_URL'] % - localsettings.JS_SETTINGS['LIVE_STREAM_PORT'] % + localsettings.JS_SETTINGS['LIVE_STREAM_URL'], + localsettings.JS_SETTINGS['LIVE_STREAM_PORT'], localsettings.JS_SETTINGS['LIVE_STREAM_MOUNT']), - 'description': 'Description', - 'title': now_playing_info + 'description': now_playing_info['stream_description'], + 'title': now_playing_info['current_song'] }), mimetype="application/json") return None