update httplistener

This commit is contained in:
Luke Pulverenti 2015-11-02 14:29:40 -05:00
parent 4503ec6174
commit f6c8e5b4d6
7 changed files with 38 additions and 40 deletions

View File

@ -164,22 +164,9 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
}
}
//request.ServicePoint.BindIPEndPointDelegate = BindIPEndPointCallback;
return request;
}
private static IPEndPoint BindIPEndPointCallback(ServicePoint servicePoint, IPEndPoint remoteEndPoint, int retryCount)
{
// Prefer local ipv4
if (remoteEndPoint.AddressFamily == AddressFamily.InterNetworkV6)
{
return new IPEndPoint(IPAddress.IPv6Any, 0);
}
return new IPEndPoint(IPAddress.Any, 0);
}
private void AddRequestHeaders(HttpWebRequest request, HttpRequestOptions options)
{
foreach (var header in options.RequestHeaders.ToList())

View File

@ -141,7 +141,7 @@ namespace MediaBrowser.Controller.Entities
public static bool IsEligibleForEnhancedView(string viewType)
{
var types = new[] { CollectionType.Movies, CollectionType.TvShows, CollectionType.Music };
var types = new[] { CollectionType.Movies, CollectionType.TvShows };
return types.Contains(viewType ?? string.Empty, StringComparer.OrdinalIgnoreCase);
}

View File

@ -97,7 +97,7 @@ namespace MediaBrowser.Providers.Folders
}
if (string.Equals(viewType, CollectionType.Channels, StringComparison.OrdinalIgnoreCase))
{
return urlPrefix + "generic.png";
//return urlPrefix + "generic.png";
}
if (string.Equals(viewType, CollectionType.LiveTv, StringComparison.OrdinalIgnoreCase))
{

View File

@ -505,6 +505,11 @@ namespace MediaBrowser.Providers.Manager
return true;
}
if (!item.IsSaveLocalMetadataEnabled())
{
return true;
}
return false;
}

View File

@ -564,8 +564,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
item.ServiceName = serviceName;
item.Number = channelInfo.Number;
var replaceImages = new List<ImageType>();
//if (!string.Equals(item.ProviderImageUrl, channelInfo.ImageUrl, StringComparison.OrdinalIgnoreCase))
//{
// isNew = true;
@ -577,13 +575,16 @@ namespace MediaBrowser.Server.Implementations.LiveTv
// replaceImages.Add(ImageType.Primary);
//}
if (!string.IsNullOrWhiteSpace(channelInfo.ImagePath))
if (!item.HasImage(ImageType.Primary))
{
item.SetImagePath(ImageType.Primary, channelInfo.ImagePath);
}
else if (!string.IsNullOrWhiteSpace(channelInfo.ImageUrl))
{
item.SetImagePath(ImageType.Primary, channelInfo.ImageUrl);
if (!string.IsNullOrWhiteSpace(channelInfo.ImagePath))
{
item.SetImagePath(ImageType.Primary, channelInfo.ImagePath);
}
else if (!string.IsNullOrWhiteSpace(channelInfo.ImageUrl))
{
item.SetImagePath(ImageType.Primary, channelInfo.ImageUrl);
}
}
if (string.IsNullOrEmpty(item.Name))
@ -593,8 +594,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
await item.RefreshMetadata(new MetadataRefreshOptions(_fileSystem)
{
ForceSave = isNew,
ReplaceImages = replaceImages.Distinct().ToList()
ForceSave = isNew
}, cancellationToken);
@ -658,13 +658,16 @@ namespace MediaBrowser.Server.Implementations.LiveTv
item.IndexNumber = info.EpisodeNumber;
item.ParentIndexNumber = info.SeasonNumber;
if (!string.IsNullOrWhiteSpace(info.ImagePath))
if (!item.HasImage(ImageType.Primary))
{
item.SetImagePath(ImageType.Primary, info.ImagePath);
}
else if (!string.IsNullOrWhiteSpace(info.ImageUrl))
{
item.SetImagePath(ImageType.Primary, info.ImageUrl);
if (!string.IsNullOrWhiteSpace(info.ImagePath))
{
item.SetImagePath(ImageType.Primary, info.ImagePath);
}
else if (!string.IsNullOrWhiteSpace(info.ImageUrl))
{
item.SetImagePath(ImageType.Primary, info.ImageUrl);
}
}
if (isNew)
@ -761,13 +764,16 @@ namespace MediaBrowser.Server.Implementations.LiveTv
}
recording.IsSeries = info.IsSeries;
if (!string.IsNullOrWhiteSpace(info.ImagePath))
if (!item.HasImage(ImageType.Primary))
{
item.SetImagePath(ImageType.Primary, info.ImagePath);
}
else if (!string.IsNullOrWhiteSpace(info.ImageUrl))
{
item.SetImagePath(ImageType.Primary, info.ImageUrl);
if (!string.IsNullOrWhiteSpace(info.ImagePath))
{
item.SetImagePath(ImageType.Primary, info.ImagePath);
}
else if (!string.IsNullOrWhiteSpace(info.ImageUrl))
{
item.SetImagePath(ImageType.Primary, info.ImageUrl);
}
}
var statusChanged = info.Status != recording.Status;

View File

@ -58,9 +58,9 @@
<Reference Include="ServiceStack.Api.Swagger">
<HintPath>..\ThirdParty\ServiceStack\ServiceStack.Api.Swagger.dll</HintPath>
</Reference>
<Reference Include="SocketHttpListener, Version=1.0.5754.42244, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="SocketHttpListener, Version=1.0.5784.26000, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\SocketHttpListener.1.0.0.10\lib\net45\SocketHttpListener.dll</HintPath>
<HintPath>..\packages\SocketHttpListener.1.0.0.13\lib\net45\SocketHttpListener.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />

View File

@ -6,5 +6,5 @@
<package id="Mono.Nat" version="1.2.24.0" targetFramework="net45" />
<package id="morelinq" version="1.1.1" targetFramework="net45" />
<package id="Patterns.Logging" version="1.0.0.2" targetFramework="net45" />
<package id="SocketHttpListener" version="1.0.0.10" targetFramework="net45" />
<package id="SocketHttpListener" version="1.0.0.13" targetFramework="net45" />
</packages>