generateGameList , all systems but ps3 and proton for now

This commit is contained in:
Dragoon Dorise 2024-05-10 11:21:40 +02:00
parent 73f38af040
commit 5681c86c9e

View file

@ -1,20 +1,28 @@
#!/bin/bash
generateGameLists() {
ROMS_DIR="$romsPath/snes"
ROMS_DIR="$romsPath"
# Initialize an empty array in JSON format
printf "["
first_system=true
for system_dir in "$ROMS_DIR"*; do
for system_dir in "$ROMS_DIR"/*; do
if [[ -d "$system_dir" && -f "$system_dir/metadata.txt" ]]; then
# Ignore directories named "ps3"
if [[ "$system_dir" == *"/ps3" ]]; then
continue
fi
if [[ "$system_dir" == *"/xbox360" ]]; then
continue
fi
if [[ "$system_dir" == *"/model2" ]]; then
continue
fi
if [[ "$system_dir" == *"/genesiswide" ]]; then
continue
fi
file_count=$(find "$system_dir" -type f | wc -l)
if [[ "$file_count" -le 2 ]]; then
@ -23,7 +31,8 @@ generateGameLists() {
collection=$(grep 'collection:' "$system_dir/metadata.txt" | cut -d ':' -f 2- | awk '{$1=$1};1')
shortname=$(grep 'shortname:' "$system_dir/metadata.txt" | cut -d ':' -f 2- | awk '{$1=$1};1')
launcher=$(grep 'launch:' "$system_dir/metadata.txt" | cut -d ':' -f 2- | awk '{$1=$1};1')
# launcher=$(grep 'launch:' "$system_dir/metadata.txt" | cut -d ':' -f 2- | awk '{$1=$1};1')
launcher=$(grep 'launch:' "$system_dir/metadata.txt" | cut -d ':' -f 2- | awk '{$1=$1};1' | sed 's/"/\\"/g')
extensions=$(grep 'extensions:' "$system_dir/metadata.txt" | cut -d ':' -f 2- | tr ',' ' ' | awk '{$1=$1};1')
if $first_system; then