Please do not post a support request without first reading and following the advice in

Metadata for ROM parent folder

  • Howdy,

    Tried running a search for this, but with 50 pages of results...sorry if I am repeating a request.
    I organise my ROMs into folders based on 'unique titles'. e.g. Many ROM packs have one unique game with different Versions, Regions, Fixes etc. I like to select the folder first and from there choose which version to use. The autoscraper will apply box art and description to unique ROM files within the folders themselves, is there any way for the parent folder to 'inherit' the metadata from one of the ROMs it contains? (e.g. first result)

  • Global Moderator


    That's a very niche use case. I don't believe a function like that exists in any of the scraping methods. You'll likely need to customize that manually or by selecting the folder in Emulation Station, scraping it and entering the desired game title.

  • Thanks for the heads up,

    I went ahead and created a little Python Script that modifies gamelist.xml based on my specific needs.
    For anyone else in a similar situation, the python code is below (note it is very very hacky - I haven't done any programming in a while - please make a backup of your gamelist folder if you're going to run it on your pi).

    EDIT: Removed code because the code tags make it look like garbage - whats the correct syntax? : \

    Just one more thing - EmulationStation isn't properly displaying folder names that have full stops in the file name
    e.g. "Dr. Mario 64" is properly displaying on my server storage via windows, but shows up only as "Dr " on Emulation Station. Is there any way to fix that?


  • @airmanrwp It's a "feature" of ES

    you can read more here

  • I see.

    Not that it's a big deal for me now, because my Folder Metadata generation script seems to force ES to display the folder properly, but in future it would be nice for a way to disable that via settings or something...

    Here is the updated Python Code. This works for me only because:

    1. I generated the folder names based off the ROM names (stripping them of the region suffix tags etc)

    2. Have already moved all the ROMS into their respective folder.

    3. Folder metadata will only be applied if the ROM it contains already has been scraped

               #Code Start
               import xml.etree.ElementTree as ET   
               from xml.etree.ElementTree import Element    
               from xml.etree.ElementTree import ElementTree 
               tree = ET.parse('gamelist.xml')
               root = tree.getroot()
               subPathGames = []
               def makefolder(element):
                   print("Folder Metadata Not Found for ", element, "-> making folder")
                   folder_created = False
                   for game in root.findall('game'):
                       for path in game.findall('path'):
                           if all([element == path.text.split('/')[1], folder_created == False]):
                              #print ("Game Data" , game.tostring(xml).decode())
                              #Construct with this indexes data
                              folder_tag = ET.Element("folder")
                              name_tag = ET.Element("name")
                              name_tag.text = path.text.split('/')[1].strip()
                              image_tag = ET.Element("image")
                              if game.find('image') == None:
                                  print("img not found")
                                  image_tag.text = game.find('image').text
                              desc_tag = ET.Element("desc")
                              if game.find('desc') == None:
                                  print("desc not found")
                                  desc_tag.text = game.find('desc').text
                              rating_tag = ET.Element("rating")
                              if game.find('rating') == None:
                                 print("rating not found")
                                 rating_tag.text = game.find('rating').text
                              releasedate_tag = ET.Element("releasedate")
                              if game.find('releasedate') == None:
                                  print("release date not found")
                                  releasedate_tag.text = game.find('releasedate').text
                              developer_tag = ET.Element("developer")
                              if game.find('developer') == None:
                                  print("dev date not found")
                                  developer_tag.text = game.find('developer').text
                              publisher_tag = ET.Element("publisher")
                              if game.find('publisher') == None:
                                  print("pub date not found")
                                  publisher_tag.text = game.find('publisher').text
                              genre_tag = ET.Element("genre")
                              if game.find('genre') == None:
                                  print("genre  not found")
                                  genre_tag.text = game.find('genre').text
                              players_tag = ET.Element("players")
                              if game.find('players') == None:
                                 print("players not found")
                                 players_tag.text = game.find('players').text
                              path_tag = ET.Element("path")
                              path_tag.text = "./" + path.text.split('/')[1].strip()
                              folder_created = True
               for game in root.findall('game'):
                   for path in game.findall('path'):
                       if path.text.count('/') > 1:
               subPathGames = list(set(subPathGames))
               print("Unique List of Games in Subfolder:\n", subPathGames)
               for element in subPathGames:
                   #no folder elements at all! lets start one!    
                   if root.findall('folder') == None:
                      print("Creating first folder metadata in gamelist.xml")
                       exists = False
                       for folder in root.findall('folder'):
                           #print("ELEMENT: " ,element, " NAME: ", folder.find('name').text)
                           if element == folder.find('name').text:
                              print ("Folder Already Exists! Next Question! Faster!")
                              exists = True
                       if not exists:
               print ("All folders made - now writing to file")
               new_root = ElementTree(root)
               #Code End                        

    I suppose can be run straight from the Pi if Python is installed. or else just use WinSCP to transfer, modify and return the gamelist.xml file as normal.

Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.