From 13e7ebd8b25e5b06d0902522d1213b7fda82259e Mon Sep 17 00:00:00 2001 From: icenine451 Date: Thu, 14 Nov 2024 08:39:51 -0500 Subject: [PATCH] Reverse $preset and $choice argument order for make_preset_changes() to avoid having to send a null array if all systems are being disabled. --- functions/presets.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/functions/presets.sh b/functions/presets.sh index bb397d56..3a6a83bd 100644 --- a/functions/presets.sh +++ b/functions/presets.sh @@ -32,7 +32,7 @@ change_preset_dialog() { if [[ ! -z $choice || "$rc" == 0 ]]; then ( - make_preset_changes "$choice" "$1" + make_preset_changes "$1" "$choice" ) | rd_zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ @@ -84,7 +84,7 @@ build_preset_list_options() { make_preset_changes() { # This function will take a preset name $preset and a CSV list $choice, which contains the names of systems that have been enabled for this preset and enable them in the backend # Any systems which are currently enabled and not in the CSV list $choice will instead be disabled in the backend - # USAGE: make_preset_changes $choice $preset + # USAGE: make_preset_changes $preset $choice # Fetch incompatible presets from JSON and create a lookup list incompatible_presets=$(jq -r ' @@ -95,8 +95,8 @@ make_preset_changes() { ] | join("\n") ' $features) - choice="$1" - preset="$2" + preset="$1" + choice="$2" build_preset_list_options "$preset"