RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Gamelist Excel export script

    Scheduled Pinned Locked Moved Ideas and Development
    emulationstatioexportgamelist
    126 Posts 19 Posters 31.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mituM
      mitu Global Moderator @papinist
      last edited by

      @papinist Can you run the script with the -d flag (debug) to find out which gamelist file has this error, then upload the gamelist.xml somewhere so I can take a look ?

      1 Reply Last reply Reply Quote 0
      • papinistP
        papinist
        last edited by papinist

        sure, here it is:
        https://pastebin.com/QsT8qVjA

        thanks for the help!

        mituM 1 Reply Last reply Reply Quote 0
        • mituM
          mitu Global Moderator @papinist
          last edited by

          @papinist OK, so the problem seems to be the gamelist for the nds system (/home/pi/.emulationstation/gamelists/nds/gamelist.xml), can you add it to pastebin.com also so I can take a look ?

          1 Reply Last reply Reply Quote 0
          • papinistP
            papinist
            last edited by papinist

            Actually, every time I exit from emulationstation to terminal, I got two errors regarding nds (see attached pic).
            I am not sure what the problem is - this is a pre-made image that I edited to suit my needs - it has background music that I removed (this is probably the third error regarding autostart.sh), and many systems that I simply deleted from roms folder (and also image\video previews), but I only have this error regarding nds.

            I don't have nds folder in 'roms' so I haven't a gamelist.xml to get!

            alt text

            EDIT: The gamelist.xml at the path reported in that error is a blank file.

            mituM 1 Reply Last reply Reply Quote 0
            • mituM
              mitu Global Moderator @papinist
              last edited by

              @papinist said in Gamelist Excel export script:

              EDIT: The gamelist.xml at the path reported in that error is a blank file.

              Remove the file, this should get rid of the error in the export and also the error in Emulationstation. Btw, your disk is really low on free space, you should do something to free up space so you don't get into other errors.

              1 Reply Last reply Reply Quote 0
              • papinistP
                papinist
                last edited by

                You are always the man, @mitu : it worked! Thanks so much!
                Now I'm looking at the numbers and they are a bit off - total games 7850 in xlsx, but 7917 in emulationstation.
                I see that Daphne is missing completely (12 games), and every sistem is missing something.
                Also I have to admit that I didn't read the last page, maybe you have already explained this.

                Re: space. Do you think it's low? This is a closed system, I have no plans to do updates in future (it is meant for a little boy) so I thought that 1.4 gb was enough!

                mituM 1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator @papinist
                  last edited by mitu

                  @papinist said in Gamelist Excel export script:

                  Now I'm looking at the numbers and they are a bit off - total games 7850 in xlsx, but 7917 in emulationstation.
                  I see that Daphne is missing completely (12 games), and every sistem is missing something.

                  I don't think the script will correctly count the systems where the game is an actual folder. If you could add the daphne system gamelist.xml to pastebin.com, I could take a look to see why it's not read correctly. A log file from running with the -d switch can also help to determine where's the error.

                  Note that the export will check if the ROM is present, so if you have the Parse metadata only option checked, then you'll see more entries than you might actually have on disk.

                  Attach the gamelist.xml for a system that's not exported and tell me which entry/entries are not appearing in the export, I'll take a look.

                  1 Reply Last reply Reply Quote 0
                  • papinistP
                    papinist
                    last edited by

                    This is daphne's gamelist.txt https://pastebin.com/uRFWiKnC

                    As example, ES reports 63 games for Atari 7800; Checking roms folder it has 63 roms; xls reports 57 games.

                    (how can I attach a file here? This message editor is really difficult to use)

                    mituM 1 Reply Last reply Reply Quote 0
                    • mituM
                      mitu Global Moderator @papinist
                      last edited by

                      @papinist said in Gamelist Excel export script:

                      how can I attach a file here

                      I meant upload it to pastebin.com. You can only attach images and the gamelist is too large to paste it inline.

                      1 Reply Last reply Reply Quote 0
                      • papinistP
                        papinist
                        last edited by

                        Understood!
                        Atari 7800 gamelist.txt https://pastebin.com/wusbd0DJ

                        mituM 1 Reply Last reply Reply Quote 0
                        • mituM
                          mitu Global Moderator @papinist
                          last edited by mitu

                          @papinist OK, so the Daphne export was missing because folders where not counted as valid ROMs. This should be fixed now, if you re-download the script it should work.

                          For the Atari part, the gamelist you uploaded has 58 game entries, of which 1 doesn't have a name tag, so the export is correct. Do you have a gamelist.xml file in the ROMs folder (atari7800) ? If you run the script with the -d parameter, it should print the path of the gamelist used for export.

                          [..]
                          2018-09-09 DEBUG  Analyzing system: Atari 7800 ProSystem (atari7800)
                          2018-09-09 DEBUG  Gamelist for atari7800 is read from /home/pi/.emulationstation/gamelists/atari7800/gamelist.xml
                          2018-09-09 DEBUG  Found 57 game(s) for Atari 7800 ProSystem atari7800
                          [..]
                          
                          1 Reply Last reply Reply Quote 0
                          • papinistP
                            papinist
                            last edited by

                            the gamelist.xml I uploaded is the one from roms folder - I recall some setting somewhere where you choose to have them in roms folder on under emulationstation.. Maybe I have some mess in this setup :-|

                            However gamelist.txt in that path (/home/pi/.emulationstation/gamelists/atari7800/) is almost blank:

                            <?xml version="1.0"?>
                            <gameList />

                            mituM 1 Reply Last reply Reply Quote 0
                            • mituM
                              mitu Global Moderator @papinist
                              last edited by mitu

                              @papinist said in Gamelist Excel export script:

                              the gamelist.xml I uploaded is the one from roms folder - I recall some setting somewhere where you choose to have them in roms folder on under emulationstation.. Maybe I have some mess in this setup :-|

                              The export script will gladly accept both paths and is really reading the gamelist from the ROMs folder (as it's the 1st path tried). However, as I said, your gamelist.xml file only has 57 valid entries, so the export is ok as far as the gamelist.xml content is concerned. Do you have turned off saving of metadata on exit in Emulationstation ? That would explain why you have 63 ROMs in that folder, but the gamelist.xml has less.

                              1 Reply Last reply Reply Quote 0
                              • papinistP
                                papinist
                                last edited by papinist

                                No, that option is ON, and "parse gamelists only" is OFF.

                                Your fix is working, now it correctly reports 12 daphne games.

                                I don't know why games are mess in gamelist than in folder, since I never added roms myself.. :-O
                                (I added games reported by ES on the right)

                                0_1536527278217_edd57c52-7570-4d06-90f5-514b62654bde-image.png

                                mituM 1 Reply Last reply Reply Quote 0
                                • mituM
                                  mitu Global Moderator @papinist
                                  last edited by

                                  @papinist Unless I have the gamelist.xml to see how it's structured, I can't tell why the difference comes up.
                                  But if it's the same situation as the atari7800 system, then there's nothing I can do - it seems the gamelist.xml does not contain all the entries ES counts.

                                  1 Reply Last reply Reply Quote 0
                                  • papinistP
                                    papinist
                                    last edited by

                                    Thank you @mitu, you already did an enormous work!

                                    I'm really a beginner with retropie, so I don't know why ES and folders have different numbers compared to gamelist :)

                                    thanks again!

                                    1 Reply Last reply Reply Quote 0
                                    • P
                                      pkzipfish
                                      last edited by

                                      I get an immediate error on the first system the script tries to analyze (arcade). Any suggestion for a workaround?

                                      pi@retropie:~ $ sudo python export.py -d ~/test.xlsx
                                      2018-10-03 17:27:11,209 DEBUG  Starting
                                      2018-10-03 17:27:11,211 INFO   Emulationstation systems file used: /etc/emulationstation/es_systems.cfg
                                      2018-10-03 17:27:11,253 DEBUG  Analyzing system: Arcade (arcade)
                                      2018-10-03 17:27:11,255 DEBUG  Gamelist for arcade is read from /home/pi/RetroPie/roms/arcade/gamelist.xml
                                      Traceback (most recent call last):
                                       File "export.py", line 584, in <module>
                                         systems = parse_systems()
                                       File "export.py", line 274, in parse_systems
                                         rom.info['realpath'] = get_rom_path(s.info['path'], rom.info['path'])
                                       File "export.py", line 201, in get_rom_path
                                         return os.path.realpath(path_to_check)
                                      UnboundLocalError: local variable 'path_to_check' referenced before assignment
                                      
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • mituM
                                        mitu Global Moderator
                                        last edited by

                                        OK, fixed the error. Can you re-download again the script and try again ?

                                        1 Reply Last reply Reply Quote 0
                                        • P
                                          pkzipfish
                                          last edited by

                                          @mitu said in Gamelist Excel export script:

                                          OK, fixed the error. Can you re-download again the script and try again ?

                                          Thanks!

                                          Almost works. It sorts all my systems, then throws this error when trying to write the Excel file:

                                          2018-10-03 17:50:35,826 INFO   Total games after parsing gamelist files - 5140
                                          2018-10-03 17:50:35,826 INFO   Exporting to file /home/pi/test.xlsx
                                          Traceback (most recent call last):
                                            File "export.py", line 595, in <module>
                                              xlsx_export_workbook(systems, output, collections)
                                            File "export.py", line 390, in xlsx_export_workbook
                                              if len(custom_collections)>0 :
                                          TypeError: object of type 'NoneType' has no len()
                                          
                                          P 1 Reply Last reply Reply Quote 0
                                          • P
                                            pkzipfish @pkzipfish
                                            last edited by

                                            @pkzipfish said in Gamelist Excel export script:

                                            @mitu said in Gamelist Excel export script:

                                            OK, fixed the error. Can you re-download again the script and try again ?

                                            Thanks!

                                            Almost works. It sorts all my systems, then throws this error when trying to write the Excel file:

                                            2018-10-03 17:50:35,826 INFO   Total games after parsing gamelist files - 5140
                                            2018-10-03 17:50:35,826 INFO   Exporting to file /home/pi/test.xlsx
                                            Traceback (most recent call last):
                                              File "export.py", line 595, in <module>
                                                xlsx_export_workbook(systems, output, collections)
                                              File "export.py", line 390, in xlsx_export_workbook
                                                if len(custom_collections)>0 :
                                            TypeError: object of type 'NoneType' has no len()
                                            

                                            Nevermind this error - it goes away if I don't run the script as sudo.

                                            But I do get another error, which seems to be because one of my custom collections' names is too long:

                                            2018-10-03 17:56:55,633 INFO   Total games after parsing gamelist files - 5140
                                            2018-10-03 17:56:55,634 INFO   Exporting to file /home/pi/test.xlsx
                                            2018-10-03 17:56:55,642 DEBUG  Adding custom collections to export
                                            2018-10-03 17:56:55,643 DEBUG  Exporting custom collection Best platform games
                                            2018-10-03 17:56:55,644 DEBUG  Exporting custom collection Best rpgs (ign)
                                            2018-10-03 17:56:55,645 DEBUG  Exporting custom collection Best adventure games (ign+)
                                            2018-10-03 17:56:55,646 DEBUG  Exporting custom collection Weird games
                                            2018-10-03 17:56:55,648 DEBUG  Exporting custom collection Best games of all time (ign)
                                            2018-10-03 17:56:55,649 DEBUG  Exporting custom collection Best multiplayer games
                                            2018-10-03 17:56:55,650 DEBUG  Exporting custom collection Best puzzle games
                                            2018-10-03 17:56:55,651 DEBUG  Exporting custom collection Best strategy games
                                            2018-10-03 17:56:55,651 DEBUG  Exporting custom collection Best japan-only games
                                            2018-10-03 17:56:55,652 DEBUG  Exporting custom collection N favorites
                                            2018-10-03 17:56:55,654 DEBUG  Exporting custom collection Best games of all time (polygon)
                                            Traceback (most recent call last):
                                              File "export.py", line 595, in <module>
                                                xlsx_export_workbook(systems, output, collections)
                                              File "export.py", line 396, in xlsx_export_workbook
                                                s = wb.add_worksheet(collection)
                                              File "build/bdist.linux-armv7l/egg/xlsxwriter/workbook.py", line 174, in add_worksheet
                                              File "build/bdist.linux-armv7l/egg/xlsxwriter/workbook.py", line 691, in _add_sheet
                                              File "build/bdist.linux-armv7l/egg/xlsxwriter/workbook.py", line 741, in _check_sheetname
                                            xlsxwriter.exceptions.InvalidWorksheetName: Excel worksheet name 'Best games of all time (polygon)' must be <= 31 chars.
                                            '''
                                            mituM 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            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.