Example #1
0
    def player(self):
        user = cherrypy.request.user
        queues, queue_info = queue_dao.get_queues(user.id)
        queue_current_track = queue_dao.get_current_track(user.id)
        current_track = cache.get('queue.current_track_%d' % user.id)
        current_progress = cache.get('queue.current_progress_%d' % user.id)

        return {
            'queues': queues,
            'queue_info': queue_info,
            'queue_current_track': queue_current_track,
            'current_track': current_track,
            'current_progress': current_progress
        }
Example #2
0
    def list(self):
        user = cherrypy.request.user
        queues, queue_info = queue_dao.get_queues(user.id)
        queue_current_track = queue_dao.get_current_track(user.id)

        if user.id in Play.STREAM_MODE and Play.STREAM_MODE[user.id] is not None:
            mode = Play.STREAM_MODE[user.id]
        else:
            mode = 'regular'

        return {
            'mode': mode,
            'queues': queues,
            'queue_info': queue_info,
            'queue_current_track': queue_current_track
        }