def get_rom_page(category_id): #Define Parser emu_info = scape_xml_headers() for ii in range(0,len(emu_info['emu_name'])): if category_id == emu_info['emu_name'][ii]: parserpath = emu_info['emu_parser'][ii] xmlpath = emu_info['emu_location'][ii] break try: rom_list = get_rom_list(xmlpath, parserpath) except: rom_list = None return plugin.finish(rom_list, sort_methods=[xbmcplugin.SORT_METHOD_NONE, xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE, xbmcplugin.SORT_METHOD_DATE, xbmcplugin.SORT_METHOD_GENRE, xbmcplugin.SORT_METHOD_STUDIO_IGNORE_THE])
def index(): items = [] emu_info = scape_xml_headers() #Find all xml dat files and get the header info for ii in range(0,len(emu_info['emu_name'])): items.append({ 'label' : emu_info['emu_name'][ii], 'path': plugin.url_for('get_rom_page', category_id=emu_info['emu_name'][ii]), 'info_type': 'folder', 'icon': emu_info['emu_logo'][ii], 'thumbnail' : emu_info['emu_thumb'][ii], 'info' : { 'FolderPath': emu_info['emu_baseurl'][ii] }, 'properties' : { 'fanart_image': emu_info['emu_fanart'][ii], 'banner' : emu_info['emu_banner'][ii], 'clearlogo': emu_info['emu_logo'][ii] }, 'is_playable': False, # Hack to force xbmcswift2 to report listitem as a folder }) return plugin.finish(items, sort_methods=[xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE, xbmcplugin.SORT_METHOD_GENRE])