ns = { 'id':params_kw.id } db = DBPools() async with db.sqlorContext('mediadb') as sor: recs = await sor.R('media', ns) if len(recs) >= 1: r = recs[0] return { "widgettype":"VBox", "options":{}, "subwidgets":[ { "widgettype":"Filler", "options":{}, "subwidgets":[ { "widgettype":"Image", "id":"player", "options":{ "witdh":"100%", "height":"100%", "url":entire_url('/idfile') + "?path=" + r.mlocation, } } ] }, { "id":"iconbar", "widgettype":"IconBar", "options":{ "cheight":2, "tools":[ { "name":"download", "icon":entire_url('/imgs/download.png'), } ] } } ], "binds":[ { "wid":"iconbar", "event":"download", "actiontype":"script", "target":"self", "script":"open('" + entire_url('/idfile') + "?path=" + r.mlocation + "&download=1');" }] }