Add PostgreSQL provider and code cleanup

Added Jellyfin.Database.Providers.Postgres project and integrated Npgsql packages for PostgreSQL support. Updated solution and test project references. Refactored code for clarity and performance, including improved string handling, log formatting, and plugin management. Enhanced .editorconfig rules and fixed minor test issues. Added publishing profiles and updated web server setup references. Cleaned up assembly info and cache files.
Now able to successfully build solution
This commit is contained in:
2026-02-22 16:15:19 -05:00
parent d1e6fbc122
commit f8b7c62f9e
58 changed files with 2563 additions and 122 deletions
@@ -19,7 +19,6 @@ using Jellyfin.Extensions;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Extensions;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Playlists;
using MediaBrowser.Controller.Providers;
@@ -65,7 +64,7 @@ namespace Emby.Server.Implementations.Playlists
public Playlist GetPlaylistForUser(Guid playlistId, Guid userId)
{
return GetPlaylists(userId).Where(p => p.Id.Equals(playlistId)).FirstOrDefault();
return GetPlaylists(userId).FirstOrDefault(p => p.Id.Equals(playlistId));
}
public IEnumerable<Playlist> GetPlaylists(Guid userId)
@@ -548,7 +547,7 @@ namespace Emby.Server.Implementations.Playlists
ArgumentException.ThrowIfNullOrEmpty(folderPath);
ArgumentException.ThrowIfNullOrEmpty(fileAbsolutePath);
if (!folderPath.EndsWith(Path.DirectorySeparatorChar))
if (!folderPath.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal))
{
folderPath += Path.DirectorySeparatorChar;
}
@@ -47,8 +47,6 @@ namespace Emby.Server.Implementations.Plugins
private readonly List<LocalPlugin> _plugins;
private readonly Version _minimumVersion;
private IHttpClientFactory? _httpClientFactory;
/// <summary>
/// Initializes a new instance of the <see cref="PluginManager"/> class.
/// </summary>
@@ -92,10 +90,7 @@ namespace Emby.Server.Implementations.Plugins
private IHttpClientFactory HttpClientFactory
{
get
{
return _httpClientFactory ??= _appHost.Resolve<IHttpClientFactory>();
}
get => field ??= _appHost.Resolve<IHttpClientFactory>();
}
/// <summary>
@@ -125,7 +120,7 @@ namespace Emby.Server.Implementations.Plugins
{
UpdatePluginSupersededStatus(plugin);
if (plugin.IsEnabledAndSupported == false)
if (!plugin.IsEnabledAndSupported)
{
_logger.LogInformation("Skipping disabled plugin {Version} of {Name} ", plugin.Version, plugin.Name);
continue;
@@ -698,7 +693,7 @@ namespace Emby.Server.Implementations.Plugins
targetAbi = _minimumVersion;
}
if (!Version.TryParse(manifest.Version, out version))
if (!Version.TryParse(manifest.Version, out _))
{
manifest.Version = _minimumVersion.ToString();
}
@@ -710,7 +705,7 @@ namespace Emby.Server.Implementations.Plugins
// No metafile, so lets see if the folder is versioned.
// TODO: Phase this support out in future versions.
metafile = dir.Split(Path.DirectorySeparatorChar, StringSplitOptions.RemoveEmptyEntries)[^1];
int versionIndex = dir.LastIndexOf('_');
int versionIndex = dir.LastIndexOf("_", StringComparison.Ordinal);
if (versionIndex != -1)
{
// Get the version number from the filename if possible.