diff options
| author | Bond-009 <bond.009@outlook.com> | 2020-02-12 17:41:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-12 17:41:46 +0100 |
| commit | a2490a7ae5c636d97085a0e950fbbe1a027bfdb0 (patch) | |
| tree | 985eee14b4ed220cc090fb34f17a5129708dbf13 /Jellyfin.Server/Program.cs | |
| parent | ddf9b38799fa4a0e227ae3c2516a72ec48f13854 (diff) | |
| parent | e241f83ff12aa2231443b78d39d1db2646aebdf9 (diff) | |
Merge branch 'master' into images
Diffstat (limited to 'Jellyfin.Server/Program.cs')
| -rw-r--r-- | Jellyfin.Server/Program.cs | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index c0621ba14..1dd598236 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -4,7 +4,6 @@ using System.Globalization; using System.IO; using System.Linq; using System.Net; -using System.Net.Security; using System.Reflection; using System.Runtime.InteropServices; using System.Text; @@ -236,7 +235,7 @@ namespace Jellyfin.Server { foreach (var address in addresses) { - _logger.LogInformation("Kestrel listening on {ipaddr}", address); + _logger.LogInformation("Kestrel listening on {IpAddress}", address); options.Listen(address, appHost.HttpPort); if (appHost.EnableHttps && appHost.Certificate != null) @@ -441,20 +440,18 @@ namespace Jellyfin.Server if (!File.Exists(configPath)) { // For some reason the csproj name is used instead of the assembly name - using (Stream? resource = typeof(Program).Assembly.GetManifestResourceStream(ResourcePath)) + await using Stream? resource = typeof(Program).Assembly.GetManifestResourceStream(ResourcePath); + if (resource == null) { - if (resource == null) - { - throw new InvalidOperationException( - string.Format( - CultureInfo.InvariantCulture, - "Invalid resource path: '{0}'", - ResourcePath)); - } - - using Stream dst = File.Open(configPath, FileMode.CreateNew); - await resource.CopyToAsync(dst).ConfigureAwait(false); + throw new InvalidOperationException( + string.Format( + CultureInfo.InvariantCulture, + "Invalid resource path: '{0}'", + ResourcePath)); } + + await using Stream dst = File.Open(configPath, FileMode.CreateNew); + await resource.CopyToAsync(dst).ConfigureAwait(false); } return new ConfigurationBuilder() @@ -483,7 +480,7 @@ namespace Jellyfin.Server .WriteTo.Async(x => x.File( Path.Combine(appPaths.LogDirectoryPath, "log_.log"), rollingInterval: RollingInterval.Day, - outputTemplate: "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] [{ThreadId}] {SourceContext}:{Message}{NewLine}{Exception}")) + outputTemplate: "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] [{ThreadId}] {SourceContext}: {Message}{NewLine}{Exception}")) .Enrich.FromLogContext() .Enrich.WithThreadId() .CreateLogger(); |
