Skip to content

Conversation

@antonlacon
Copy link
Contributor

@antonlacon antonlacon commented Mar 8, 2024

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

@chewitt chewitt merged commit b36ea36 into LibreELEC:master Aug 12, 2024
@antonlacon antonlacon deleted the backup-naming branch August 12, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants