aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Program.cs
diff options
context:
space:
mode:
authorartiume <siderite@gmail.com>2020-02-04 06:02:38 -0500
committerGitHub <noreply@github.com>2020-02-04 06:02:38 -0500
commit3b6a4c3a33956eb54a0168f461b0279c4d3c1719 (patch)
tree745336d36a86e689d06250f8867d809a937d24aa /Jellyfin.Server/Program.cs
parentd4470b5709eaddae12c0096634bd47d7f9ec0b97 (diff)
parent176e8509739ffd3d7002c94adbd814c33b5172e2 (diff)
Merge pull request #11 from jellyfin/master
nightly
Diffstat (limited to 'Jellyfin.Server/Program.cs')
-rw-r--r--Jellyfin.Server/Program.cs25
1 files changed, 11 insertions, 14 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index 2638d5bfa..1b4280d82 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;
@@ -238,7 +237,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)
@@ -443,20 +442,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()