diff --git a/config/retrodeck/reference_lists/features.json b/config/retrodeck/reference_lists/features.json index e56b8416..d9199bd1 100644 --- a/config/retrodeck/reference_lists/features.json +++ b/config/retrodeck/reference_lists/features.json @@ -195,6 +195,71 @@ "tg16" ] }, + "zip_compressable_extensions": [ + ".32x", + ".68k", + ".NDS", + ".a26", + ".a52", + ".a78", + ".abs", + ".agb", + ".atr", + ".atx", + ".bin", + ".bml", + ".bms", + ".bs", + ".bsx", + ".cas", + ".cdm", + ".cgb", + ".cof", + ".col", + ".dim", + ".dmg", + ".dx2", + ".fds", + ".fig", + ".gb", + ".gba", + ".gbc", + ".gd3", + ".gd7", + ".gen", + ".gg", + ".ipf", + ".j64", + ".jag", + ".lnx", + ".md", + ".mdx", + ".mgd", + ".msa", + ".nds", + ".nes", + ".ngc", + ".o", + ".pce", + ".prg", + ".rom", + ".sfc", + ".sg", + ".sgb", + ".sgd", + ".smc", + ".smd", + ".sms", + ".st", + ".st", + ".stx", + ".swc", + ".unf", + ".unif", + ".xex", + ".xfd", + ".z64" + ], "system": { "3do": { "name": "3DO Interactive Multiplayer" diff --git a/config/retrodeck/reference_lists/zip_compressable_extensions.cfg b/config/retrodeck/reference_lists/zip_compressable_extensions.cfg deleted file mode 100644 index 72966ab7..00000000 --- a/config/retrodeck/reference_lists/zip_compressable_extensions.cfg +++ /dev/null @@ -1,63 +0,0 @@ -.32x -.68k -.NDS -.a26 -.a52 -.a78 -.abs -.agb -.atr -.atx -.bin -.bml -.bms -.bs -.bsx -.cas -.cdm -.cgb -.cof -.col -.dim -.dmg -.dx2 -.fds -.fig -.gb -.gba -.gbc -.gd3 -.gd7 -.gen -.gg -.ipf -.j64 -.jag -.lnx -.md -.mdx -.mgd -.msa -.nds -.nes -.ngc -.o -.pce -.prg -.rom -.sfc -.sg -.sgb -.sgd -.smc -.smd -.sms -.st -.st -.stx -.swc -.unf -.unif -.xex -.xfd -.z64 diff --git a/functions/compression.sh b/functions/compression.sh index 207ec3d0..15455e09 100644 --- a/functions/compression.sh +++ b/functions/compression.sh @@ -56,13 +56,15 @@ find_compatible_compression_format() { local normalized_filename=$(echo "$1" | tr '[:upper:]' '[:lower:]') local system=$(echo "$1" | grep -oE "$roms_folder/[^/]+" | grep -oE "[^/]+$") + # Extract the relevant lists from the JSON file local chd_systems=$(jq -r '.compression_targets.chd[]' $features) local rvz_systems=$(jq -r '.compression_targets.rvz[]' $features) local zip_systems=$(jq -r '.compression_targets.zip[]' $features) + local zip_compressable_extensions=$(jq -r '.zip_compressable_extensions[]' $features) if [[ $(validate_for_chd "$1") == "true" ]] && echo "$chd_systems" | grep -q "\b$system\b"; then echo "chd" - elif grep -qF ".${normalized_filename##*.}" $zip_compressable_extensions && echo "$zip_systems" | grep -q "\b$system\b"; then + elif echo "$zip_compressable_extensions" | grep -qF ".${normalized_filename##*.}" && echo "$zip_systems" | grep -q "\b$system\b"; then echo "zip" elif echo "$normalized_filename" | grep -qE '\.iso|\.gcm' && echo "$rvz_systems" | grep -q "\b$system\b"; then echo "rvz" @@ -74,6 +76,7 @@ find_compatible_compression_format() { fi } + validate_for_chd() { # Function for validating chd compression candidates, and compresses if validation passes. Supports .cue, .iso and .gdi formats ONLY # USAGE: validate_for_chd $input_file diff --git a/functions/global.sh b/functions/global.sh index 139171bc..7e3ae470 100644 --- a/functions/global.sh +++ b/functions/global.sh @@ -27,7 +27,6 @@ config="/app/retrodeck/config" rd_defaults="$config/retrodeck/retrodeck.cfg" # A default RetroDECK config file rd_update_patch="/var/config/retrodeck/rd_update.patch" # A static location for the temporary patch file used during retrodeck.cfg updates bios_checklist="$config/retrodeck/reference_lists/bios_checklist.cfg" # A config file listing BIOS file information that can be verified -zip_compressable_extensions="$config/retrodeck/reference_lists/zip_compressable_extensions.cfg" # A config file containing every file extension that is allowed to be compressed to .zip format, because there are a lot! input_validation="$config/retrodeck/reference_lists/input_validation.cfg" # A config file listing valid CLI inputs finit_options_list="$config/retrodeck/reference_lists/finit_options_list.cfg" # A config file listing available optional installs during finit splashscreen_dir="/var/config/ES-DE/resources/graphics/extra_splashes" # The default location of extra splash screens