batocera-linux / batocera.linux

batocera.linux
https://batocera.org
Other
1.89k stars 492 forks source link

bezels from screenscraper #7990

Open Mitch187 opened 1 year ago

Mitch187 commented 1 year ago

Hi,

i want to use the bezels from screenscraper. Is it possible? The bezels files are in the images folder of the emulated system...

...and are linked in the gamelist.xml:

<game id="14562">
    <path>./Thunder Blade (Japan).zip</path>
    <name>Thunder Blade</name>
    <desc>Get ready to take part in the greatest helicopter battle of the century with THUNDER BLADE! You're the Gunship Gladiator. You fly the Thunder Blade chopper. Some say you're unstoppable. This mission will put you to the test! The enemy has invaded your country. That makes you mad. So you're going to stop them... all by yourself! In cities... over deserts and oceans... in caves and through refineries... you're cutting loose with your cannons and dropping air-to-surface missiles from your skids. They've got tanks, airpower and incredible super fortresses. But you have guts, a taste for glory... and the meanest fightin' copter in the sky!</desc>
    <image>./images/Thunder Blade (Japan)-image.png</image>
    <video>./videos/Thunder Blade (Japan)-video.mp4</video>
    <marquee>./images/Thunder Blade (Japan)-marquee.png</marquee>
    <thumbnail>./images/Thunder Blade (Japan)-thumb.png</thumbnail>
    <bezel>./images/Thunder Blade (Japan)-bezel.png</bezel>
    <rating>0.7</rating>
    <releasedate>19901207T000000</releasedate>
    <developer>NEC</developer>
    <publisher>SEGA</publisher>
    <genre>Shoot'em Up</genre>
    <players>1</players>
    <md5>b4bf32b4d986fa5f53115c3f361a8679</md5>
    <lang>jp</lang>
    <region>jp</region>
    <scrap name="ScreenScraper" date="20230121T211402" />
</game>

Or is it not an issue, can i activate them?

Mitch187 commented 1 year ago

Here is my script to transfer the Screenscraper bezels to TheBezelsProject (get the right filenames for the roms)

!/bin/sh

zielverzeichnis="/userdata/decorations/thebezelproject/games" cd "${zielverzeichnis}" for verzeichnis in do if [ -d "${verzeichnis}" ] then echo "Transfer Game Bezels (${verzeichnis}) from Screenscraper to TheBezelProject" cd "${zielverzeichnis}/${verzeichnis}" rm cd "/userdata/roms/${verzeichnis}/images" cp -bezel.png "${zielverzeichnis}/${verzeichnis}" cd "${zielverzeichnis}/${verzeichnis}" for i in -bezel.png do test -f "$i" && mv "$i" "${i%-bezel.png}.png" done cd "${zielverzeichnis}" fi done

nadenislamarre commented 1 year ago

in fact we must just add an option in es and in configgen, take the image from here

NEOhidra commented 11 months ago

+1 from me too!

malekracho commented 7 months ago

Here is my script to transfer the Screenscraper bezels to TheBezelsProject (get the right filenames for the roms)

Thanks a lot for this script... if there was a way for you to update it to copy only what is none existing on the thebezelproject side it would be amazing... it brings the RPI4 to its knees when its run... so anything to make it "lighter" is welcome.

ozitvogel commented 2 months ago

The general approach is rather wrong as you rely only on systems that are available in TheBezelProject only. One should rather loop from exiting rom's system image folders having bezels. Here is a code that does this, with colors and, obviously, does only copy missing bezels. You could put his code in a script and call it from custom.sh so that it syncs every time Batocera starts.

#!/bin/bash

# ANSI color codes
GREEN='\033[0;32m'
RED='\033[0;31m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color

# use decorations from screenscraper
target_directory="/userdata/decorations/thebezelproject/games"
source_directory="/userdata/roms"

cd "${source_directory}"
for system in */
    do
    echo -e "-> ${BLUE}${system%/}${NC}..."
    if [ -d "${system}/images" ]; then
        mkdir -p "${target_directory}/${system}"

        for bezel in ${system}images/*-bezel.png
        do
            if [ -f "${bezel}" ]; then
                bbezel=$(basename "$bezel")
                nbezel="${bbezel%-bezel.png}.png"
                if [ ! -f "${target_directory}/${system}${nbezel}" ]; then
                    if cp "${bezel}" "${target_directory}/${system}${nbezel}"; then
                        echo -e "[${GREEN}COPIED${NC}] ${bezel} to ${target_directory}/${system}${nbezel}"
                    else
                        echo -e "[${RED}FAILED${NC}] could not copy ${bezel} to ${target_directory}/${system}${nbezel}"
                    fi
                fi
            fi
        done
    fi
done