Save Overwrite local failsave
This is my idea of a save overwrite failsafe for local.
its very rough and I am unable to finish it because of my lack of rust knowledge and time.
- we use a command line arg to specify if we want the failsafe so something such as --failsafe.
- normally the failsafe will use the gui to make selections or command line to make selections
- we want this to be steamdeck compatible/hook into decky ludusavi for native gui so we will..
- have a potential -steamdeck option or use -api
- specific command line argument will make the command respond with a json .
- Deckyludusavi will interpret that json, present a gui to user and then run a command another command with either -Y or -N based on user input
- If we ran restore --failsafe and had a save conflict. and we want to keep the save. Decky will present a gui after interpreting the json from the restore command. We will select no to restoring the save on the gui. Decky will then run restore --failsafe -N and proceed.
- This is more specifically for the wrap command but it is also used for the restore command.
- more specifically I will use this when I implement native wrapping to decky ludusavi so wrapping works properly in gamemode.
Hi! Thanks for your PR. As we discussed on Discord, I'll look into refactoring this and fleshing it out. I think some of this logic probably belongs in a lower level, and there may be some overlap with https://github.com/mtkennerly/ludusavi/discussions/436 to use the same system to ask the user what they want to do when there's a cloud conflict.
if local_size > backup_size || local_modified_time_utc > backup_modified_time
Checking the modified time makes sense, but I don't think size is a good indicator here. For example, if the game stores multiple save slots in one file, and you delete a slot, then the file would probably get smaller even though it's newer.
hook into decky ludusavi for native gui
Based on that one Discord conversation you had linked me to, the current GTK dialogs do work on Steam Deck (even for non-Steam shortcuts, as long as you use the absolute path to Ludusavi, apparently), so I don't really understand what you're trying to solve. If the issue is that backup and restore don't have --gui flags, those will be added in the next release. Could you please elaborate on the problem?
Deckyludusavi will interpret that json, present a gui to user and then run a command another command with either -Y or -N based on user input
Splitting the commands up into resumable/stateful pieces would significantly increase the complexity, so I'm not open to that. If --gui really doesn't work for you even with the workarounds from the Discord thread (please double check and make sure to try them, including with the absolute path), then we can explore some other options.
Checking the modified time makes sense, but I don't think size is a good indicator here. For example, if the game stores multiple save slots in one file, and you delete a slot, then the file would probably get smaller even though it's newer.
Simple game updates can also reduce save file size. They could migrate to a more efficient compression scheme for example. So it is definitely not a save condition to check against.
Implemented in 753a91878b031ea6e6a65fc0f977bf90ff6ea7b3.