fixed initial db state

This commit is contained in:
Flaminel
2025-06-15 01:21:58 +03:00
parent 9e393eebcc
commit 95d39c40ed
5 changed files with 91 additions and 190 deletions

View File

@@ -73,13 +73,5 @@ public class DataContext : DbContext
.HasConversion<string>();
}
}
modelBuilder.Entity<DownloadCleanerConfig>().HasData(new DownloadCleanerConfig());
modelBuilder.Entity<GeneralConfig>().HasData(new GeneralConfig());
modelBuilder.Entity<SonarrConfig>().HasData(new SonarrConfig());
modelBuilder.Entity<RadarrConfig>().HasData(new RadarrConfig());
modelBuilder.Entity<LidarrConfig>().HasData(new LidarrConfig());
modelBuilder.Entity<AppriseConfig>().HasData(new AppriseConfig());
modelBuilder.Entity<NotifiarrConfig>().HasData(new NotifiarrConfig());
}
}

View File

@@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Data.Migrations.Data
{
[DbContext(typeof(DataContext))]
[Migration("20250614213915_InitialData")]
[Migration("20250614220030_InitialData")]
partial class InitialData
{
/// <inheritdoc />
@@ -89,14 +89,6 @@ namespace Data.Migrations.Data
.HasName("pk_lidarr_configs");
b.ToTable("lidarr_configs", (string)null);
b.HasData(
new
{
Id = new Guid("6096303a-399c-42b8-be8f-60a02cec5a51"),
Enabled = false,
FailedImportMaxStrikes = (short)-1
});
});
modelBuilder.Entity("Common.Configuration.Arr.RadarrConfig", b =>
@@ -118,14 +110,6 @@ namespace Data.Migrations.Data
.HasName("pk_radarr_configs");
b.ToTable("radarr_configs", (string)null);
b.HasData(
new
{
Id = new Guid("4fd2b82b-cffd-4b41-bcc0-204058b1e459"),
Enabled = false,
FailedImportMaxStrikes = (short)-1
});
});
modelBuilder.Entity("Common.Configuration.Arr.SonarrConfig", b =>
@@ -152,15 +136,6 @@ namespace Data.Migrations.Data
.HasName("pk_sonarr_configs");
b.ToTable("sonarr_configs", (string)null);
b.HasData(
new
{
Id = new Guid("0b38a68f-3d7b-4d98-ae96-115da62d9af2"),
Enabled = false,
FailedImportMaxStrikes = (short)-1,
SearchType = "Episode"
});
});
modelBuilder.Entity("Common.Configuration.DownloadCleaner.CleanCategory", b =>
@@ -251,21 +226,6 @@ namespace Data.Migrations.Data
.HasName("pk_download_cleaner_configs");
b.ToTable("download_cleaner_configs", (string)null);
b.HasData(
new
{
Id = new Guid("edb20d44-9d7b-478f-aec5-93a803c26fb4"),
CronExpression = "0 0 * * * ?",
DeletePrivate = false,
Enabled = false,
UnlinkedCategories = "[]",
UnlinkedEnabled = false,
UnlinkedIgnoredRootDir = "",
UnlinkedTargetCategory = "cleanuparr-unlinked",
UnlinkedUseTag = false,
UseAdvancedScheduling = false
});
});
modelBuilder.Entity("Common.Configuration.DownloadClientConfig", b =>
@@ -367,21 +327,6 @@ namespace Data.Migrations.Data
.HasName("pk_general_configs");
b.ToTable("general_configs", (string)null);
b.HasData(
new
{
Id = new Guid("1490f450-1b29-4111-ab20-8a03dbd9d366"),
DryRun = false,
EncryptionKey = "00253fe9-6c9b-4b0e-a05e-e5d2164f2389",
HttpCertificateValidation = "Enabled",
HttpMaxRetries = (ushort)0,
HttpTimeout = (ushort)100,
IgnoredDownloads = "[]",
LogLevel = "Information",
SearchDelay = (ushort)30,
SearchEnabled = true
});
});
modelBuilder.Entity("Common.Configuration.Notification.AppriseConfig", b =>
@@ -427,18 +372,6 @@ namespace Data.Migrations.Data
.HasName("pk_apprise_configs");
b.ToTable("apprise_configs", (string)null);
b.HasData(
new
{
Id = new Guid("9c7a346a-2b80-4935-ae4f-5400e336fd07"),
OnCategoryChanged = false,
OnDownloadCleaned = false,
OnFailedImportStrike = false,
OnQueueItemDeleted = false,
OnSlowStrike = false,
OnStalledStrike = false
});
});
modelBuilder.Entity("Common.Configuration.Notification.NotifiarrConfig", b =>
@@ -484,18 +417,6 @@ namespace Data.Migrations.Data
.HasName("pk_notifiarr_configs");
b.ToTable("notifiarr_configs", (string)null);
b.HasData(
new
{
Id = new Guid("dd468589-e5ee-4e1b-b05e-28b461894846"),
OnCategoryChanged = false,
OnDownloadCleaned = false,
OnFailedImportStrike = false,
OnQueueItemDeleted = false,
OnSlowStrike = false,
OnStalledStrike = false
});
});
modelBuilder.Entity("Common.Configuration.QueueCleaner.QueueCleanerConfig", b =>

View File

@@ -240,11 +240,98 @@ namespace Data.Migrations.Data
principalColumn: "id");
});
migrationBuilder.CreateIndex(
name: "ix_arr_instance_lidarr_config_id",
table: "arr_instance",
column: "lidarr_config_id");
migrationBuilder.CreateIndex(
name: "ix_arr_instance_radarr_config_id",
table: "arr_instance",
column: "radarr_config_id");
migrationBuilder.CreateIndex(
name: "ix_arr_instance_sonarr_config_id",
table: "arr_instance",
column: "sonarr_config_id");
migrationBuilder.CreateIndex(
name: "ix_clean_category_download_cleaner_config_id",
table: "clean_category",
column: "download_cleaner_config_id");
migrationBuilder.InsertData(
table: "apprise_configs",
columns: new[] { "id", "key", "on_category_changed", "on_download_cleaned", "on_failed_import_strike", "on_queue_item_deleted", "on_slow_strike", "on_stalled_strike", "url" },
values: new object[] { new Guid("9c7a346a-2b80-4935-ae4f-5400e336fd07"), null, false, false, false, false, false, false, null });
migrationBuilder.InsertData(
table: "queue_cleaner_configs",
columns: new[]
{
"id",
"content_blocker_delete_private",
"content_blocker_enabled",
"content_blocker_ignore_private",
"content_blocker_lidarr_blocklist_path",
"content_blocker_lidarr_blocklist_type",
"content_blocker_radarr_blocklist_path",
"content_blocker_radarr_blocklist_type",
"content_blocker_sonarr_blocklist_path",
"content_blocker_sonarr_blocklist_type",
"cron_expression",
"enabled",
"failed_import_delete_private",
"failed_import_ignore_private",
"failed_import_ignored_patterns",
"failed_import_max_strikes",
"slow_delete_private",
"slow_ignore_above_size",
"slow_ignore_private",
"slow_max_strikes",
"slow_max_time",
"slow_min_speed",
"slow_reset_strikes_on_progress",
"stalled_delete_private",
"stalled_downloading_metadata_max_strikes",
"stalled_ignore_private",
"stalled_max_strikes",
"stalled_reset_strikes_on_progress",
"use_advanced_scheduling"
},
values: new object[]
{
new Guid("098ae890-21dd-4a23-9ba8-ed5ce1ab4817"),
false,
false,
false,
null,
0,
null,
0,
null,
0,
"0 0/5 * * * ?",
false,
false,
false,
"[]",
(ushort)0,
false,
"",
false,
(ushort)0,
0.0,
"",
false,
false,
(ushort)0,
false,
(ushort)0,
true,
false
});
migrationBuilder.InsertData(
table: "download_cleaner_configs",
columns: new[] { "id", "cron_expression", "delete_private", "enabled", "unlinked_categories", "unlinked_enabled", "unlinked_ignored_root_dir", "unlinked_target_category", "unlinked_use_tag", "use_advanced_scheduling" },
@@ -274,26 +361,6 @@ namespace Data.Migrations.Data
table: "sonarr_configs",
columns: new[] { "id", "enabled", "failed_import_max_strikes", "search_type" },
values: new object[] { new Guid("0b38a68f-3d7b-4d98-ae96-115da62d9af2"), false, (short)-1, "Episode" });
migrationBuilder.CreateIndex(
name: "ix_arr_instance_lidarr_config_id",
table: "arr_instance",
column: "lidarr_config_id");
migrationBuilder.CreateIndex(
name: "ix_arr_instance_radarr_config_id",
table: "arr_instance",
column: "radarr_config_id");
migrationBuilder.CreateIndex(
name: "ix_arr_instance_sonarr_config_id",
table: "arr_instance",
column: "sonarr_config_id");
migrationBuilder.CreateIndex(
name: "ix_clean_category_download_cleaner_config_id",
table: "clean_category",
column: "download_cleaner_config_id");
}
/// <inheritdoc />

View File

@@ -86,14 +86,6 @@ namespace Data.Migrations.Data
.HasName("pk_lidarr_configs");
b.ToTable("lidarr_configs", (string)null);
b.HasData(
new
{
Id = new Guid("6096303a-399c-42b8-be8f-60a02cec5a51"),
Enabled = false,
FailedImportMaxStrikes = (short)-1
});
});
modelBuilder.Entity("Common.Configuration.Arr.RadarrConfig", b =>
@@ -115,14 +107,6 @@ namespace Data.Migrations.Data
.HasName("pk_radarr_configs");
b.ToTable("radarr_configs", (string)null);
b.HasData(
new
{
Id = new Guid("4fd2b82b-cffd-4b41-bcc0-204058b1e459"),
Enabled = false,
FailedImportMaxStrikes = (short)-1
});
});
modelBuilder.Entity("Common.Configuration.Arr.SonarrConfig", b =>
@@ -149,15 +133,6 @@ namespace Data.Migrations.Data
.HasName("pk_sonarr_configs");
b.ToTable("sonarr_configs", (string)null);
b.HasData(
new
{
Id = new Guid("0b38a68f-3d7b-4d98-ae96-115da62d9af2"),
Enabled = false,
FailedImportMaxStrikes = (short)-1,
SearchType = "Episode"
});
});
modelBuilder.Entity("Common.Configuration.DownloadCleaner.CleanCategory", b =>
@@ -248,21 +223,6 @@ namespace Data.Migrations.Data
.HasName("pk_download_cleaner_configs");
b.ToTable("download_cleaner_configs", (string)null);
b.HasData(
new
{
Id = new Guid("edb20d44-9d7b-478f-aec5-93a803c26fb4"),
CronExpression = "0 0 * * * ?",
DeletePrivate = false,
Enabled = false,
UnlinkedCategories = "[]",
UnlinkedEnabled = false,
UnlinkedIgnoredRootDir = "",
UnlinkedTargetCategory = "cleanuparr-unlinked",
UnlinkedUseTag = false,
UseAdvancedScheduling = false
});
});
modelBuilder.Entity("Common.Configuration.DownloadClientConfig", b =>
@@ -364,21 +324,6 @@ namespace Data.Migrations.Data
.HasName("pk_general_configs");
b.ToTable("general_configs", (string)null);
b.HasData(
new
{
Id = new Guid("1490f450-1b29-4111-ab20-8a03dbd9d366"),
DryRun = false,
EncryptionKey = "00253fe9-6c9b-4b0e-a05e-e5d2164f2389",
HttpCertificateValidation = "Enabled",
HttpMaxRetries = (ushort)0,
HttpTimeout = (ushort)100,
IgnoredDownloads = "[]",
LogLevel = "Information",
SearchDelay = (ushort)30,
SearchEnabled = true
});
});
modelBuilder.Entity("Common.Configuration.Notification.AppriseConfig", b =>
@@ -424,18 +369,6 @@ namespace Data.Migrations.Data
.HasName("pk_apprise_configs");
b.ToTable("apprise_configs", (string)null);
b.HasData(
new
{
Id = new Guid("9c7a346a-2b80-4935-ae4f-5400e336fd07"),
OnCategoryChanged = false,
OnDownloadCleaned = false,
OnFailedImportStrike = false,
OnQueueItemDeleted = false,
OnSlowStrike = false,
OnStalledStrike = false
});
});
modelBuilder.Entity("Common.Configuration.Notification.NotifiarrConfig", b =>
@@ -481,18 +414,6 @@ namespace Data.Migrations.Data
.HasName("pk_notifiarr_configs");
b.ToTable("notifiarr_configs", (string)null);
b.HasData(
new
{
Id = new Guid("dd468589-e5ee-4e1b-b05e-28b461894846"),
OnCategoryChanged = false,
OnDownloadCleaned = false,
OnFailedImportStrike = false,
OnQueueItemDeleted = false,
OnSlowStrike = false,
OnStalledStrike = false
});
});
modelBuilder.Entity("Common.Configuration.QueueCleaner.QueueCleanerConfig", b =>

View File

@@ -32,6 +32,9 @@ builder.Logging.AddLogging();
var app = builder.Build();
// Initialize the host
await app.Init();
// Get LoggingConfigManager (will be created if not already registered)
var configManager = app.Services.GetRequiredService<LoggingConfigManager>();
@@ -52,7 +55,4 @@ Log.Logger = logConfig.CreateLogger();
// Configure the HTTP request pipeline
app.ConfigureApi();
// Initialize the host
await app.Init();
await app.RunAsync();