Esempio n. 1
0
def add_mobile_flavor_to_kts():
    g.msgs = []
    kaltura_id, entry_id = parse_ids()
    settings = properties.load_kaltura_settings().get(kaltura_id)
    if settings['MOBILE_PLAYER_FLAVOR']:
        g.msgs.append('Flavor already configured.')
        return simplejson.dumps({'success': True,
                                 'messages': g.msgs})
    client = kaltura_session_loader(kaltura_id)
    flavor_id = myKalturaObject.add_kts_mobile_flavor(client, kaltura_id)
    # flavor_id = "123"
    g.msgs.append("Added flavor to kaltura")
    myKalturaObject.add_flavor_to_default_conversion_profile(client,
                                                             flavor_id,
                                                             kaltura_id)
    g.msgs.append("Added flavor to default conversion profile")
    proplist = properties.kaltura_properties_list
    values = [settings[item] for item in proplist if
              not item == 'KALTURA_CONFIG_ID']
    values[8] = flavor_id
    resp = simplejson.loads(properties.update_kaltura(kaltura_id, values))
    if resp['success']:
        g.msgs.append('Set flavor id as mobile player flavor in local '
                    'configurations for kaltura id %s' % kaltura_id)
    else:
        g.msgs.append('Failed to assign flavor id in local configuration.')
    return simplejson.dumps({
        "flavor_id": flavor_id,
        "success": True,
        "messages": g.msgs
    })
Esempio n. 2
0
def submit_update_config():
    proplist = properties.kaltura_properties_list
    values = [request.args.get(item) for item in proplist]
    kal_id = values.pop(0)
    resp = simplejson.loads(properties.update_kaltura(kal_id, values))
    if resp.get('success', False) == True:
        message = 'Update'
    else:
        message = 'Failed to update'
    # return render_template('message.html',
    #                         message=message,
    #                         link=url_for('kts_index'),
    #                         linktext='-Home-')
    return redirect(url_for('view_configs'))
Esempio n. 3
0
def submit_update_config():
    proplist = properties.kaltura_properties_list
    values = [request.args.get(item) for item in proplist]
    kal_id = values.pop(0)
    resp = simplejson.loads(properties.update_kaltura(kal_id, values))
    if resp.get('success', False) == True:
        message = 'Update'
    else:
        message = 'Failed to update'
    # return render_template('message.html',
    #                         message=message,
    #                         link=url_for('kts_index'),
    #                         linktext='-Home-')
    return redirect(url_for('view_configs'))