add mare profiles

This commit is contained in:
rootdarkarchon
2023-03-19 19:00:22 +01:00
parent f6a471f457
commit 2b829af4f8
22 changed files with 625 additions and 57 deletions

View File

@@ -23,7 +23,7 @@ public class ConfigurationMigrator : IHostedService
public void Migrate()
{
if (_pi.GetPluginConfig() is Configuration oldConfig)
if (_pi.GetPluginConfig() is Configurations.Obsolete.Configuration oldConfig)
{
_logger.LogInformation("Migrating Configuration from old config style to 1");
@@ -53,11 +53,15 @@ public class ConfigurationMigrator : IHostedService
{
try
{
var serverConfig = JsonConvert.DeserializeObject<ServerConfigV0>(File.ReadAllText(ConfigurationPath(ServerConfigService.ConfigName)))!;
if (serverConfig.Version == 0)
var content = File.ReadAllText(ConfigurationPath(ServerConfigService.ConfigName));
if (!content.Contains("\"Version\": 1"))
{
MigrateServerConfigV0toV1(serverConfig);
var serverConfig = JsonConvert.DeserializeObject<ServerConfigV0>(content);
if (serverConfig != null && serverConfig.Version == 0)
{
MigrateServerConfigV0toV1(serverConfig);
}
}
}
catch (Exception ex)

View File

@@ -10,6 +10,7 @@ public class MareConfig : IMareConfiguration
public string CacheFolder { get; set; } = string.Empty;
public bool DisableOptionalPluginWarnings { get; set; } = false;
public NotificationLocation ErrorNotification { get; set; } = NotificationLocation.Both;
public string ExportFolder { get; set; } = string.Empty;
public bool FileScanPaused { get; set; } = false;
public NotificationLocation InfoNotification { get; set; } = NotificationLocation.Toast;
public bool InitialScanComplete { get; set; } = false;
@@ -19,6 +20,9 @@ public class MareConfig : IMareConfiguration
public bool OpenGposeImportOnGposeStart { get; set; } = false;
public bool OpenPopupOnAdd { get; set; } = true;
public int ParallelDownloads { get; set; } = 10;
public float ProfileDelay { get; set; } = 2;
public bool ProfilesAllowNsfw { get; set; } = false;
public bool ProfilesShow { get; set; } = true;
public bool ReverseUserSort { get; set; } = false;
public bool ShowCharacterNameInsteadOfNotesForVisible { get; set; } = false;
public bool ShowOfflineUsersSeparately { get; set; } = true;
@@ -36,5 +40,4 @@ public class MareConfig : IMareConfiguration
public int TransferBarsWidth { get; set; } = 250;
public int Version { get; set; } = 1;
public NotificationLocation WarningNotification { get; set; } = NotificationLocation.Both;
public string ExportFolder { get; set; } = string.Empty;
}