From 783e74d9c9fd212497c40a5f9678552d85c9512c Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Sat, 12 Jan 2019 22:25:55 +0100 Subject: [PATCH 1/7] Don't print stacktrace when failing to bind to 1900 --- RSSDP/SsdpCommunicationsServer.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.cs index e2e5c4e9f..c64b6d02f 100644 --- a/RSSDP/SsdpCommunicationsServer.cs +++ b/RSSDP/SsdpCommunicationsServer.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Net; using System.Net.Http; +using System.Net.Sockets; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -126,6 +126,10 @@ namespace Rssdp.Infrastructure { _BroadcastListenSocket = ListenForBroadcastsAsync(); } + catch (SocketException) + { + _logger.LogError("Failed to bind to port 1900. DLNA will be unavailable"); + } catch (Exception ex) { _logger.LogError(ex, "Error in BeginListeningForBroadcasts"); @@ -145,7 +149,7 @@ namespace Rssdp.Infrastructure { if (_BroadcastListenSocket != null) { - _logger.LogInformation("{0} disposing _BroadcastListenSocket.", GetType().Name); + _logger.LogInformation("{0} disposing _BroadcastListenSocket", GetType().Name); _BroadcastListenSocket.Dispose(); _BroadcastListenSocket = null; } From 81475e361b1665f895027feec9b4c0a4553f22dc Mon Sep 17 00:00:00 2001 From: Bond-009 Date: Sun, 13 Jan 2019 01:30:43 +0100 Subject: [PATCH 2/7] Add exception message to log. Output will be something line: `Failed to bind to port 1900: Address already in use. DLNA will be unavailable` --- RSSDP/SsdpCommunicationsServer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.cs index c64b6d02f..2255ef35a 100644 --- a/RSSDP/SsdpCommunicationsServer.cs +++ b/RSSDP/SsdpCommunicationsServer.cs @@ -126,9 +126,9 @@ namespace Rssdp.Infrastructure { _BroadcastListenSocket = ListenForBroadcastsAsync(); } - catch (SocketException) + catch (SocketException ex) { - _logger.LogError("Failed to bind to port 1900. DLNA will be unavailable"); + _logger.LogError("Failed to bind to port 1900: {Message}. DLNA will be unavailable", ex.Message); } catch (Exception ex) { From f2dae8ee519904116cd11381eee518ce55db4373 Mon Sep 17 00:00:00 2001 From: hawken Date: Sat, 12 Jan 2019 12:45:14 +0000 Subject: [PATCH 3/7] Make image header extension matching case insensitive --- Emby.Drawing/Common/ImageHeader.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Emby.Drawing/Common/ImageHeader.cs b/Emby.Drawing/Common/ImageHeader.cs index f37f396f5..844c966bb 100644 --- a/Emby.Drawing/Common/ImageHeader.cs +++ b/Emby.Drawing/Common/ImageHeader.cs @@ -50,12 +50,13 @@ namespace Emby.Drawing.Common /// The image was of an unrecognised format. public static ImageSize GetDimensions(string path, ILogger logger, IFileSystem fileSystem) { - var extension = Path.GetExtension(path); - - if (string.IsNullOrEmpty(extension)) + if (string.IsNullOrEmpty(path)) { - throw new ArgumentException("ImageHeader doesn't support image file"); + throw new ArgumentNullException(nameof(path)); } + + string extension = Path.GetExtension(path).ToLower(); + if (!SupportedExtensions.Contains(extension)) { throw new ArgumentException("ImageHeader doesn't support " + extension); From c8e3c1737aaceac39bc532ffb27066a18019e936 Mon Sep 17 00:00:00 2001 From: hawken Date: Sat, 12 Jan 2019 12:45:47 +0000 Subject: [PATCH 4/7] Fix small logging typo with the "name (path) will be refreshed" message --- Emby.Server.Implementations/IO/FileRefresher.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/IO/FileRefresher.cs b/Emby.Server.Implementations/IO/FileRefresher.cs index 3212c41e9..0ddd3030f 100644 --- a/Emby.Server.Implementations/IO/FileRefresher.cs +++ b/Emby.Server.Implementations/IO/FileRefresher.cs @@ -156,7 +156,7 @@ namespace Emby.Server.Implementations.IO continue; } - Logger.LogInformation("{name} ({path}}) will be refreshed.", item.Name, item.Path); + Logger.LogInformation("{name} ({path}) will be refreshed.", item.Name, item.Path); try { From 56de8c893ab23348a6f972bd216a931020f8d8e0 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Sun, 13 Jan 2019 19:16:22 +0100 Subject: [PATCH 5/7] Add code analysers for debug builds --- Jellyfin.Server/Jellyfin.Server.csproj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj index 98c578e83..e7358e6a1 100644 --- a/Jellyfin.Server/Jellyfin.Server.csproj +++ b/Jellyfin.Server/Jellyfin.Server.csproj @@ -20,6 +20,13 @@ + + + + + + + From f11a4368bb3d12e6c1b910b2f9e356a2d009106d Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Sun, 13 Jan 2019 15:30:30 -0500 Subject: [PATCH 6/7] Reformat args --- Dockerfile | 4 +++- Dockerfile.aarch64 | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 75700e6f5..ce035fb7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,9 @@ WORKDIR /repo COPY . . RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \ && dotnet clean \ - && dotnet publish --configuration release --output /jellyfin + && dotnet publish \ + --configuration release \ + --output /jellyfin FROM microsoft/dotnet:${DOTNET_VERSION}-runtime diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index da4acc841..ba7b0c5c5 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -6,7 +6,9 @@ COPY . . RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \ && find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \; \ && dotnet clean \ - && dotnet publish --configuration release --output /jellyfin + && dotnet publish \ + --configuration release \ + --output /jellyfin FROM microsoft/dotnet:${DOTNET_VERSION}-runtime COPY --from=builder /jellyfin /jellyfin From 17c60f46dbe88adc6fa465027b961de014dcd94f Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Sun, 13 Jan 2019 15:30:54 -0500 Subject: [PATCH 7/7] Fix build --- Dockerfile | 3 ++- Dockerfile.aarch64 | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ce035fb7f..e4cbede80 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,8 @@ RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \ && dotnet clean \ && dotnet publish \ --configuration release \ - --output /jellyfin + --output /jellyfin \ + Jellyfin.Server FROM microsoft/dotnet:${DOTNET_VERSION}-runtime diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index ba7b0c5c5..cc70ef32f 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -8,7 +8,8 @@ RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \ && dotnet clean \ && dotnet publish \ --configuration release \ - --output /jellyfin + --output /jellyfin \ + Jellyfin.Server FROM microsoft/dotnet:${DOTNET_VERSION}-runtime COPY --from=builder /jellyfin /jellyfin