Exemple #1
0
        public async static Task SaveSetting(Settings settings, IProgress <string> progress)
        {
            progress.Report($"初始化配置");

            if (!Directory.Exists(settings.JavLibraryImageFolder))
            {
                progress.Report("创建JavLibrary封面文件夹");
                Directory.CreateDirectory(settings.JavLibraryImageFolder);
            }

            if (!Directory.Exists(settings.JavBusImageFolder))
            {
                progress.Report("创建JavBus封面文件夹");
                Directory.CreateDirectory(settings.JavBusImageFolder);
            }

            if (!Directory.Exists(settings.AvatorImageFolder))
            {
                progress.Report("创建女优封面文件夹");
                Directory.CreateDirectory(settings.AvatorImageFolder);
            }

            var settringDAL = new SettingsDAL();

            settringDAL.InitSetting(JsonHelper.SerializeWithUtf8(settings)).Wait();

            settringDAL.TruncatePrefix().Wait();
            settringDAL.InsertPrefix(settings.Prefix).Wait();
        }