Fixed postgres sql provider

This commit is contained in:
JPVenson 2025-01-27 18:21:47 +00:00
parent 433640d985
commit ce00bc076e
7 changed files with 9 additions and 19 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "Development Jellyfin Server", "name": "Development Jellyfin Server",
"image":"mcr.microsoft.com/devcontainers/dotnet:9.0-bookworm", "image": "mcr.microsoft.com/devcontainers/dotnet:9.0-bookworm",
// restores nuget packages, installs the dotnet workloads and installs the dev https certificate // restores nuget packages, installs the dotnet workloads and installs the dev https certificate
"postStartCommand": "sudo dotnet restore; sudo dotnet workload update; sudo dotnet dev-certs https --trust; sudo bash \"./.devcontainer/install-ffmpeg.sh\"", "postStartCommand": "sudo dotnet restore; sudo dotnet workload update; sudo dotnet dev-certs https --trust; sudo bash \"./.devcontainer/install-ffmpeg.sh\"",
// reads the extensions list and installs them // reads the extensions list and installs them
@ -13,7 +13,9 @@
}, },
"ghcr.io/devcontainers-contrib/features/apt-packages:1": { "ghcr.io/devcontainers-contrib/features/apt-packages:1": {
"preserve_apt_list": false, "preserve_apt_list": false,
"packages": ["libfontconfig1"] "packages": [
"libfontconfig1"
]
}, },
"ghcr.io/devcontainers/features/docker-in-docker:2": { "ghcr.io/devcontainers/features/docker-in-docker:2": {
"dockerDashComposeVersion": "v2" "dockerDashComposeVersion": "v2"
@ -24,19 +26,5 @@
"hostRequirements": { "hostRequirements": {
"memory": "8gb", "memory": "8gb",
"cpus": 4 "cpus": 4
}, "remoteEnv": {
"JELLYFIN_DATA_DIR": "/config"
},
"mounts": [
"source=/opt/docker/data/jellyfin/testConfig/,target=/config,type=bind,consistency=cached",
"source=/opt/docker/data/jellyfin/config10.9.11/metadata,target=/config/metadata,type=bind,consistency=cached",
"source=/mnt/video,target=/media,type=bind,consistency=cached"
],
"customizations": {
"vscode": {
"extensions": [
"alexcvzz.vscode-sqlite"
]
}
} }
} }

View File

@ -45,7 +45,6 @@
<ProjectReference Include="..\..\Jellyfin.Data\Jellyfin.Data.csproj" /> <ProjectReference Include="..\..\Jellyfin.Data\Jellyfin.Data.csproj" />
<ProjectReference Include="..\..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" /> <ProjectReference Include="..\..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />
<ProjectReference Include="..\..\MediaBrowser.Model\MediaBrowser.Model.csproj" /> <ProjectReference Include="..\..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
<ProjectReference Include="..\..\Jellyfin.Server.Implementations\Jellyfin.Server.Implementations.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,4 +1,3 @@
using Jellyfin.Database.Providers.SqLite;
using Jellyfin.Server.Implementations; using Jellyfin.Server.Implementations;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design; using Microsoft.EntityFrameworkCore.Design;
@ -20,7 +19,7 @@ namespace Jellyfin.Database.Providers.PgSql
return new JellyfinDbContext( return new JellyfinDbContext(
optionsBuilder.Options, optionsBuilder.Options,
NullLogger<JellyfinDbContext>.Instance, NullLogger<JellyfinDbContext>.Instance,
new SqliteDatabaseProvider(null!, NullLogger<SqliteDatabaseProvider>.Instance)); new PgSqlDatabaseProvider(null!, NullLogger<PgSqlDatabaseProvider>.Instance));
} }
} }
} }

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using Jellyfin.Database.Providers.PgSql;
using Jellyfin.Database.Providers.SqLite; using Jellyfin.Database.Providers.SqLite;
using Jellyfin.Server.Implementations.DatabaseConfiguration; using Jellyfin.Server.Implementations.DatabaseConfiguration;
using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Configuration;
@ -22,6 +23,7 @@ public static class ServiceCollectionExtensions
private static IEnumerable<Type> DatabaseProviderTypes() private static IEnumerable<Type> DatabaseProviderTypes()
{ {
yield return typeof(SqliteDatabaseProvider); yield return typeof(SqliteDatabaseProvider);
yield return typeof(PgSqlDatabaseProvider);
} }
private static IDictionary<string, JellyfinDbProviderFactory> GetSupportedDbProviders() private static IDictionary<string, JellyfinDbProviderFactory> GetSupportedDbProviders()
@ -75,6 +77,7 @@ public static class ServiceCollectionExtensions
{ {
DatabaseType = "Jellyfin-SqLite", DatabaseType = "Jellyfin-SqLite",
}; };
configurationManager.SaveConfiguration("database", efCoreConfiguration);
} }
} }

View File

@ -37,6 +37,7 @@
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" /> <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
<ProjectReference Include="..\Jellyfin.Database\Jellyfin.Database.Implementations\Jellyfin.Database.Implementations.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.SqLite\Jellyfin.Database.Providers.SqLite.csproj" />
<ProjectReference Include="..\Jellyfin.Database\Jellyfin.Database.Providers.PgSql\Jellyfin.Database.Providers.PgSql.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>