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

    Easy way to add video and marquees tags in your gamelist for video support.

    Scheduled Pinned Locked Moved Ideas and Development
    videogamelistmarquees
    40 Posts 12 Posters 27.5k 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.
    • N
      Nismo @duiz
      last edited by Nismo

      @duiz Nice, I'm glad to help. I'll add this to the first post.

      1 Reply Last reply Reply Quote 0
      • matchamanM
        matchaman
        last edited by matchaman

        On Windows 7 I used your latest edit of the code and I'm getting this:

        0_1491298204122_error.jpg

        I tried on several different folders and it didn't work, the path is on F:\SNES 852, no "funny" characters.

        N 1 Reply Last reply Reply Quote 0
        • N
          Nismo @matchaman
          last edited by

          @matchaman
          Why you edited the script? Why you don't use the default path of the script? Can you post your script?

          1 Reply Last reply Reply Quote 0
          • matchamanM
            matchaman
            last edited by matchaman

            I didn't edit the script at all, the only thing different is that I named it generator.ps1

            I have my gamelist.xml and my files located in F:\SNES 852 (should I use something else in particular?)

            Here is the exact code I use:

            $doc = [xml] (Get-Content -raw gamelist.xml)
            
            foreach ($gameEl in $doc.DocumentElement.game) { 
              # Use -replace to extract the filename without extension from the 
              # path contained in the <path> element.
              $gameName = $gameEl.path -replace '^.*/(.*)\..*$', '$1'
              # Append elements 'video' and 'marquee', but only if they don't already
              # exist.
              if ($null -eq $gameEl.video) {
                $gameEl.AppendChild($doc.CreateElement('video')).InnerText = "./videos/${gameName}.mp4"
              }
              if ($null -eq $gameEl.marquee) {
                $gameEl.AppendChild($doc.CreateElement('marquee')).InnerText = "./marquees/${gameName}.png"
              }
            }
            rename-item gamelist.xml -newname oldgamelist.xml
            $writer = [System.IO.StreamWriter] "gamelist.xml"
            $doc.Save($writer)
            $writer.Close()
            

            As for my gamelist.xml file, it's formatted as:

            <gameList>
            	<game>
            		<path>./2020 Super Baseball (USA).zip</path>
            		<name>2020 Super Baseball (USA)</name>
            		<image>./images/2020 Super Baseball (USA).png</image>
            	</game>
            	<game>
            		<path>./3 Ninjas Kick Back (USA).zip</path>
            		<name>3 Ninjas Kick Back (USA)</name>
            		<image>./images/3 Ninjas Kick Back (USA).png</image>
            	</game>
            	<game>
            		<path>./7th Saga, The (USA).zip</path>
            		<name>7th Saga, The (USA)</name>
            		<image>./images/7th Saga, The (USA).png</image>
            	</game>
            	<game>
            		<path>./90 Minutes - European Prime Goal (Europe).zip</path>
            		<name>90 Minutes - European Prime Goal (Europe)</name>
            		<image>./images/90 Minutes - European Prime Goal (Europe).png</image>
            	</game>
            	<game>
            		<path>./A.S.P. - Air Strike Patrol (USA).zip</path>
            		<name>A.S.P. - Air Strike Patrol (USA)</name>
            		<image>./images/A.S.P. - Air Strike Patrol (USA).png</image>
            	</game>
            	<game>
            		<path>./ABC Monday Night Football (USA).zip</path>
            		<name>ABC Monday Night Football (USA)</name>
            		<image>./images/ABC Monday Night Football (USA).png</image>
            	</game>
            ...and so on until </gameList>
            

            When I run the script, I briefly get that error window I managed to capture (after many attempts) and a new gamelist.xml that's 0 bytes and of course the backup one untouched.

            N 1 Reply Last reply Reply Quote 0
            • N
              Nismo @matchaman
              last edited by Nismo

              @matchaman try to place your gamelist and the script at root o C: and run it there.

              What operating system do you have?

              1 Reply Last reply Reply Quote 0
              • matchamanM
                matchaman
                last edited by matchaman

                Same result when placed on C: :( I am using Windows 7

                This is the error I'm getting on the root directory:

                0_1491322766183_error2.jpg

                Edit: OK, after shortening the list to a few games, the output is normal. Some character within the ROM names is causing this! Tonight I'll do a lot of trial and error and locate the little devil!

                1 Reply Last reply Reply Quote 1
                • matchamanM
                  matchaman
                  last edited by matchaman

                  Sorry about the double post but I'll have to bump it in order to inform you that the symbol & in names causes the aforementioned problem.

                  Probably explains why some users experience difficulties with certain systems while others process without any issue. How can this be fixed?

                  Edit: I replaced &with &amp; as this appears to give the same result while it's safe for the script. I hope I helped :)

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

                    Hello and thanks for this but... it doesn't work for me. I have test with Windows 7 Pro, Windows 8.1u1 and Windows 10 Pro.

                    Work with Windows 8.1u1, everything was OK but I install Windows 10 yesterday and it doesn't work now... :(

                    Error message :

                    0_1493456316812_Sans titre.jpg

                    Thanks for your help :)

                    N 1 Reply Last reply Reply Quote 0
                    • N
                      Nismo @PsyKos
                      last edited by

                      @PsyKos

                      I have windows 10 and it works perfectly for me, I don't understand very well the french message, but it seems there are some problem with one of your games in your original gamelist.

                      It's the entry after yumimi mix (japan).cue, try to take a copy of your original gamelist, then delete that entry after yumimi mix and test again if all it's working, if not, send me your gamelist and I'll try to do it here.

                      If it works, then enter that entry by hand.

                      Maybe, reading the name, you have japanesse characters??

                      Try what i said to you, if doesn't work upload your gamelist.xml somewhere so I can check what's the problem.

                      Regards.

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

                        Yes, it work perfectly :)

                        Sorry, it was my fault. On gamelist.xml, I have <rating>/rating> in line 1236 (like see in error code...). Replace with right arguments and work :)

                        Thousand sorry about this !!! And great works for this script help me very well !

                        1 Reply Last reply Reply Quote 0
                        • B
                          brian_
                          last edited by brian_

                          Nismo: Thanks for making this, really helped along with the oldroom info.

                          If you get to the end of the process and either forgot to set up the proper paths for gamelist.xml or didn't know how or whatever you can still fix it after you copy the gameslist over to the pi by using sed like this in vim"

                          :%s/\.\//\~\/RetroPie\/roms\/nes\//g

                          Changes ./ into ~/Retropie/roms/nes/

                          Also to anyone new confused (like me) about fastscraper and fatmatch: fastscraper is referring to sselph's scraper. For fatmatch it doesn't seem to be included in anything. Just google it, you will see references to a 0.3 version. That's what he's talking about.

                          1 Reply Last reply Reply Quote 0
                          • fabio78F
                            fabio78
                            last edited by

                            This was a godsend. Thank you, Nismo!

                            1 Reply Last reply Reply Quote 0
                            • L
                              lordhellbr
                              last edited by

                              If your gamelist.xml have European characters like "ã ñ é ó ç", change the first line to this: (or your xml will be weird characters instead of the correct ones)

                              $doc = [xml] (Get-Content -raw -Encoding UTF8 gamelist.xml)

                              Anyway thanks @Nismo for this great script.

                              1 Reply Last reply Reply Quote 1
                              • D
                                DocGoodsoup
                                last edited by

                                I just subscribe to the forum to thanks @Nismo for this great script and also @lordhellbr (before that I was forced to change by hand every accent). You both save me a lot of time :)

                                1 Reply Last reply Reply Quote 0
                                • paffleyP
                                  paffley
                                  last edited by paffley

                                  Hi, I realise this is an old post but I thought I'd try to revive it by asking for a command help to run in windows PowerShell.

                                  I've noticed some users on the forum asking for a 'release date' modification, changing the release date from, e.g 18/10/1985 to simply just 1985 and thought this could maybe be done with windows powershell.

                                  Standard format for the gamelist.xml
                                  <releasedate>19851018T000000</releasedate> (note the first 4 digits)

                                  to be turned into...
                                  <releasedate>1985</releasedate>

                                  I just wondered if this was possible using WPS and maybe having the option of adding an if statement of 'if no date found' add '19xx' to the release date tag inside the xml?

                                  Thanks :)

                                  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.