Only get system list from MAME if installed

This commit is contained in:
Mathieu Comandon 2020-11-02 23:12:33 -08:00
parent 47f7c870f7
commit 157ab4a3ed

View file

@ -21,9 +21,6 @@ def write_mame_xml():
if not system.path_exists(MAME_XML_PATH):
logger.info("Getting full game list from MAME...")
mame_inst = mame()
if not mame_inst.is_installed():
logger.info("MAME isn't installed, can't retrieve systems list.")
return []
mame_inst.write_xml_list()
@ -34,8 +31,10 @@ def notify_mame_xml(*args, **kwargs):
def get_system_choices(include_year=True):
"""Return list of systems for inclusion in dropdown"""
if not system.path_exists(MAME_XML_PATH, exclude_empty=True):
AsyncCall(write_mame_xml, notify_mame_xml)
logger.warning("MAME XML generation launched in the background, not returning anything this time")
mame_inst = mame()
if mame_inst.is_installed():
AsyncCall(write_mame_xml, notify_mame_xml)
logger.warning("MAME XML generation launched in the background, not returning anything this time")
return []
for system_id, info in sorted(
get_supported_systems(MAME_XML_PATH).items(),