From 963f2357a966dd7a5a6ab248155cc52ce066753b Mon Sep 17 00:00:00 2001 From: JPVenson Date: Fri, 21 Feb 2025 11:06:28 +0000 Subject: [PATCH] simplified logfile path --- Jellyfin.Server/ServerSetupApp/SetupServer.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Jellyfin.Server/ServerSetupApp/SetupServer.cs b/Jellyfin.Server/ServerSetupApp/SetupServer.cs index 09b7434eff..9e2cf5bc8b 100644 --- a/Jellyfin.Server/ServerSetupApp/SetupServer.cs +++ b/Jellyfin.Server/ServerSetupApp/SetupServer.cs @@ -64,10 +64,14 @@ public sealed class SetupServer : IDisposable return; } - var logfilePath = Directory.EnumerateFiles(applicationPaths.LogDirectoryPath).Select(e => new FileInfo(e)).OrderBy(f => f.CreationTimeUtc).FirstOrDefault()?.FullName; - if (logfilePath is not null) + var logFilePath = new DirectoryInfo(applicationPaths.LogDirectoryPath) + .EnumerateFiles() + .OrderBy(f => f.CreationTimeUtc) + .FirstOrDefault() + ?.FullName; + if (logFilePath is not null) { - await context.Response.SendFileAsync(logfilePath, CancellationToken.None).ConfigureAwait(false); + await context.Response.SendFileAsync(logFilePath, CancellationToken.None).ConfigureAwait(false); } }); });