Compare commits

...

3 commits

Author SHA1 Message Date
Dragoon Dorise 48e07bfc1f paths 2024-05-09 21:39:56 +02:00
Dragoon Dorise c49a0eb284
generateGameLists (#1218) 2024-05-09 21:18:16 +02:00
Dragoon Dorise 69a5c9a98e flatpakupdate 2024-05-09 19:35:35 +02:00
5 changed files with 87 additions and 4 deletions

View file

@ -1,20 +1,20 @@
#!/bin/bash
BINUP_toolName="EmuDeck Tool Updater"
BINUP_toolName="EmuDeck AppImage Updater"
BINUP_toolType="script"
BINUP_toolPath="${toolsPath}/binupdate/binupdate.sh"
BINUP_Shortcutlocation="$HOME/Desktop/EmuDeckBinUpdate.desktop"
BINUP_install(){
BINUP_install(){
rsync -avhp --mkpath "$EMUDECKGIT/tools/binupdate" "$toolsPath/"
chmod +x "$BINUP_toolPath"
#update the paths in the script
sed -i "s|/run/media/mmcblk0p1/Emulation/roms|${romsPath}|g" "$BINUP_toolPath"
sed -i "s|/run/media/mmcblk0p1/Emulation/tools|${toolsPath}|g" "$BINUP_toolPath"
sed -i "s|/run/media/mmcblk0p1/Emulation/tools|${toolsPath}|g" "$BINUP_toolPath"
#createDesktopShortcut "$BINUP_Shortcutlocation" "$BINUP_toolName" "bash $BINUP_toolPath" "True"
}

View file

@ -0,0 +1,19 @@
#!/bin/bash
FlatpakUP_toolName="EmuDeck Flatpak Updater"
FlatpakUP_toolType="script"
FlatpakUP_toolPath="${toolsPath}/flatpakupdate/flatpakupdate.sh"
FlatpakUp_install(){
rsync -avhp --mkpath "$EMUDECKGIT/tools/flatpakupdate" "$toolsPath/"
chmod +x "$FlatpakUP_toolPath"
#update the paths in the script
sed -i "s|/run/media/mmcblk0p1/Emulation/roms|${romsPath}|g" "$FlatpakUP_toolPath"
sed -i "s|/run/media/mmcblk0p1/Emulation/tools|${toolsPath}|g" "$FlatpakUP_toolPath"
#createDesktopShortcut "$FlatpakUP_Shortcutlocation" "$FlatpakUP_toolName" "bash $FlatpakUP_toolPath" "True"
}

View file

@ -45,6 +45,7 @@ source "$EMUDECKGIT"/functions/createFolders.sh
source "$EMUDECKGIT"/functions/runSRM.sh
source "$EMUDECKGIT"/functions/appImageInit.sh
source "$EMUDECKGIT"/functions/autofix.sh
source "$EMUDECKGIT"/functions/generateGameLists.sh
#toolScripts
@ -54,6 +55,7 @@ source "$EMUDECKGIT"/functions/ToolScripts/emuDeckPlugins.sh
source "$EMUDECKGIT"/functions/ToolScripts/emuDeckSRM.sh
source "$EMUDECKGIT"/functions/ToolScripts/emuDeckCHD.sh
source "$EMUDECKGIT"/functions/ToolScripts/emuDeckBINUP.sh
source "$EMUDECKGIT"/functions/ToolScripts/emuDeckFlatpakUP.sh
source "$EMUDECKGIT"/functions/ToolScripts/emuDeckCloudBackup.sh
source "$EMUDECKGIT"/functions/ToolScripts/emuDeckCloudSync.sh
source "$EMUDECKGIT"/functions/ToolScripts/emuDeckRemotePlayWhatever.sh

View file

@ -0,0 +1,61 @@
#!/bin/bash
generateGameLists(){
ROMS_DIR="$romsPath"
JSON_OUTPUT="$HOME/emudeck/roms_games.json"
echo "[" > "$JSON_OUTPUT"
for system_dir in "$ROMS_DIR"/*; do
if [[ -d "$system_dir" && -f "$system_dir/metadata.txt" ]]; then
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')
extensions=$(grep 'extensions:' "$system_dir/metadata.txt" | cut -d ':' -f 2- | tr ',' '\n' | awk '{$1=$1};1' | tr '\n' '|')
launcher=$(grep 'launch:' "$system_dir/metadata.txt" | cut -d ':' -f 2- | awk '{$1=$1};1')
extensions="${extensions%|}" # Eliminar el último '|'
tmp_file="$(mktemp)"
find "$system_dir" -type f | while read file_path; do
filename=$(basename "$file_path")
extension="${filename##*.}"
if [[ $extensions =~ (^|[|])${extension,,}([|]|$) ]]; then
name="${filename%.*}"
echo "{\"name\": \"$name\", \"filename\": \"$file_path\"}," >> "$tmp_file"
fi
done
sort "$tmp_file" | sed '$ s/,$//' > "${tmp_file}_sorted"
mv "${tmp_file}_sorted" "$tmp_file"
if [[ -s "$tmp_file" ]]; then
echo " {" >> "$JSON_OUTPUT"
echo " \"title\": \"$collection\"," >> "$JSON_OUTPUT"
echo " \"id\": \"$shortname\"," >> "$JSON_OUTPUT"
echo " \"launcher\": \"$launcher\"," >> "$JSON_OUTPUT"
echo " \"games\": [" >> "$JSON_OUTPUT"
cat "$tmp_file" >> "$JSON_OUTPUT"
echo " ]" >> "$JSON_OUTPUT"
echo " }," >> "$JSON_OUTPUT"
fi
rm "$tmp_file"
fi
done
echo "]" >> "$JSON_OUTPUT"
sed -i '$ s/,$//' "$JSON_OUTPUT"
cat $JSON_OUTPUT
}

View file

@ -423,6 +423,7 @@ fi
#Always install
BINUP_install
FlatpakUP_install
CHD_install
#