commit
46b26863d0
|
@ -1,4 +1,5 @@
|
|||
using MediaBrowser.Common.IO;
|
||||
using System.Globalization;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Devices;
|
||||
|
@ -287,7 +288,9 @@ namespace MediaBrowser.Api.Playback.Progressive
|
|||
|
||||
var contentType = state.GetMimeType(outputPath);
|
||||
|
||||
var contentLength = state.EstimateContentLength ? GetEstimatedContentLength(state) : null;
|
||||
// TODO: The isHeadRequest is only here because ServiceStack will add Content-Length=0 to the response
|
||||
// What we really want to do is hunt that down and remove that
|
||||
var contentLength = state.EstimateContentLength || isHeadRequest ? GetEstimatedContentLength(state) : null;
|
||||
|
||||
if (contentLength.HasValue)
|
||||
{
|
||||
|
@ -299,10 +302,14 @@ namespace MediaBrowser.Api.Playback.Progressive
|
|||
{
|
||||
var streamResult = ResultFactory.GetResult(new byte[] { }, contentType, responseHeaders);
|
||||
|
||||
if (!contentLength.HasValue)
|
||||
var hasOptions = streamResult as IHasOptions;
|
||||
if (hasOptions != null)
|
||||
{
|
||||
var hasOptions = streamResult as IHasOptions;
|
||||
if (hasOptions != null)
|
||||
if (contentLength.HasValue)
|
||||
{
|
||||
hasOptions.Options["Content-Length"] = contentLength.Value.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hasOptions.Options.ContainsKey("Content-Length"))
|
||||
{
|
||||
|
|
|
@ -11,6 +11,7 @@ namespace MediaBrowser.Dlna.Profiles
|
|||
Name = "WDTV Live";
|
||||
|
||||
TimelineOffsetSeconds = 5;
|
||||
IgnoreTranscodeByteRangeRequests = true;
|
||||
|
||||
Identification = new DeviceIdentification
|
||||
{
|
||||
|
|
|
@ -118,10 +118,7 @@ namespace MediaBrowser.Dlna.Ssdp
|
|||
|
||||
public void Start()
|
||||
{
|
||||
_socket = CreateMulticastSocket();
|
||||
|
||||
_logger.Info("SSDP service started");
|
||||
Receive();
|
||||
RestartSocketListener();
|
||||
|
||||
ReloadAliveNotifier();
|
||||
}
|
||||
|
@ -289,6 +286,56 @@ namespace MediaBrowser.Dlna.Ssdp
|
|||
}
|
||||
}
|
||||
|
||||
private void RestartSocketListener()
|
||||
{
|
||||
if (_isDisposed)
|
||||
{
|
||||
StopSocketRetryTimer();
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_socket = CreateMulticastSocket();
|
||||
|
||||
_logger.Info("MultiCast socket created");
|
||||
|
||||
StopSocketRetryTimer();
|
||||
|
||||
Receive();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error creating MultiCast socket", ex);
|
||||
//StartSocketRetryTimer();
|
||||
}
|
||||
}
|
||||
|
||||
private Timer _socketRetryTimer;
|
||||
private readonly object _socketRetryLock = new object();
|
||||
private void StartSocketRetryTimer()
|
||||
{
|
||||
lock (_socketRetryLock)
|
||||
{
|
||||
if (_socketRetryTimer == null)
|
||||
{
|
||||
_socketRetryTimer = new Timer(s => RestartSocketListener(), null, TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(30));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void StopSocketRetryTimer()
|
||||
{
|
||||
lock (_socketRetryLock)
|
||||
{
|
||||
if (_socketRetryTimer != null)
|
||||
{
|
||||
_socketRetryTimer.Dispose();
|
||||
_socketRetryTimer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Receive()
|
||||
{
|
||||
try
|
||||
|
@ -297,10 +344,15 @@ namespace MediaBrowser.Dlna.Ssdp
|
|||
|
||||
EndPoint endpoint = new IPEndPoint(IPAddress.Any, SSDPPort);
|
||||
|
||||
_socket.BeginReceiveFrom(buffer, 0, buffer.Length, SocketFlags.None, ref endpoint, ReceiveCallback, buffer);
|
||||
_socket.BeginReceiveFrom(buffer, 0, buffer.Length, SocketFlags.None, ref endpoint, ReceiveCallback,
|
||||
buffer);
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{
|
||||
if (!_isDisposed)
|
||||
{
|
||||
//StartSocketRetryTimer();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -348,6 +400,13 @@ namespace MediaBrowser.Dlna.Ssdp
|
|||
|
||||
OnMessageReceived(args);
|
||||
}
|
||||
catch (ObjectDisposedException)
|
||||
{
|
||||
if (!_isDisposed)
|
||||
{
|
||||
//StartSocketRetryTimer();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Failed to read SSDP message", ex);
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|||
|
||||
var internalStreams = data.streams ?? new MediaStreamInfo[] { };
|
||||
|
||||
info.MediaStreams = internalStreams.Select(s => GetMediaStream(s, data.format))
|
||||
info.MediaStreams = internalStreams.Select(s => GetMediaStream(isAudio, s, data.format))
|
||||
.Where(i => i != null)
|
||||
.ToList();
|
||||
|
||||
|
@ -94,7 +94,7 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|||
/// <param name="streamInfo">The stream info.</param>
|
||||
/// <param name="formatInfo">The format info.</param>
|
||||
/// <returns>MediaStream.</returns>
|
||||
private MediaStream GetMediaStream(MediaStreamInfo streamInfo, MediaFormatInfo formatInfo)
|
||||
private MediaStream GetMediaStream(bool isAudio, MediaStreamInfo streamInfo, MediaFormatInfo formatInfo)
|
||||
{
|
||||
var stream = new MediaStream
|
||||
{
|
||||
|
@ -129,7 +129,7 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|||
}
|
||||
else if (string.Equals(streamInfo.codec_type, "video", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
stream.Type = (streamInfo.codec_name ?? string.Empty).IndexOf("mjpeg", StringComparison.OrdinalIgnoreCase) != -1
|
||||
stream.Type = isAudio
|
||||
? MediaStreamType.EmbeddedImage
|
||||
: MediaStreamType.Video;
|
||||
|
||||
|
|
|
@ -76,6 +76,7 @@ namespace MediaBrowser.Model.Dlna
|
|||
public bool RequiresPlainFolders { get; set; }
|
||||
|
||||
public bool EnableMSMediaReceiverRegistrar { get; set; }
|
||||
public bool IgnoreTranscodeByteRangeRequests { get; set; }
|
||||
|
||||
public XmlAttribute[] XmlRootAttributes { get; set; }
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||
return ItemUpdateType.MetadataImport;
|
||||
}
|
||||
|
||||
private const string SchemaVersion = "2";
|
||||
private const string SchemaVersion = "3";
|
||||
|
||||
private async Task<Model.MediaInfo.MediaInfo> GetMediaInfo(BaseItem item, CancellationToken cancellationToken)
|
||||
{
|
||||
|
|
|
@ -17,7 +17,6 @@ using MediaBrowser.Model.Querying;
|
|||
using MoreLinq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
|
|
@ -48,8 +48,9 @@
|
|||
<Reference Include="Interfaces.IO">
|
||||
<HintPath>..\packages\Interfaces.IO.1.0.0.5\lib\portable-net45+sl4+wp71+win8+wpa81\Interfaces.IO.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MediaBrowser.Naming">
|
||||
<HintPath>..\packages\MediaBrowser.Naming.1.0.0.35\lib\portable-net45+sl4+wp71+win8+wpa81\MediaBrowser.Naming.dll</HintPath>
|
||||
<Reference Include="MediaBrowser.Naming, Version=1.0.5607.1779, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\MediaBrowser.Naming.1.0.0.36\lib\portable-net45+sl4+wp71+win8+wpa81\MediaBrowser.Naming.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mono.Nat, Version=1.2.24.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
|
|
@ -1,27 +1,44 @@
|
|||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Drawing;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Photos
|
||||
{
|
||||
//public class PhotoAlbumImageProvider : BaseDynamicImageProvider<PhotoAlbum>
|
||||
//public class PhotoAlbumImageProvider : IDynamicImageProvider
|
||||
//{
|
||||
// public PhotoAlbumImageProvider(IFileSystem fileSystem, IProviderManager providerManager, IApplicationPaths applicationPaths, IImageProcessor imageProcessor)
|
||||
// : base(fileSystem, providerManager, applicationPaths, imageProcessor)
|
||||
// public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
// {
|
||||
// return new List<ImageType> { ImageType.Primary };
|
||||
// }
|
||||
|
||||
// protected override Task<List<BaseItem>> GetItemsWithImages(IHasImages item)
|
||||
// public Task<DynamicImageResponse> GetImage(IHasImages item, ImageType type, CancellationToken cancellationToken)
|
||||
// {
|
||||
// var photoAlbum = (PhotoAlbum)item;
|
||||
// var items = GetFinalItems(photoAlbum.Children.ToList());
|
||||
// var album = (PhotoAlbum)item;
|
||||
|
||||
// return Task.FromResult(items);
|
||||
// var image = album.Children
|
||||
// .OfType<Photo>()
|
||||
// .Select(i => i.GetImagePath(type))
|
||||
// .FirstOrDefault(i => !string.IsNullOrEmpty(i));
|
||||
|
||||
// return Task.FromResult(new DynamicImageResponse
|
||||
// {
|
||||
// Path = image,
|
||||
// HasImage = !string.IsNullOrEmpty(image)
|
||||
// });
|
||||
// }
|
||||
|
||||
// public string Name
|
||||
// {
|
||||
// get { return "Image Extractor"; }
|
||||
// }
|
||||
|
||||
// public bool Supports(IHasImages item)
|
||||
// {
|
||||
// return item is PhotoAlbum;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Interfaces.IO" version="1.0.0.5" targetFramework="net45" />
|
||||
<package id="MediaBrowser.Naming" version="1.0.0.35" targetFramework="net45" />
|
||||
<package id="MediaBrowser.Naming" version="1.0.0.36" targetFramework="net45" />
|
||||
<package id="Mono.Nat" version="1.2.24.0" targetFramework="net45" />
|
||||
<package id="morelinq" version="1.1.0" targetFramework="net45" />
|
||||
<package id="Patterns.Logging" version="1.0.0.2" targetFramework="net45" />
|
||||
|
|
|
@ -220,9 +220,7 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
var files = new[]
|
||||
{
|
||||
"thirdparty/jquerymobile-1.4.5/jquery.mobile-1.4.5.min.css",
|
||||
"thirdparty/swipebox-master/css/swipebox.min.css" + versionString,
|
||||
"thirdparty/fontawesome/css/font-awesome.min.css" + versionString,
|
||||
"thirdparty/jstree3.0.8/themes/default/style.min.css",
|
||||
"css/all.css" + versionString
|
||||
};
|
||||
|
||||
|
@ -245,8 +243,7 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
|
||||
var files = new List<string>
|
||||
{
|
||||
"scripts/all.js" + versionString,
|
||||
"thirdparty/swipebox-master/js/jquery.swipebox.min.js" + versionString
|
||||
"scripts/all.js" + versionString
|
||||
};
|
||||
|
||||
if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase))
|
||||
|
@ -274,16 +271,12 @@ namespace MediaBrowser.WebDashboard.Api
|
|||
await AppendResource(memoryStream, "thirdparty/jquery-2.1.1.min.js", newLineBytes).ConfigureAwait(false);
|
||||
await AppendResource(memoryStream, "thirdparty/jquerymobile-1.4.5/jquery.mobile-1.4.5.min.js", newLineBytes).ConfigureAwait(false);
|
||||
|
||||
await AppendResource(memoryStream, "thirdparty/jquery.unveil-custom.js", newLineBytes).ConfigureAwait(false);
|
||||
|
||||
await AppendResource(memoryStream, "thirdparty/cast_sender.js", newLineBytes).ConfigureAwait(false);
|
||||
await AppendResource(memoryStream, "thirdparty/browser.js", newLineBytes).ConfigureAwait(false);
|
||||
|
||||
await AppendResource(memoryStream, "thirdparty/jstree3.0.8/jstree.js", newLineBytes).ConfigureAwait(false);
|
||||
await AppendResource(memoryStream, "thirdparty/require.js", newLineBytes).ConfigureAwait(false);
|
||||
|
||||
await AppendResource(memoryStream, "thirdparty/jquery.unveil-custom.js", newLineBytes).ConfigureAwait(false);
|
||||
|
||||
await AppendResource(memoryStream, "thirdparty/fastclick.js", newLineBytes).ConfigureAwait(false);
|
||||
await AppendResource(memoryStream, "thirdparty/headroom.js", newLineBytes).ConfigureAwait(false);
|
||||
|
||||
await AppendLocalization(memoryStream, culture).ConfigureAwait(false);
|
||||
await memoryStream.WriteAsync(newLineBytes, 0, newLineBytes.Length).ConfigureAwait(false);
|
||||
|
||||
|
|
|
@ -1665,6 +1665,12 @@
|
|||
<Content Include="dashboard-ui\thirdparty\jstree3.0.8\themes\default\throbber.gif">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\thirdparty\require.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\thirdparty\requirecss.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="dashboard-ui\thirdparty\swipebox-master\css\swipebox.css">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System.Reflection;
|
||||
|
||||
//[assembly: AssemblyVersion("3.0.*")]
|
||||
[assembly: AssemblyVersion("3.0.5607.0")]
|
||||
[assembly: AssemblyVersion("3.0.5607.1")]
|
||||
|
|
Loading…
Reference in New Issue
Block a user