async def render(req, **kwargs): """/search handler :type app: feeluown.app.App """ q = req.query.get('q', '') if not q: return tab_id = Tab(int(req.query.get('tab_id', Tab.songs.value))) source_in = req.query.get('source_in', None) if source_in is not None: source_in = source_in.split(',') else: source_in = None app = req.ctx['app'] ui = app.ui right_panel = ui.right_panel table_container = right_panel.table_container right_panel.set_body(right_panel.scrollarea) search_type, _ = TabidSearchMapping[tab_id] reader = wrap( app.library.a_search(q, source_in=source_in, type_in=search_type)) renderer = SearchResultRenderer(q, tab_id, reader, source_in=source_in) await table_container.set_renderer(renderer)
async def render(req, **kwargs): app = req.ctx['app'] app.ui.right_panel.set_body(app.ui.table_container) provider = app.library.get('netease') tab_id = Tab(int(req.query.get('tab_id', Tab.songs.value))) # FIXM renderer = FavRenderer(tab_id, provider._user) await app.ui.table_container.set_renderer(renderer)
async def render(req, **kwargs): app = req.ctx['app'] tab_id = Tab(int(req.query.get('tab_id', Tab.songs.value))) ui = app.ui ui.right_panel.set_body(ui.right_panel.scrollarea) table_container = ui.right_panel.table_container renderer = LibraryRenderer(tab_id) await table_container.set_renderer(renderer)