Skip to content

Commit

Permalink
Merge pull request #2815 from MediaBrowser/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
LukePulverenti authored Aug 13, 2017
2 parents 2658c55 + 4ef0ebf commit 009a3a4
Show file tree
Hide file tree
Showing 806 changed files with 4,491 additions and 25,648 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.11\lib\net45\NLog.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="ServiceStack.Text, Version=4.5.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ServiceStack.Text.4.5.8\lib\net45\ServiceStack.Text.dll</HintPath>
Expand Down
14 changes: 12 additions & 2 deletions Emby.Common.Implementations/Logging/NlogManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,23 @@ private void AddFileTarget(string path, LogSeverity level)

RemoveTarget("ApplicationLogFileWrapper");

var wrapper = new AsyncTargetWrapper();
// https://github.com/NLog/NLog/wiki/Performance
var wrapper = new AsyncTargetWrapper
{
OverflowAction = AsyncTargetWrapperOverflowAction.Block,
QueueLimit = 10000,
BatchSize = 500,
TimeToSleepBetweenBatches = 50
};

wrapper.Name = "ApplicationLogFileWrapper";

var logFile = new FileTarget
{
FileName = path,
Layout = "${longdate} ${level} ${logger}: ${message}"
Layout = "${longdate} ${level} ${logger}: ${message}",
KeepFileOpen = true,
ConcurrentWrites = false
};

logFile.Name = "ApplicationLogFile";
Expand Down
4 changes: 0 additions & 4 deletions Emby.Common.Implementations/Net/UdpSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public Socket Socket
private TaskCompletionSource<SocketReceiveResult> _currentReceiveTaskCompletionSource;
private TaskCompletionSource<int> _currentSendTaskCompletionSource;

private readonly SemaphoreSlim _sendLock = new SemaphoreSlim(1, 1);

public UdpSocket(Socket socket, int localPort, IPAddress ip)
{
if (socket == null) throw new ArgumentNullException("socket");
Expand Down Expand Up @@ -234,8 +232,6 @@ protected override void Dispose(bool disposing)
if (socket != null)
socket.Dispose();

_sendLock.Dispose();

var tcs = _currentReceiveTaskCompletionSource;
if (tcs != null)
{
Expand Down
2 changes: 1 addition & 1 deletion Emby.Common.Implementations/Networking/NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ public static IpAddressInfo ToIpAddressInfo(IPAddress address)
public async Task<IpAddressInfo[]> GetHostAddressesAsync(string host)
{
var addresses = await Dns.GetHostAddressesAsync(host).ConfigureAwait(false);
return addresses.Select(ToIpAddressInfo).ToArray();
return addresses.Select(ToIpAddressInfo).ToArray(addresses.Length);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.System;
using MediaBrowser.Model.Tasks;
using MediaBrowser.Model.Extensions;

namespace Emby.Common.Implementations.ScheduledTasks
{
Expand Down Expand Up @@ -274,7 +275,8 @@ public TaskTriggerInfo[] Triggers
{
get
{
return InternalTriggers.Select(i => i.Item1).ToArray();
var triggers = InternalTriggers;
return triggers.Select(i => i.Item1).ToArray(triggers.Length);
}
set
{
Expand All @@ -288,7 +290,7 @@ public TaskTriggerInfo[] Triggers

SaveTriggers(triggerList);

InternalTriggers = triggerList.Select(i => new Tuple<TaskTriggerInfo, ITaskTrigger>(i, GetTrigger(i))).ToArray();
InternalTriggers = triggerList.Select(i => new Tuple<TaskTriggerInfo, ITaskTrigger>(i, GetTrigger(i))).ToArray(triggerList.Length);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Emby.Common.Implementations/packages.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="4.4.11" targetFramework="net46" />
<package id="ServiceStack.Text" version="4.5.8" targetFramework="net462" />
<package id="NLog" version="4.4.12" targetFramework="net46" />
<package id="ServiceStack.Text" version="4.5.8" targetFramework="net46" />
<package id="SharpCompress" version="0.14.0" targetFramework="net462" />
<package id="SimpleInjector" version="4.0.8" targetFramework="net46" />
</packages>
8 changes: 6 additions & 2 deletions Emby.Dlna/ContentDirectory/ContentDirectory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.TV;
using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.Xml;

Expand All @@ -31,6 +32,7 @@ public class ContentDirectory : BaseService, IContentDirectory, IDisposable
private readonly IUserViewManager _userViewManager;
private readonly Func<IMediaEncoder> _mediaEncoder;
protected readonly IXmlReaderSettingsFactory XmlReaderSettingsFactory;
private readonly ITVSeriesManager _tvSeriesManager;

public ContentDirectory(IDlnaManager dlna,
IUserDataManager userDataManager,
Expand All @@ -39,7 +41,7 @@ public ContentDirectory(IDlnaManager dlna,
IServerConfigurationManager config,
IUserManager userManager,
ILogger logger,
IHttpClient httpClient, ILocalizationManager localization, IChannelManager channelManager, IMediaSourceManager mediaSourceManager, IUserViewManager userViewManager, Func<IMediaEncoder> mediaEncoder, IXmlReaderSettingsFactory xmlReaderSettingsFactory)
IHttpClient httpClient, ILocalizationManager localization, IChannelManager channelManager, IMediaSourceManager mediaSourceManager, IUserViewManager userViewManager, Func<IMediaEncoder> mediaEncoder, IXmlReaderSettingsFactory xmlReaderSettingsFactory, ITVSeriesManager tvSeriesManager)
: base(logger, httpClient)
{
_dlna = dlna;
Expand All @@ -54,6 +56,7 @@ public ContentDirectory(IDlnaManager dlna,
_userViewManager = userViewManager;
_mediaEncoder = mediaEncoder;
XmlReaderSettingsFactory = xmlReaderSettingsFactory;
_tvSeriesManager = tvSeriesManager;
}

private int SystemUpdateId
Expand Down Expand Up @@ -97,7 +100,8 @@ public ControlResponse ProcessControlRequest(ControlRequest request)
_mediaSourceManager,
_userViewManager,
_mediaEncoder(),
XmlReaderSettingsFactory)
XmlReaderSettingsFactory,
_tvSeriesManager)
.ProcessControlRequest(request);
}

Expand Down
Loading

0 comments on commit 009a3a4

Please sign in to comment.