From 1c7ffae9c0fe0c837fa2ca360fbc7e4483795ac3 Mon Sep 17 00:00:00 2001 From: Sergio Date: Thu, 29 Apr 2021 09:32:28 +0200 Subject: [PATCH] update --- create_retroarch_thumbnails.sh | 8 +- skyscraper.sh | 134 +++++---------------------------- skyscraper_system.sh | 45 +++++------ 3 files changed, 41 insertions(+), 146 deletions(-) diff --git a/create_retroarch_thumbnails.sh b/create_retroarch_thumbnails.sh index 668332d..9b6ffb5 100755 --- a/create_retroarch_thumbnails.sh +++ b/create_retroarch_thumbnails.sh @@ -1,11 +1,11 @@ #!/bin/bash function help_message() { - echo "$USAGE" - echo - echo "Where [SYSTEMS] are:" + printf "%s\n\n" "$USAGE" + printf "%s" "Where [SYSTEMS] are: " for WORD in $SYSTEMS; do - echo -e "\t$WORD" + printf "%s" "$WORD " done + printf "\n" } readonly USAGE=" diff --git a/skyscraper.sh b/skyscraper.sh index 4af67b6..5640a7d 100755 --- a/skyscraper.sh +++ b/skyscraper.sh @@ -1,4 +1,6 @@ #!/bin/bash + +## usage readonly USAGE=" USAGE: $(basename "$0") [BUILD | SCRAP | BOTH] [FRONTEND] [PATH]" @@ -12,65 +14,53 @@ function help_message() { done } -FRONTENDS="emulationstation pegasus" - -# check if there are all the parameters +## check if there are all the parameters if [ "$#" -ne 3 ]; then help_message exit 0 fi -# check if the frontend parameter is valid +## check if the frontend parameter is valid +FRONTENDS="emulationstation pegasus" if ! echo "$FRONTENDS" | grep -w "$2" >/dev/null; then printf "%s\n" "You must enter a valid FRONTEND name." help_message exit 0 fi -# variables -#readonly COLOR_BLACK=$(tput setaf 0) -#readonly COLOR_RED=$(tput setaf 1) -#readonly COLOR_GREEN=$(tput setaf 2) -#readonly COLOR_YELLOW=$(tput setaf 3) -#readonly COLOR_BLUE=$(tput setaf 4) -#readonly COLOR_MAGENTA=$(tput setaf 5) -#readonly COLOR_CYAN=$(tput setaf 6) -readonly COLOR_WHITE=$(tput setaf 7) -#readonly COLOR_BACKGROUND_BLACK=$(tput setab 0) -readonly COLOR_BACKGROUND_RED=$(tput setab 1) -#readonly COLOR_BACKGROUND_GREEN=$(tput setab 2) -#readonly COLOR_BACKGROUND_YELLOW=$(tput setab 3) -#readonly COLOR_BACKGROUND_BLUE=$(tput setab 4) -#readonly COLOR_BACKGROUND_MAGENTA=$(tput setab 5) -#readonly COLOR_BACKGROUND_CYAN=$(tput setab 6) -#readonly COLOR_BACKGROUND_WHITE=$(tput setab 7) -readonly RESET_COLOR=$(tput sgr0) - -#readonly SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +## parameters readonly FRONTEND="$2" readonly ROM_DIR="$3" -readonly CONSOLE_ART=artwork.xml.rgbpi -readonly ARCADE_ART=artwork.xml.rgbpi +## colors +readonly COLOR_WHITE=$(tput setaf 7) +readonly COLOR_BACKGROUND_RED=$(tput setab 1) +readonly RESET_COLOR=$(tput sgr0) +## artwork.xml +readonly CONSOLE_ART=artwork.xml.cover +readonly ARCADE_ART=artwork.xml.cover + +## scrapers readonly CONSOLE_SCRAPERS="screenscraper mobygames thegamesdb" readonly ARCADE_SCRAPERS="screenacraper arcadedb" +## flags #readonly BUILD_FLAGS_CONSOLE="videos,unattend,forcefilename,relative,nobrackets,skipexistingcovers,skipexistingmarquees,skipexistingscreenshots,skipexistingvideos,skipexistingwheels" readonly BUILD_FLAGS_CONSOLE="videos,unattend,forcefilename,relative" #readonly BUILD_FLAGS_ARCADE="videos,unattend,relative,nobrackets,skipexistingcovers,skipexistingmarquees,skipexistingscreenshots,skipexistingvideos,skipexistingwheels" readonly BUILD_FLAGS_ARCADE="videos,unattend,relative" -SCRAP=true -BUILD=true - +## check if BUID, SCRAP or BOTH if [ "$1" = scrap ] || [ "$1" = SCRAP ]; then BUILD=false + SCRAP=true printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## SCRAP ONLY ${RESET_COLOR}" sleep 1 fi if [ "$1" = build ] || [ "$1" = BUILD ]; then + BUILD=true SCRAP=false printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## BUILD ONLY ${RESET_COLOR}" sleep 1 @@ -141,89 +131,3 @@ fi ## post-script job. add extensions text to pegasus find "${ROM_DIR}" -type f -iname "metadata.pegasus.txt" -exec sed -i '2 a extensions: zip, chd, cue, iso, cso' {} \; - -## Available artworks -# artwork.xml.screenshot -# artwork.xml.cover -# artwork.xml.wheel -# artwork.xml.example1 - -## Available platforms: -# 3do -# 3ds -# amiga -# amstradcpc -# apple2 -# arcade -# arcadia -# astrocde -# atari800 -# atari2600 -# atari5200 -# atari7800 -# atarijaguar -# atarilynx -# atarist -# c16 -# c64 -# c128 -# coco -# coleco -# daphne -# dragon32 -# dreamcast -# fba -# fds -# gameandwatch -# gamegear -# gb -# gba -# gbc -# gc -# genesis -# intellivision -# mame-advmame -# mame-libretro -# mame-mame4all -# mastersystem -# megacd -# megadrive -# msx -# n64 -# nds -# neogeo -# nes -# ngp -# ngpc -# oric -# pc -# pc88 -# pc98 -# pcfx -# pcengine -# pokemini -# ports -# ps2 -# psp -# psx -# saturn -# scummvm -# sega32x -# segacd -# sg-1000 -# snes -# steam -# ti99 -# trs-80 -# vectrex -# vic20 -# videopac -# virtualboy -# wii -# wonderswan -# wonderswancolor -# x68000 -# x1 -# zmachine -# zx81 -# zxspectrum diff --git a/skyscraper_system.sh b/skyscraper_system.sh index 93f06bb..60beac0 100755 --- a/skyscraper_system.sh +++ b/skyscraper_system.sh @@ -12,67 +12,58 @@ function help_message() { printf "\n" } -SYSTEMS="3do 3ds amiga amstradcpc apple2 arcade arcadia astrocde atari800 atari2600 atari5200 atari7800 atarijaguar atarilynx atarist c16 c64 c128 coco coleco daphne dragon32 dreamcast fba fds gameandwatch gamegear gb gba gbc gc genesis intellivision mame-advmame mame-libretro mame-mame4all mastersystem megacd megadrive msx n64 nds neogeo nes ngp ngpc oric pc pc88 pc98 pcfx pcengine pokemini ports ps2 psp psx saturn scummvm sega32x segacd sg-1000 snes steam ti99 trs-80 vectrex vic20 videopac virtualboy wii wonderswan wonderswancolor x68000 x1 zmachine zx81 zxspectrum" +readonly SYSTEMS="3do 3ds amiga amstradcpc apple2 arcade arcadia astrocde atari800 atari2600 atari5200 atari7800 atarijaguar atarilynx atarist c16 c64 c128 coco coleco daphne dragon32 dreamcast fba fds gameandwatch gamegear gb gba gbc gc genesis intellivision mame-advmame mame-libretro mame-mame4all mastersystem megacd megadrive msx n64 nds neogeo nes ngp ngpc oric pc pc88 pc98 pcfx pcengine pokemini ports ps2 psp psx saturn scummvm sega32x segacd sg-1000 snes steam ti99 trs-80 vectrex vic20 videopac virtualboy wii wonderswan wonderswancolor x68000 x1 zmachine zx81 zxspectrum" +readonly APP=/usr/local/bin/Skyscraper -# check if there are all the parameters +## check if there are all the parameters if [ "$#" -ne 3 ]; then help_message exit 0 fi -# check if the systems parameter is valid +## check if the systems parameter is valid if ! echo "$SYSTEMS" | grep -w "$3" >/dev/null; then printf "%s\n" "You must enter a valid SYSTEM name." help_message exit 0 fi -# variables -#readonly COLOR_BLACK=$(tput setaf 0) -#readonly COLOR_RED=$(tput setaf 1) -#readonly COLOR_GREEN=$(tput setaf 2) -#readonly COLOR_YELLOW=$(tput setaf 3) -#readonly COLOR_BLUE=$(tput setaf 4) -#readonly COLOR_MAGENTA=$(tput setaf 5) -#readonly COLOR_CYAN=$(tput setaf 6) +## colors readonly COLOR_WHITE=$(tput setaf 7) -#readonly COLOR_BACKGROUND_BLACK=$(tput setab 0) readonly COLOR_BACKGROUND_RED=$(tput setab 1) -#readonly COLOR_BACKGROUND_GREEN=$(tput setab 2) -#readonly COLOR_BACKGROUND_YELLOW=$(tput setab 3) -#readonly COLOR_BACKGROUND_BLUE=$(tput setab 4) -#readonly COLOR_BACKGROUND_MAGENTA=$(tput setab 5) -#readonly COLOR_BACKGROUND_CYAN=$(tput setab 6) -#readonly COLOR_BACKGROUND_WHITE=$(tput setab 7) readonly RESET_COLOR=$(tput sgr0) +## variables #readonly SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" readonly ROM_DIR="$2" readonly SYSTEM_NAME="$3" readonly FRONTEND="emulationstation" -readonly CONSOLE_ART=artwork.xml.retroarch -readonly ARCADE_ART=artwork.xml.retroarch +## artwork +readonly CONSOLE_ART=artwork.xml.cover +readonly ARCADE_ART=artwork.xml.cover +## scrapers readonly CONSOLE_SCRAPERS="screenscraper mobygames thegamesdb" readonly ARCADE_SCRAPERS="screenacraper arcadedb" -readonly BUILD_FLAGS_CONSOLE="unattend,forcefilename,relative" -readonly BUILD_FLAGS_ARCADE="unattend,relative" +## flags +readonly BUILD_FLAGS_CONSOLE="videos,unattend,forcefilename,relative" +readonly BUILD_FLAGS_ARCADE="videos,unattend,relative" +## systems readonly CONSOLE="3do 3ds amiga amstradcpc apple2 arcadia astrocde atari800 atari2600 atari5200 atari7800 atarijaguar atarilynx atarist c16 c64 c128 coco coleco daphne dragon32 dreamcast fds gameandwatch gamegear gb gba gbc gc genesis intellivision mastersystem megacd megadrive msx n64 nds nes ngp ngpc oric pc pc88 pc98 pcfx pcengine pokemini ports ps2 psp psx saturn scummvm sega32x segacd sg-1000 snes ti99 trs-80 vectrex vic20 videopac virtualboy wii wonderswan wonderswancolor x68000 x1 zmachine zx81 zxspectrum" readonly ARCADE="arcade fba neogeo mame-advmame mame-mame4all" -SCRAP=true -BUILD=true - if [ "$1" = scrap ] || [ "$1" = SCRAP ]; then BUILD=false + SCRAP = true printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## SCRAP ONLY ${RESET_COLOR}" sleep 1 fi if [ "$1" = build ] || [ "$1" = BUILD ]; then + BUILD = true SCRAP=false printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## BUILD ONLY ${RESET_COLOR}" sleep 1 @@ -82,11 +73,11 @@ fi if echo "${CONSOLE}" | grep -w "${SYSTEM_NAME}" >/dev/null; then if [ "${SCRAP}" = true ]; then for SCRAPER in ${CONSOLE_SCRAPERS}; do - Skyscraper --flags videos,unattend,noresize,unpack -p "${SYSTEM_NAME}" -s "${SCRAPER}" -i "${ROM_DIR}"/"${SYSTEM_NAME}" + $APP --flags videos,unattend,noresize,unpack -p "${SYSTEM_NAME}" -s "${SCRAPER}" -i "${ROM_DIR}"/"${SYSTEM_NAME}" done fi if [ "${BUILD}" = true ]; then - Skyscraper --flags "${BUILD_FLAGS_CONSOLE}" -a $CONSOLE_ART -p "${SYSTEM_NAME}" -f "${FRONTEND}" -i "${ROM_DIR}"/"${SYSTEM_NAME}" + $APP --flags "${BUILD_FLAGS_CONSOLE}" -a $CONSOLE_ART -p "${SYSTEM_NAME}" -f "${FRONTEND}" -i "${ROM_DIR}"/"${SYSTEM_NAME}" fi exit 0 fi