Beispiel #1
0
def details(app_id):
    order_by = request.args.get('order_by')
    app_details = sc_request(
        'apps/%s' % (app_id,), client_id=app.config['CLIENT_ID'])
    tracks = get_tracks(app_id, order_by=order_by)
    return render_template(
        'details.html', tracks=tracks, app=app_details)
Beispiel #2
0
def index():
    app_url = request.args.get('app_url')
    if app_url:
        resolved = sc_request(
            'resolve', url=app_url, client_id=app.config['CLIENT_ID'])
        if 'errors' in resolved:
            return render_template('index.html',
                                   error='Sorry, we couldn\'t find your app')
        app_id = resolved['id']
        return redirect(url_for('details', app_id=app_id))
    return render_template('index.html')