Bounz / HomeGenie-BE

HomeGenie (Bounz Edition)
GNU General Public License v3.0
5 stars 3 forks source link

Use LiteDB for storing settings #39

Open Bounz opened 6 years ago

Bounz commented 6 years ago

Use LiteDB to store all system settings, modules, and automation programs' settings. Also use it for storing Pepper1Db data instead of XML-files.

davidwallis commented 6 years ago

If refactoring pepperdb to be in the litedb then BackupManager.cs can be modified to change the following code:

            string migLibFolder = Path.Combine("lib", "mig");
            if (Directory.Exists(migLibFolder))
            {
                foreach (string f in Directory.GetFiles(migLibFolder, "*.xml"))
                {
                    // exclude Pepper1 Db from backup (only the p1db_custom.xml file will be included)
                    // in the future the p1db.xml file should be moved to a different path 
                    if (Path.GetFileName(f) != "p1db.xml")
                        Utility.AddFileToZip(archiveName, f);
                }
            }

to:

            var migLibFolder = Path.Combine("lib", "mig");
            if (!Directory.Exists(migLibFolder)) { return; }

            foreach (var f in Directory.GetFiles(migLibFolder, "*.xml"))
            {
                Utility.AddFileToZip(archiveName, f);
            }