aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2025-01-27 18:21:47 +0000
committerJPVenson <github@jpb.email>2025-01-27 18:21:47 +0000
commitce00bc076e9a97197e7e7e83276013518ce84ec5 (patch)
treec8f4ca5cb439d0c739aa84e16b45a57473fafb19 /Jellyfin.Server.Implementations
parent433640d98534667602bfaac08ce7cdb600a8377b (diff)
Fixed postgres sql provider
Diffstat (limited to 'Jellyfin.Server.Implementations')
-rw-r--r--Jellyfin.Server.Implementations/DbConfiguration/DatabaseConfigurationOptions.cs19
-rw-r--r--Jellyfin.Server.Implementations/DbConfiguration/PostgreSqlOptions.cs39
-rw-r--r--Jellyfin.Server.Implementations/Extensions/ServiceCollectionExtensions.cs3
-rw-r--r--Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj1
4 files changed, 4 insertions, 58 deletions
diff --git a/Jellyfin.Server.Implementations/DbConfiguration/DatabaseConfigurationOptions.cs b/Jellyfin.Server.Implementations/DbConfiguration/DatabaseConfigurationOptions.cs
deleted file mode 100644
index d49d8536a..000000000
--- a/Jellyfin.Server.Implementations/DbConfiguration/DatabaseConfigurationOptions.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-
-namespace Jellyfin.Server.Implementations.DatabaseConfiguration;
-
-/// <summary>
-/// Options to configure jellyfins managed database.
-/// </summary>
-public class DatabaseConfigurationOptions
-{
- /// <summary>
- /// Gets or Sets the type of database jellyfin should use.
- /// </summary>
- public required string DatabaseType { get; set; }
-
- /// <summary>
- /// Gets or Sets the settings to run jellyfin with Postgres.
- /// </summary>
- public PostgreSqlOptions? PostgreSql { get; set; }
-}
diff --git a/Jellyfin.Server.Implementations/DbConfiguration/PostgreSqlOptions.cs b/Jellyfin.Server.Implementations/DbConfiguration/PostgreSqlOptions.cs
deleted file mode 100644
index 1f7c30b09..000000000
--- a/Jellyfin.Server.Implementations/DbConfiguration/PostgreSqlOptions.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-
-namespace Jellyfin.Server.Implementations.DatabaseConfiguration;
-
-/// <summary>
-/// Options specific to run jellyfin on a postgreSql database.
-/// </summary>
-public class PostgreSqlOptions
-{
- /// <summary>
- /// Gets or Sets the Port. Defaults to 5432.
- /// </summary>
- public required int Port { get; set; } = 5432;
-
- /// <summary>
- /// Gets or Sets the Server name.
- /// </summary>
- public required string ServerName { get; set; }
-
- /// <summary>
- /// Gets or Sets the username.
- /// </summary>
- public required string Username { get; set; }
-
- /// <summary>
- /// Gets or Sets the password.
- /// </summary>
- public required string Password { get; set; }
-
- /// <summary>
- /// Gets or Sets the database name. Defaults to "Jellyfin".
- /// </summary>
- public string DatabaseName { get; set; } = "Jellyfin";
-
- /// <summary>
- /// Gets or Sets the timeout in secounds before a running command is terminated. Defaults to 30.
- /// </summary>
- public int Timeout { get; set; } = 30;
-}
diff --git a/Jellyfin.Server.Implementations/Extensions/ServiceCollectionExtensions.cs b/Jellyfin.Server.Implementations/Extensions/ServiceCollectionExtensions.cs
index 091ecee98..7936c6fd9 100644
--- a/Jellyfin.Server.Implementations/Extensions/ServiceCollectionExtensions.cs
+++ b/Jellyfin.Server.Implementations/Extensions/ServiceCollectionExtensions.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
+using Jellyfin.Database.Providers.PgSql;
using Jellyfin.Database.Providers.SqLite;
using Jellyfin.Server.Implementations.DatabaseConfiguration;
using MediaBrowser.Common.Configuration;
@@ -22,6 +23,7 @@ public static class ServiceCollectionExtensions
private static IEnumerable<Type> DatabaseProviderTypes()
{
yield return typeof(SqliteDatabaseProvider);
+ yield return typeof(PgSqlDatabaseProvider);
}
private static IDictionary<string, JellyfinDbProviderFactory> GetSupportedDbProviders()
@@ -75,6 +77,7 @@ public static class ServiceCollectionExtensions
{
DatabaseType = "Jellyfin-SqLite",
};
+ configurationManager.SaveConfiguration("database", efCoreConfiguration);
}
}
diff --git a/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj b/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj
index b566b3489..01d9dcf64 100644
--- a/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj
+++ b/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj
@@ -37,6 +37,7 @@
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
<ProjectReference Include="..\Jellyfin.Database\Jellyfin.Database.Implementations\Jellyfin.Database.Implementations.csproj" />
<ProjectReference Include="..\Jellyfin.Database\Jellyfin.Database.Providers.SqLite\Jellyfin.Database.Providers.SqLite.csproj" />
+ <ProjectReference Include="..\Jellyfin.Database\Jellyfin.Database.Providers.PgSql\Jellyfin.Database.Providers.PgSql.csproj" />
</ItemGroup>
</Project>