From 0eb44818ff02d78f967edecd6dbffd9921d0b991 Mon Sep 17 00:00:00 2001 From: Wendell Jones Date: Wed, 4 Mar 2026 17:23:58 -0500 Subject: [PATCH] Update config file logic and unify webDir path to wwwroot - Prevent overwriting existing config files by only copying example files if the target does not exist. - Set webDir to "wwwroot" for all OSes for consistency. - Update last used publish profile to SelfContained-Win-x64. --- .../AppBase/BaseConfigurationManager.cs | 2 +- Jellyfin.Server/Helpers/StartupHelpers.cs | 6 +++--- Jellyfin.Server/Jellyfin.Server.csproj.user | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs index 1ae66fc5..e8968dc4 100644 --- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs +++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs @@ -338,7 +338,7 @@ namespace Emby.Server.Implementations.AppBase } // Copy example to actual file only if example was just created or if we want to initialize from example - if (exampleFileJustCreated) + if (exampleFileJustCreated && !File.Exists(path)) { File.Copy(examplePath, path, overwrite: false); Logger.LogInformation("Created configuration file from example: {Path}", path); diff --git a/Jellyfin.Server/Helpers/StartupHelpers.cs b/Jellyfin.Server/Helpers/StartupHelpers.cs index cd64aa75..b754195b 100644 --- a/Jellyfin.Server/Helpers/StartupHelpers.cs +++ b/Jellyfin.Server/Helpers/StartupHelpers.cs @@ -138,7 +138,7 @@ public static class StartupHelpers cacheDir = "C:/ProgramData/jellyfin/cache"; logDir = "C:/ProgramData/jellyfin/log"; tempDir = Path.Combine(Path.GetTempPath(), "jellyfin"); - webDir = "C:/ProgramData/jellyfin/wwwroot"; + webDir = "wwwroot"; osComment = "Windows defaults - using C:/ProgramData/jellyfin"; } else if (OperatingSystem.IsLinux()) @@ -149,7 +149,7 @@ public static class StartupHelpers cacheDir = "/var/cache/jellyfin"; logDir = "/var/log/jellyfin"; tempDir = "/var/tmp/jellyfin"; - webDir = "/usr/share/jellyfin/wwwroot"; + webDir = "wwwroot"; osComment = "Linux defaults - following Filesystem Hierarchy Standard (FHS)"; } else if (OperatingSystem.IsMacOS()) @@ -161,7 +161,7 @@ public static class StartupHelpers cacheDir = Path.Combine(homeDir, "Library", "Caches", "jellyfin"); logDir = Path.Combine(homeDir, "Library", "Logs", "jellyfin"); tempDir = Path.Combine(Path.GetTempPath(), "jellyfin"); - webDir = Path.Combine(homeDir, "Library", "Application Support", "jellyfin", "wwwroot"); + webDir = "wwwroot"; osComment = "macOS defaults - using user Library paths"; } else diff --git a/Jellyfin.Server/Jellyfin.Server.csproj.user b/Jellyfin.Server/Jellyfin.Server.csproj.user index a8c73ec9..bd1700e6 100644 --- a/Jellyfin.Server/Jellyfin.Server.csproj.user +++ b/Jellyfin.Server/Jellyfin.Server.csproj.user @@ -1,6 +1,6 @@  - D:\Projects\pgsql-jellyfin\Jellyfin.Server\Properties\PublishProfiles\FolderProfile.pubxml + D:\Projects\pgsql-jellyfin\Jellyfin.Server\Properties\PublishProfiles\SelfContained-Win-x64.pubxml \ No newline at end of file