Added Version string to application name connection for pgsql

This commit is contained in:
JPVenson 2025-02-03 20:20:37 +00:00
parent df8f352d65
commit 078587d232

View File

@ -1,4 +1,6 @@
using System; using System;
using System.Diagnostics;
using System.Reflection;
using Jellyfin.Server.Implementations; using Jellyfin.Server.Implementations;
using Jellyfin.Server.Implementations.DatabaseConfiguration; using Jellyfin.Server.Implementations.DatabaseConfiguration;
using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Configuration;
@ -42,7 +44,7 @@ public sealed class PgSqlDatabaseProvider : IJellyfinDatabaseProvider
} }
var connectionBuilder = new NpgsqlConnectionStringBuilder(); var connectionBuilder = new NpgsqlConnectionStringBuilder();
connectionBuilder.ApplicationName = "jellyfin"; connectionBuilder.ApplicationName = $"jellyfin+{FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly()!.Location).FileVersion}";
connectionBuilder.CommandTimeout = dbSettings.PostgreSql.Timeout; connectionBuilder.CommandTimeout = dbSettings.PostgreSql.Timeout;
connectionBuilder.Database = dbSettings.PostgreSql.DatabaseName; connectionBuilder.Database = dbSettings.PostgreSql.DatabaseName;
connectionBuilder.Username = dbSettings.PostgreSql.Username; connectionBuilder.Username = dbSettings.PostgreSql.Username;