浏览代码

simplified logfile path

JPVenson 3 月之前
父节点
当前提交
963f2357a9
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 7 3
      Jellyfin.Server/ServerSetupApp/SetupServer.cs

+ 7 - 3
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);
                                             }
                                         });
                                     });