diff options
| -rw-r--r-- | MediaBrowser.Api/PackageService.cs | 18 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs | 45 | ||||
| -rw-r--r-- | MediaBrowser.Common/MediaBrowser.Common.csproj | 1 | ||||
| -rw-r--r-- | MediaBrowser.Common/Plugins/BasePlugin.cs | 8 | ||||
| -rw-r--r-- | MediaBrowser.Common/Plugins/IUIPlugin.cs | 16 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Providers/MediaInfo/BaseFFProbeProvider.cs | 1 | ||||
| -rw-r--r-- | MediaBrowser.Model/Entities/MediaStream.cs | 7 | ||||
| -rw-r--r-- | MediaBrowser.Model/Plugins/PluginInfo.cs | 7 | ||||
| -rw-r--r-- | MediaBrowser.WebDashboard/Api/DashboardService.cs | 2 |
9 files changed, 53 insertions, 52 deletions
diff --git a/MediaBrowser.Api/PackageService.cs b/MediaBrowser.Api/PackageService.cs index 742e26bc0..c80841a9a 100644 --- a/MediaBrowser.Api/PackageService.cs +++ b/MediaBrowser.Api/PackageService.cs @@ -30,7 +30,7 @@ namespace MediaBrowser.Api /// Class GetPackages /// </summary> [Route("/Packages", "GET")] - [ServiceStack.ServiceHost.Api(("Gets available packages"))] + [Api(("Gets available packages"))] public class GetPackages : IReturn<List<PackageInfo>> { /// <summary> @@ -39,13 +39,16 @@ namespace MediaBrowser.Api /// <value>The name.</value> [ApiMember(Name = "PackageType", Description = "Optional package type filter (System/UserInstalled)", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] public PackageType? PackageType { get; set; } + + [ApiMember(Name = "Applications", Description = "Optional. Filter by target system type. Allows multiple, comma delimited.", IsRequired = false, DataType = "string", ParameterType = "path", Verb = "GET", AllowMultiple = true)] + public string Applications { get; set; } } /// <summary> /// Class GetPackageVersionUpdates /// </summary> [Route("/Packages/Updates", "GET")] - [ServiceStack.ServiceHost.Api(("Gets available package updates for currently installed packages"))] + [Api(("Gets available package updates for currently installed packages"))] public class GetPackageVersionUpdates : IReturn<List<PackageVersionInfo>> { /// <summary> @@ -60,7 +63,7 @@ namespace MediaBrowser.Api /// Class InstallPackage /// </summary> [Route("/Packages/Installed/{Name}", "POST")] - [ServiceStack.ServiceHost.Api(("Installs a package"))] + [Api(("Installs a package"))] public class InstallPackage : IReturnVoid { /// <summary> @@ -89,7 +92,7 @@ namespace MediaBrowser.Api /// Class CancelPackageInstallation /// </summary> [Route("/Packages/Installing/{Id}", "DELETE")] - [ServiceStack.ServiceHost.Api(("Cancels a package installation"))] + [Api(("Cancels a package installation"))] public class CancelPackageInstallation : IReturnVoid { /// <summary> @@ -165,6 +168,13 @@ namespace MediaBrowser.Api { var packages = _installationManager.GetAvailablePackages(CancellationToken.None, request.PackageType, _appHost.ApplicationVersion).Result; + if (!string.IsNullOrEmpty(request.Applications)) + { + var apps = request.Applications.Split(',').Select(i => (PackageTargetSystem)Enum.Parse(typeof(PackageTargetSystem), i, true)); + + packages = packages.Where(p => apps.Contains(p.targetSystem)); + } + return ToOptimizedResult(packages.ToList()); } diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs index 13d103608..52052e16e 100644 --- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs +++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs @@ -90,8 +90,9 @@ namespace MediaBrowser.Api.Playback.Progressive /// </summary> /// <param name="state">The state.</param> /// <param name="responseHeaders">The response headers.</param> + /// <param name="isStaticallyStreamed">if set to <c>true</c> [is statically streamed].</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns> - private void AddDlnaHeaders(StreamState state, IDictionary<string, string> responseHeaders) + private void AddDlnaHeaders(StreamState state, IDictionary<string, string> responseHeaders, bool isStaticallyStreamed) { var timeSeek = RequestContext.GetHeader("TimeSeekRange.dlna.org"); @@ -107,46 +108,56 @@ namespace MediaBrowser.Api.Playback.Progressive var contentFeatures = string.Empty; var extension = GetOutputFileExtension(state); + // first bit means Time based seek supported, second byte range seek supported (not sure about the order now), so 01 = only byte seek, 10 = time based, 11 = both, 00 = none + var org_op = isStaticallyStreamed ? ";DLNA.ORG_OP=01" : ";DLNA.ORG_OP=00"; + + // 0 = native, 1 = transcoded + var org_ci = isStaticallyStreamed ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1"; + + var dlnaflags = ";DLNA.ORG_FLAGS=01500000000000000000000000000000"; + if (string.Equals(extension, ".mp3", StringComparison.OrdinalIgnoreCase)) { - contentFeatures = "DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000"; + contentFeatures = "DLNA.ORG_PN=MP3"; } else if (string.Equals(extension, ".aac", StringComparison.OrdinalIgnoreCase)) { - contentFeatures = "DLNA.ORG_PN=AAC_ISO;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000"; + contentFeatures = "DLNA.ORG_PN=AAC_ISO"; } else if (string.Equals(extension, ".wma", StringComparison.OrdinalIgnoreCase)) { - contentFeatures = "DLNA.ORG_PN=WMABASE;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000"; + contentFeatures = "DLNA.ORG_PN=WMABASE"; } else if (string.Equals(extension, ".avi", StringComparison.OrdinalIgnoreCase)) { - contentFeatures = "DLNA.ORG_PN=AVI;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000"; + contentFeatures = "DLNA.ORG_PN=AVI"; } else if (string.Equals(extension, ".mp4", StringComparison.OrdinalIgnoreCase)) { - contentFeatures = "DLNA.ORG_PN=MPEG4_P2_SP_AAC;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000"; + contentFeatures = "DLNA.ORG_PN=AVC_MP4_BL_L3_SD_AAC"; } else if (string.Equals(extension, ".mpeg", StringComparison.OrdinalIgnoreCase)) { - contentFeatures = "DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000"; + contentFeatures = "DLNA.ORG_PN=MPEG_PS_PAL"; } else if (string.Equals(extension, ".wmv", StringComparison.OrdinalIgnoreCase)) { - contentFeatures = "DLNA.ORG_PN=WMVHIGH_BASE;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000"; + contentFeatures = "DLNA.ORG_PN=WMVHIGH_BASE"; } else if (string.Equals(extension, ".asf", StringComparison.OrdinalIgnoreCase)) { - contentFeatures = "DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000"; + // ?? + contentFeatures = "DLNA.ORG_PN=WMVHIGH_BASE"; } else if (string.Equals(extension, ".mkv", StringComparison.OrdinalIgnoreCase)) { - contentFeatures = "DLNA.ORG_OP=01;DLNA.ORG_CI=0"; + // ?? + contentFeatures = ""; } if (!string.IsNullOrEmpty(contentFeatures)) { - responseHeaders["ContentFeatures.DLNA.ORG"] = contentFeatures; + responseHeaders["ContentFeatures.DLNA.ORG"] = (contentFeatures + org_op + org_ci + dlnaflags).Trim(';'); } } @@ -176,16 +187,20 @@ namespace MediaBrowser.Api.Playback.Progressive var responseHeaders = new Dictionary<string, string>(); - AddDlnaHeaders(state, responseHeaders); + var outputPath = GetOutputFilePath(state); + var outputPathExists = File.Exists(outputPath); + + var isStatic = request.Static || + (outputPathExists && !ApiEntryPoint.Instance.HasActiveTranscodingJob(outputPath, TranscodingJobType.Progressive)); + + AddDlnaHeaders(state, responseHeaders, isStatic); if (request.Static) { return ResultFactory.GetStaticFileResult(RequestContext, state.Item.Path, responseHeaders, isHeadRequest); } - var outputPath = GetOutputFilePath(state); - - if (File.Exists(outputPath) && !ApiEntryPoint.Instance.HasActiveTranscodingJob(outputPath, TranscodingJobType.Progressive)) + if (outputPathExists && !ApiEntryPoint.Instance.HasActiveTranscodingJob(outputPath, TranscodingJobType.Progressive)) { return ResultFactory.GetStaticFileResult(RequestContext, outputPath, responseHeaders, isHeadRequest); } diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csproj index e9dda6bb7..b2553ce22 100644 --- a/MediaBrowser.Common/MediaBrowser.Common.csproj +++ b/MediaBrowser.Common/MediaBrowser.Common.csproj @@ -85,7 +85,6 @@ <Compile Include="Net\MimeTypes.cs" /> <Compile Include="Net\WebSocketConnectEventArgs.cs" /> <Compile Include="Plugins\IPlugin.cs" /> - <Compile Include="Plugins\IUIPlugin.cs" /> <Compile Include="Progress\ActionableProgress.cs" /> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> diff --git a/MediaBrowser.Common/Plugins/BasePlugin.cs b/MediaBrowser.Common/Plugins/BasePlugin.cs index 9c4a8e8ff..ebf1497f4 100644 --- a/MediaBrowser.Common/Plugins/BasePlugin.cs +++ b/MediaBrowser.Common/Plugins/BasePlugin.cs @@ -299,7 +299,6 @@ namespace MediaBrowser.Common.Plugins var info = new PluginInfo { Name = Name, - DownloadToUI = this is IUIPlugin, Version = Version.ToString(), AssemblyFileName = AssemblyFileName, ConfigurationDateLastModified = ConfigurationDateLastModified, @@ -310,13 +309,6 @@ namespace MediaBrowser.Common.Plugins ConfigurationFileName = ConfigurationFileName }; - var uiPlugin = this as IUIPlugin; - - if (uiPlugin != null) - { - info.MinimumRequiredUIVersion = uiPlugin.MinimumRequiredUIVersion.ToString(); - } - return info; } diff --git a/MediaBrowser.Common/Plugins/IUIPlugin.cs b/MediaBrowser.Common/Plugins/IUIPlugin.cs deleted file mode 100644 index c454b4da7..000000000 --- a/MediaBrowser.Common/Plugins/IUIPlugin.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace MediaBrowser.Common.Plugins -{ - /// <summary> - /// Interface IUIPlugin - /// </summary> - public interface IUIPlugin : IPlugin - { - /// <summary> - /// Gets the minimum required UI version. - /// </summary> - /// <value>The minimum required UI version.</value> - Version MinimumRequiredUIVersion { get; } - } -} diff --git a/MediaBrowser.Controller/Providers/MediaInfo/BaseFFProbeProvider.cs b/MediaBrowser.Controller/Providers/MediaInfo/BaseFFProbeProvider.cs index a465adeb6..06af1c8cc 100644 --- a/MediaBrowser.Controller/Providers/MediaInfo/BaseFFProbeProvider.cs +++ b/MediaBrowser.Controller/Providers/MediaInfo/BaseFFProbeProvider.cs @@ -195,6 +195,7 @@ namespace MediaBrowser.Controller.Providers.MediaInfo Codec = streamInfo.codec_name, Language = GetDictionaryValue(streamInfo.tags, "language"), Profile = streamInfo.profile, + Level = streamInfo.level, Index = streamInfo.index }; diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs index fe008aa0c..a17956c4d 100644 --- a/MediaBrowser.Model/Entities/MediaStream.cs +++ b/MediaBrowser.Model/Entities/MediaStream.cs @@ -133,6 +133,13 @@ namespace MediaBrowser.Model.Entities /// <value>The filename.</value> [ProtoMember(18)] public string Path { get; set; } + + /// <summary> + /// Gets or sets the level. + /// </summary> + /// <value>The level.</value> + [ProtoMember(19)] + public double Level { get; set; } } /// <summary> diff --git a/MediaBrowser.Model/Plugins/PluginInfo.cs b/MediaBrowser.Model/Plugins/PluginInfo.cs index 4aa5f5a5c..2df635db0 100644 --- a/MediaBrowser.Model/Plugins/PluginInfo.cs +++ b/MediaBrowser.Model/Plugins/PluginInfo.cs @@ -18,13 +18,6 @@ namespace MediaBrowser.Model.Plugins public string Name { get; set; } /// <summary> - /// Gets or sets a value indicating whether [download to UI]. - /// </summary> - /// <value><c>true</c> if [download to UI]; otherwise, <c>false</c>.</value> - [ProtoMember(2)] - public bool DownloadToUI { get; set; } - - /// <summary> /// Gets or sets the configuration date last modified. /// </summary> /// <value>The configuration date last modified.</value> diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 15ccbfb3e..3aab9c1c8 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -454,6 +454,7 @@ namespace MediaBrowser.WebDashboard.Api { "extensions.js", "site.js", + "librarybrowser.js", "aboutpage.js", "addpluginpage.js", "advancedconfigurationpage.js", @@ -467,7 +468,6 @@ namespace MediaBrowser.WebDashboard.Api "itembynamedetailpage.js", "itemdetailpage.js", "itemlistpage.js", - "librarybrowser.js", "loginpage.js", "logpage.js", "medialibrarypage.js", |
