Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Leia #117

Merged
merged 65 commits into from
Aug 26, 2019
Merged

Update for Leia #117

merged 65 commits into from
Aug 26, 2019

Conversation

robweber
Copy link
Owner

@robweber robweber commented Nov 9, 2017

In addition for some minor changes to add Krypton specific features the goal with this merge is to completely revamp the way file selection is handled. This should take care of several of the special requests for files being selected.

Be advised that this PR is not yet complete but is here for documentation and commenting purposes

The old way

The old way files were selected was very simple. There were a handful of options (Addons, Addon Data, etc) that corresponded to hardcoded file paths. Additionally 2 custom directories were also available in the settings.

The main issues with all of this had to do with flexibility. There really wasn't any. It also made restores an all/nothing approach.

The new way

The new way utilizes the concept of directory groups and a simple vs advanced mode. The simple mode is just a pre-selected version of the advanced mode, so a description of it suffices for both.

A json file is created that lists directories to be included in a group. Each group can have included or excluded directories. Additionally included directories can be recursed true/false. An example file for the simple pre-sets is below:

{
	"addons":{
		"root":"special://home/addons",
		"dirs":[
			{
				"type":"include",
				"path":"special://home/addons",
				"recurse":true
			},
			{
				"type":"exclude",
				"path":"special://home/addons/packages"
			}
		]
	},
	"addon_data":{
			"root":"special://home/userdata/addon_data",
			"dirs":[
			{
				"type":"include",
				"path":"special://home/userdata/addon_data",
				"recurse":true
			}
		]
	}
}

Each directory group will create a folder within the backup for it's files. These are done separately, even if groups are pulling from the same folder.

Also during the backup the file selections are recorded in the backup validation file. These are used on restore to restore directories that actually were included in the backup.

@robweber
Copy link
Owner Author

robweber commented Dec 6, 2017

Pretty much the main nuts and bolts of this are done. Here is a summary of the breaking changes and features.

Breaking Changes

Backup file selections will need to be re-done. This is especially true if you had custom directories setup. For "Simple" file selections just confirm the radio buttons in the settings are the ones you want.

You won't be able to restore backups created with previous versions of this addon. In order to facilitate the new "sets" features I decided not to make them backwards compatible.

Features

Advanced Selection Editor

As described above there is a Simple vs Advanced file selection feature in the settings area now. Simple is just like the old way, minus the custom directories option (I may add this back in). The Advanced editor will pop up a new series of dialog boxes.

Adding a set will allow you to name a backup selection set and then set a root folder for inclusion. Because of how Kodi handles it's file browser I couldn't just let you browse the system carte blanche. You can either choose to select a folder within the "special://home" directory (default) or type your own path to start as the root. You can get as granular here as you want. Only selecting a specific addon to backup, or a specific sub folder.

Once the set is added you can select it to edit it or delete it. Editing a set allows you to see the root folder and add exclusions. By default the root folder is recursed and all files/directories added. You can select a folders to exclude; adding as many exclusions as you want to trim the backup set to a selection you want.

Backups

When backing up in either the Simple or Advanced file mode you'll get a similar result. The backup archive will create a series of folders, one for each backup set type. With the Simple mode each set is just one of the "on/off" selection boxes. The xbmcbackup.val file also contains more information regarding the settings and paths for that particular backup.

Restores

Restores have been revamped. Previously they tried to restore files sort of in a "reverse backup" kind of way. Whatever you had selected in the file selection settings was attempted to be put back. This was not very intuitive and led to issues where maybe you didn't want all those files, or the backup you selected didn't contain them all (ie settings changed later).

After selecting your backup you'll now get a Backup Set selection browser. This will show the name of each set in whatever backup you've chosen. This is a multi-selection box. You can select them all or just a particular one. Once selected the restore process will restore these files only.

Todo

Yet todo in this branch is to update the Scripting functions. This is a little used feature but with the restore functionality being modified it needs to be changed to things can be automated if needed by a script.

@robweber
Copy link
Owner Author

Latest round of commits adds the ability to toggle sub folders (if should recurse) on individual included folders. This is something that could always be done but finally exposed via the Advanced Editor. This should make the Advanced Editor fully functional with what is capable via the file manager.

@robweber robweber merged commit 8654169 into master Aug 26, 2019
@robweber
Copy link
Owner Author

Merged all of this into master - now considered official latest version

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