Volume control from the web interface.

This commit is contained in:
Jim Driessen
2017-01-30 16:39:25 +01:00
parent e0ac7cf4ce
commit a5c2331bcf
9 changed files with 97 additions and 6 deletions

View File

@ -15,9 +15,15 @@ from .decorators import token_required
def queue(request):
queue = get_object_or_404(Queue, id=request.POST.get('queue'))
commands = queue.queuecommand_set.filter(executed=False)
for command in commands:
command.executed = True
command.save()
return JsonResponse({
'current_song': playlist_song_to_dict(queue.current_song(), True),
'queue': [playlist_song_to_dict(playlist_song, True) for playlist_song in queue.queue()[:1]]
'queue': [playlist_song_to_dict(playlist_song, True) for playlist_song in queue.queue()[:1]],
'commands': [command.command for command in commands]
})