Exemplo n.º 1
0
 def notify_start_play(self, request, **kwargs):
     
     print '** notify_start_play **'
     media_uuid = request.GET.get('media_id', None)
     channel_uuid = request.GET.get('channel_id', None)
     
     print 'request user!!'
     print request.user
     
     if media_uuid and channel_uuid:
         print 'media_uuid  : %s' % media_uuid
         print 'channel_uuid: %s' % channel_uuid
         
         from alibrary.models import Media 
         
         item = Media.objects.get(uuid=media_uuid)
         try:
             channel = Channel.objects.get(uuid=channel_uuid)
         except:
             channel = None
             
         # call notification
         notify.start_play(item, channel, request.user)
         
         
         print 'item: %s' % item.name
         print 'channel: %s' % channel.name
         
     data = {'status': 'session!'}
     return self.json_response(request, data)
Exemplo n.º 2
0
def post_save_channel(sender, **kwargs):

    obj = kwargs['instance']
    try:
        notify.start_play(obj.on_air, obj)
    except Exception as e:
        pass
Exemplo n.º 3
0
    def notify_start_play(self, request, **kwargs):

        print '** notify_start_play **'
        media_uuid = request.GET.get('media_id', None)
        channel_uuid = request.GET.get('channel_id', None)

        print 'request user!!'
        print request.user

        if media_uuid and channel_uuid:
            print 'media_uuid  : %s' % media_uuid
            print 'channel_uuid: %s' % channel_uuid

            from alibrary.models import Media

            item = Media.objects.get(uuid=media_uuid)
            try:
                channel = Channel.objects.get(uuid=channel_uuid)
            except:
                channel = None

            # call notification
            notify.start_play(item, channel, request.user)

            print 'item: %s' % item.name
            print 'channel: %s' % channel.name

        data = {'status': 'session!'}
        return self.json_response(request, data)
Exemplo n.º 4
0
def post_save_channel(sender, **kwargs):

    obj = kwargs['instance']
    try:
        notify.start_play(obj.on_air, obj)
    except Exception as e:
        pass
Exemplo n.º 5
0
def post_save_channel(sender, **kwargs):
    print 'post_save_channel - kwargs'
    obj = kwargs['instance']

    # call notification
    try:
        notify.start_play(obj.on_air, obj)
    except:
        pass