Commit c06014fc authored by fred's avatar fred

player: display currently playing track/artist

parent 7768d028
...@@ -147,6 +147,7 @@ INSTALLED_APPS = ( ...@@ -147,6 +147,7 @@ INSTALLED_APPS = (
'ckeditor', 'ckeditor',
'emissions', 'emissions',
'newsletter', 'newsletter',
'nonstop',
'combo.data', 'combo.data',
'combo.public', 'combo.public',
) )
......
...@@ -29,6 +29,7 @@ from emissions.models import Category, Emission, Episode, Diffusion, SoundFile, ...@@ -29,6 +29,7 @@ from emissions.models import Category, Emission, Episode, Diffusion, SoundFile,
from emissions.utils import whatsonair, period_program from emissions.utils import whatsonair, period_program
from newsletter.forms import SubscribeForm from newsletter.forms import SubscribeForm
from nonstop.utils import get_current_nonstop_track
from . import utils from . import utils
...@@ -540,6 +541,7 @@ def onair(request): ...@@ -540,6 +541,7 @@ def onair(request):
d['nonstop'] = { d['nonstop'] = {
'title': d['nonstop'].title, 'title': d['nonstop'].title,
} }
d.update(get_current_nonstop_track())
if d.get('current_slot'): if d.get('current_slot'):
del d['current_slot'] del d['current_slot']
return d return d
......
...@@ -1501,3 +1501,7 @@ h3.episode-subtitle { ...@@ -1501,3 +1501,7 @@ h3.episode-subtitle {
font-style: normal; font-style: normal;
font-weight: bold; font-weight: bold;
} }
.nonstop-track-title, .nonstop-track-artist {
font-size: 80%;
}
...@@ -207,6 +207,14 @@ $(function() { ...@@ -207,6 +207,14 @@ $(function() {
} }
} else if (onair.data.nonstop) { } else if (onair.data.nonstop) {
onairContainer = $('<span>' + onair.data.nonstop.title + '</span>'); onairContainer = $('<span>' + onair.data.nonstop.title + '</span>');
if (onair.data.track_title) {
onairContainer = onairContainer.add('<span> - </span>');
onairContainer = onairContainer.add($('<span class="nonstop-track-title">' + onair.data.track_title + '</span>'));
if (onair.data.track_artist) {
onairContainer = onairContainer.add('<span> </span>');
onairContainer = onairContainer.add($('<span class="nonstop-track-artist">(' + onair.data.track_artist + ')</span>'));
}
}
} }
else { else {
onairContainer = $('<span>Unknown (Probably Non-Stop)</span>'); onairContainer = $('<span>Unknown (Probably Non-Stop)</span>');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment