Rob_G Posted February 15, 2023 Share Posted February 15, 2023 I roughed up a proof of concept for exporting launchbox style media to a batocera installation. It's just something to play around with I guess. This POC copied video files, renamed them appropriately and generated a new game list xml. There are going to be limitations, but it certainly beats downloading gigs of data again through very slow scrapers. $imgsourcedir = "D:\Launchbox\Images\Sammy Atomiswave" $vidsourcedir = "D:\Launchbox\Videos\Sammy Atomiswave" $destdir = "Z:\roms\atomiswave" [xml]$xml = Get-Content $destdir\gamelist.xml $xml.gameList.game | ForEach-Object { $name = $_.name write-host "Game: " $name $videos = dir $vidsourcedir -Recurse $firstvid = $null $firstvid = $videos | Where-Object {$_.name -match $name} | select -first 1 if ($firstvid -ne $null) { write-host "Video Found: " $firstvid.name $startchar = "/" $endchar = "." $pattern = @" (?<=\$StartChar).+?(?=\$EndChar) "@ $newvidname = [regex]::Matches($_.path, $pattern).Value + "-video" + $firstvid.Extension $firstvid | Copy-Item -Destination ($destdir + "\videos\$newvidname") $newvideoelement = $_.AppendChild($xml.CreateElement("video")) $newvideoelement.AppendChild($xml.CreateTextNode('./videos/' + $newvidname)) | Out-Null } } $xml.save("$destdir\gamelist.xml") Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.