mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-04-10 19:15:12 +00:00
Update steam_sync for proper Configurator detection and dialogs
This commit is contained in:
parent
0f4357f4d4
commit
26baed91f7
|
|
@ -52,17 +52,24 @@ steam_sync() {
|
||||||
if [[ -f "$retrodeck_favorites_file" ]]; then # If an existing favorites manifest exists
|
if [[ -f "$retrodeck_favorites_file" ]]; then # If an existing favorites manifest exists
|
||||||
if [[ $favorites_found == "false" ]]; then # If no favorites were found in the gamelists
|
if [[ $favorites_found == "false" ]]; then # If no favorites were found in the gamelists
|
||||||
log i "No favorites were found in current ES-DE gamelists, removing old entries"
|
log i "No favorites were found in current ES-DE gamelists, removing old entries"
|
||||||
(
|
if [[ "$CONFIGURATOR_GUI" == "zenity" ]]; then
|
||||||
# Remove old entries
|
(
|
||||||
steam-rom-manager enable --names "RetroDECK Steam Sync" >> "$srm_log" 2>&1
|
# Remove old entries
|
||||||
steam-rom-manager disable --names "RetroDECK Launcher" >> "$srm_log" 2>&1
|
steam-rom-manager enable --names "RetroDECK Steam Sync" >> "$srm_log" 2>&1
|
||||||
steam-rom-manager remove >> "$srm_log" 2>&1
|
steam-rom-manager disable --names "RetroDECK Launcher" >> "$srm_log" 2>&1
|
||||||
) |
|
steam-rom-manager remove >> "$srm_log" 2>&1
|
||||||
rd_zenity --progress \
|
) |
|
||||||
--title="Syncing with Steam" \
|
rd_zenity --progress \
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
--title="Syncing with Steam" \
|
||||||
--text="<span foreground='$purple'><b>\t\t\t\tSyncing favorite games with Steam</b></span>\n\n<b>NOTE: </b>This operation may take some time depending on the size of your library.\nFeel free to leave this in the background and switch to another application.\n\n" \
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
--pulsate --width=500 --height=150 --auto-close --no-cancel
|
--text="<span foreground='$purple'><b>\t\t\t\tSyncing favorite games with Steam</b></span>\n\n<b>NOTE: </b>This operation may take some time depending on the size of your library.\nFeel free to leave this in the background and switch to another application.\n\n" \
|
||||||
|
--pulsate --width=500 --height=150 --auto-close --no-cancel
|
||||||
|
else
|
||||||
|
# Remove old entries
|
||||||
|
steam-rom-manager enable --names "RetroDECK Steam Sync" >> "$srm_log" 2>&1
|
||||||
|
steam-rom-manager disable --names "RetroDECK Launcher" >> "$srm_log" 2>&1
|
||||||
|
steam-rom-manager remove >> "$srm_log" 2>&1
|
||||||
|
fi
|
||||||
# Old manifest cleanup
|
# Old manifest cleanup
|
||||||
rm "$retrodeck_favorites_file"
|
rm "$retrodeck_favorites_file"
|
||||||
rm "${retrodeck_favorites_file}.new"
|
rm "${retrodeck_favorites_file}.new"
|
||||||
|
|
@ -72,38 +79,58 @@ steam_sync() {
|
||||||
rm "${retrodeck_favorites_file}.new"
|
rm "${retrodeck_favorites_file}.new"
|
||||||
else
|
else
|
||||||
log d "New and old manifests are different, running sync"
|
log d "New and old manifests are different, running sync"
|
||||||
(
|
if [[ "$CONFIGURATOR_GUI" == "zenity" ]]; then
|
||||||
# Remove old entries
|
(
|
||||||
steam-rom-manager enable --names "RetroDECK Steam Sync" >> "$srm_log" 2>&1
|
# Remove old entries
|
||||||
steam-rom-manager disable --names "RetroDECK Launcher" >> "$srm_log" 2>&1
|
steam-rom-manager enable --names "RetroDECK Steam Sync" >> "$srm_log" 2>&1
|
||||||
steam-rom-manager remove >> "$srm_log" 2>&1
|
steam-rom-manager disable --names "RetroDECK Launcher" >> "$srm_log" 2>&1
|
||||||
|
steam-rom-manager remove >> "$srm_log" 2>&1
|
||||||
|
|
||||||
# Load new favorites manifest
|
# Load new favorites manifest
|
||||||
mv "${retrodeck_favorites_file}.new" "$retrodeck_favorites_file"
|
mv "${retrodeck_favorites_file}.new" "$retrodeck_favorites_file"
|
||||||
|
|
||||||
# Add new favorites manifest
|
# Add new favorites manifest
|
||||||
steam-rom-manager enable --names "RetroDECK Steam Sync" >> "$srm_log" 2>&1
|
steam-rom-manager enable --names "RetroDECK Steam Sync" >> "$srm_log" 2>&1
|
||||||
steam-rom-manager add >> "$srm_log" 2>&1
|
steam-rom-manager add >> "$srm_log" 2>&1
|
||||||
) |
|
) |
|
||||||
rd_zenity --progress \
|
rd_zenity --progress \
|
||||||
--title="Syncing with Steam" \
|
--title="Syncing with Steam" \
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
--text="<span foreground='$purple'><b>\t\t\t\tSyncing favorite games with Steam</b></span>\n\n<b>NOTE: </b>This operation may take some time depending on the size of your library.\nFeel free to leave this in the background and switch to another application.\n\n" \
|
--text="<span foreground='$purple'><b>\t\t\t\tSyncing favorite games with Steam</b></span>\n\n<b>NOTE: </b>This operation may take some time depending on the size of your library.\nFeel free to leave this in the background and switch to another application.\n\n" \
|
||||||
--pulsate --width=500 --height=150 --auto-close --no-cancel
|
--pulsate --width=500 --height=150 --auto-close --no-cancel
|
||||||
|
else
|
||||||
|
# Remove old entries
|
||||||
|
steam-rom-manager enable --names "RetroDECK Steam Sync" >> "$srm_log" 2>&1
|
||||||
|
steam-rom-manager disable --names "RetroDECK Launcher" >> "$srm_log" 2>&1
|
||||||
|
steam-rom-manager remove >> "$srm_log" 2>&1
|
||||||
|
|
||||||
|
# Load new favorites manifest
|
||||||
|
mv "${retrodeck_favorites_file}.new" "$retrodeck_favorites_file"
|
||||||
|
|
||||||
|
# Add new favorites manifest
|
||||||
|
steam-rom-manager enable --names "RetroDECK Steam Sync" >> "$srm_log" 2>&1
|
||||||
|
steam-rom-manager add >> "$srm_log" 2>&1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
elif [[ $favorites_found == "true" ]]; then # Only sync if some favorites were found
|
elif [[ $favorites_found == "true" ]]; then # Only sync if some favorites were found
|
||||||
log d "First time building favorites manifest, running sync"
|
log d "First time building favorites manifest, running sync"
|
||||||
mv "${retrodeck_favorites_file}.new" "$retrodeck_favorites_file"
|
mv "${retrodeck_favorites_file}.new" "$retrodeck_favorites_file"
|
||||||
(
|
if [[ "$CONFIGURATOR_GUI" == "zenity" ]]; then
|
||||||
# Add new favorites manifest
|
(
|
||||||
steam-rom-manager enable --names "RetroDECK Steam Sync" >> "$srm_log" 2>&1
|
# Add new favorites manifest
|
||||||
steam-rom-manager add >> "$srm_log" 2>&1
|
steam-rom-manager enable --names "RetroDECK Steam Sync" >> "$srm_log" 2>&1
|
||||||
) |
|
steam-rom-manager add >> "$srm_log" 2>&1
|
||||||
rd_zenity --progress \
|
) |
|
||||||
--title="Syncing with Steam" \
|
rd_zenity --progress \
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
--title="Syncing with Steam" \
|
||||||
--text="<span foreground='$purple'><b>\t\t\t\tSyncing favorite games with Steam</b></span>\n\n<b>NOTE: </b>This operation may take some time depending on the size of your library.\nFeel free to leave this in the background and switch to another application.\n\n" \
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
--pulsate --width=500 --height=150 --auto-close --no-cancel
|
--text="<span foreground='$purple'><b>\t\t\t\tSyncing favorite games with Steam</b></span>\n\n<b>NOTE: </b>This operation may take some time depending on the size of your library.\nFeel free to leave this in the background and switch to another application.\n\n" \
|
||||||
|
--pulsate --width=500 --height=150 --auto-close --no-cancel
|
||||||
|
else
|
||||||
|
# Add new favorites manifest
|
||||||
|
steam-rom-manager enable --names "RetroDECK Steam Sync" >> "$srm_log" 2>&1
|
||||||
|
steam-rom-manager add >> "$srm_log" 2>&1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue