Replace filter used in backup selection and add hostname to default backup file name #321
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
xbmcgui.dialog.browse (https://alwinesch.github.io/group__python___dialog.html#ga2ece1ca620087a97233713710eac1b83) is used to select the backup file to be restored.
'??????????????.tar'
serves as the "mask" to filter the selected file to an acceptable format. In short, if a user selects a file that isn't 14 characters followed by .tar, it gets rejected and silently replaced with the default value of the backup directory, which the addon then rejects and does nothing.This removes the "mask" altogether, and instead does a post-selection check to see if the chosen file ends in one of: .tar, .tar.gz, .tar.bz2, or .tar.xz. This matches the busybox restore script (https://github.com/LibreELEC/LibreELEC.tv/blob/9ea3926457cf8b162b2e7f16faf7a8928270929b/packages/mediacenter/LibreELEC-settings/scripts/backup-restore#L11-L15). If the file doesn't match, it tells the user they made an invalid choice.
No image-side changes are needed for the above; the busybox script was changed pre-LE10 to accommodate #162
With relaxed backup file selection, change the default backup naming from $DATESTAMP.tar to $HOSTNAME-$DATESTAMP.tar. My hope is that this will be clearer when looking at these files later, even if leaving at the default hostname. Additionally, if a user has multiple LE boxes, hopefully they have unique hostnames (ex: LE-LivingRoom or LE-RPi5).
TODO localization