Merge branch 'dev' into reformat

This commit is contained in:
Erwin de Haan 2019-01-13 21:59:37 +01:00 committed by GitHub
commit 9d0a08571e
6 changed files with 40 additions and 22 deletions

View File

@ -15,7 +15,10 @@ WORKDIR /repo
COPY . . COPY . .
RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \ RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \
&& dotnet clean \ && dotnet clean \
&& dotnet publish --configuration release --output /jellyfin && dotnet publish \
--configuration release \
--output /jellyfin \
Jellyfin.Server
FROM microsoft/dotnet:${DOTNET_VERSION}-runtime FROM microsoft/dotnet:${DOTNET_VERSION}-runtime

View File

@ -6,7 +6,10 @@ COPY . .
RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \ RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \
&& find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \; \ && find . -type f -exec sed -i 's/netcoreapp2.1/netcoreapp3.0/g' {} \; \
&& dotnet clean \ && dotnet clean \
&& dotnet publish --configuration release --output /jellyfin && dotnet publish \
--configuration release \
--output /jellyfin \
Jellyfin.Server
FROM microsoft/dotnet:${DOTNET_VERSION}-runtime FROM microsoft/dotnet:${DOTNET_VERSION}-runtime
COPY --from=builder /jellyfin /jellyfin COPY --from=builder /jellyfin /jellyfin

View File

@ -48,12 +48,13 @@ namespace Emby.Drawing.Common
/// <exception cref="ArgumentException">The image was of an unrecognised format.</exception> /// <exception cref="ArgumentException">The image was of an unrecognised format.</exception>
public static ImageSize GetDimensions(string path, ILogger logger, IFileSystem fileSystem) public static ImageSize GetDimensions(string path, ILogger logger, IFileSystem fileSystem)
{ {
var extension = Path.GetExtension(path); if (string.IsNullOrEmpty(path))
if (string.IsNullOrEmpty(extension))
{ {
throw new ArgumentException("ImageHeader doesn't support image file"); throw new ArgumentNullException(nameof(path));
} }
string extension = Path.GetExtension(path).ToLower();
if (!SupportedExtensions.Contains(extension)) if (!SupportedExtensions.Contains(extension))
{ {
throw new ArgumentException("ImageHeader doesn't support " + extension); throw new ArgumentException("ImageHeader doesn't support " + extension);

View File

@ -156,7 +156,7 @@ namespace Emby.Server.Implementations.IO
continue; continue;
} }
Logger.LogInformation("{name} ({path}}) will be refreshed.", item.Name, item.Path); Logger.LogInformation("{name} ({path}) will be refreshed.", item.Name, item.Path);
try try
{ {

View File

@ -20,19 +20,26 @@
<EmbeddedResource Include="Resources/Configuration/*" /> <EmbeddedResource Include="Resources/Configuration/*" />
</ItemGroup> </ItemGroup>
<ItemGroup> <!-- Code analysers-->
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.2.0" /> <ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" /> <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.3" />
<PackageReference Include="Serilog.AspNetCore" Version="2.1.1" /> <PackageReference Include="StyleCop.Analyzers" Version="1.0.2" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.0.1" /> <PackageReference Include="SerilogAnalyzer" Version="0.15.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.3.0" /> </ItemGroup>
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" /> <ItemGroup>
<PackageReference Include="SkiaSharp" Version="1.68.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.2.0" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="1.1.12" /> <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
<PackageReference Include="SQLitePCLRaw.core" Version="1.1.12" /> <PackageReference Include="Serilog.AspNetCore" Version="2.1.1" />
<PackageReference Include="SQLitePCLRaw.provider.sqlite3.netstandard11" Version="1.1.12" /> <PackageReference Include="Serilog.Settings.Configuration" Version="3.0.1" />
</ItemGroup> <PackageReference Include="Serilog.Sinks.Async" Version="1.3.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Serilog.Sinks.File" Version="4.0.0" />
<PackageReference Include="SkiaSharp" Version="1.68.0" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="1.1.12" />
<PackageReference Include="SQLitePCLRaw.core" Version="1.1.12" />
<PackageReference Include="SQLitePCLRaw.provider.sqlite3.netstandard11" Version="1.1.12" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Emby.Drawing\Emby.Drawing.csproj" /> <ProjectReference Include="..\Emby.Drawing\Emby.Drawing.csproj" />

View File

@ -1,8 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Net.Sockets;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -126,6 +126,10 @@ namespace Rssdp.Infrastructure
{ {
_BroadcastListenSocket = ListenForBroadcastsAsync(); _BroadcastListenSocket = ListenForBroadcastsAsync();
} }
catch (SocketException ex)
{
_logger.LogError("Failed to bind to port 1900: {Message}. DLNA will be unavailable", ex.Message);
}
catch (Exception ex) catch (Exception ex)
{ {
_logger.LogError(ex, "Error in BeginListeningForBroadcasts"); _logger.LogError(ex, "Error in BeginListeningForBroadcasts");
@ -145,7 +149,7 @@ namespace Rssdp.Infrastructure
{ {
if (_BroadcastListenSocket != null) if (_BroadcastListenSocket != null)
{ {
_logger.LogInformation("{0} disposing _BroadcastListenSocket.", GetType().Name); _logger.LogInformation("{0} disposing _BroadcastListenSocket", GetType().Name);
_BroadcastListenSocket.Dispose(); _BroadcastListenSocket.Dispose();
_BroadcastListenSocket = null; _BroadcastListenSocket = null;
} }