diff options
Diffstat (limited to 'MediaBrowser.Api')
| -rw-r--r-- | MediaBrowser.Api/Dlna/DlnaServerService.cs | 33 | ||||
| -rw-r--r-- | MediaBrowser.Api/EnvironmentService.cs | 58 | ||||
| -rw-r--r-- | MediaBrowser.Api/Images/ImageService.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.Api/Library/LibraryService.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/BaseStreamingService.cs | 20 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/Hls/BaseHlsService.cs | 22 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 39 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/Hls/VideoHlsService.cs | 19 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/MediaInfoService.cs | 8 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/Progressive/AudioService.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/Progressive/VideoService.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/StreamState.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/UserLibraryService.cs | 2 |
13 files changed, 130 insertions, 92 deletions
diff --git a/MediaBrowser.Api/Dlna/DlnaServerService.cs b/MediaBrowser.Api/Dlna/DlnaServerService.cs index 6e59cceecd..fc8c0edf6b 100644 --- a/MediaBrowser.Api/Dlna/DlnaServerService.cs +++ b/MediaBrowser.Api/Dlna/DlnaServerService.cs @@ -219,20 +219,20 @@ namespace MediaBrowser.Api.Dlna private object ProcessEventRequest(IEventManager eventManager) { var subscriptionId = GetHeader("SID"); - var notificationType = GetHeader("NT"); - var callback = GetHeader("CALLBACK"); - var timeoutString = GetHeader("TIMEOUT"); - - var timeout = ParseTimeout(timeoutString); if (string.Equals(Request.Verb, "SUBSCRIBE", StringComparison.OrdinalIgnoreCase)) { + var notificationType = GetHeader("NT"); + + var callback = GetHeader("CALLBACK"); + var timeoutString = GetHeader("TIMEOUT"); + if (string.IsNullOrEmpty(notificationType)) { - return GetSubscriptionResponse(eventManager.RenewEventSubscription(subscriptionId, timeout)); + return GetSubscriptionResponse(eventManager.RenewEventSubscription(subscriptionId, timeoutString)); } - return GetSubscriptionResponse(eventManager.CreateEventSubscription(notificationType, timeout, callback)); + return GetSubscriptionResponse(eventManager.CreateEventSubscription(notificationType, timeoutString, callback)); } return GetSubscriptionResponse(eventManager.CancelEventSubscription(subscriptionId)); @@ -242,24 +242,5 @@ namespace MediaBrowser.Api.Dlna { return ResultFactory.GetResult(response.Content, response.ContentType, response.Headers); } - - private readonly CultureInfo _usCulture = new CultureInfo("en-US"); - private int? ParseTimeout(string header) - { - if (!string.IsNullOrEmpty(header)) - { - // Starts with SECOND- - header = header.Split('-').Last(); - - int val; - - if (int.TryParse(header, NumberStyles.Any, _usCulture, out val)) - { - return val; - } - } - - return null; - } } } diff --git a/MediaBrowser.Api/EnvironmentService.cs b/MediaBrowser.Api/EnvironmentService.cs index c4cb0cb1d6..9764a71dbc 100644 --- a/MediaBrowser.Api/EnvironmentService.cs +++ b/MediaBrowser.Api/EnvironmentService.cs @@ -50,6 +50,20 @@ namespace MediaBrowser.Api } } + [Route("/Environment/ValidatePath", "POST", Summary = "Gets the contents of a given directory in the file system")] + public class ValidatePath + { + /// <summary> + /// Gets or sets the path. + /// </summary> + /// <value>The path.</value> + [ApiMember(Name = "Path", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")] + public string Path { get; set; } + + public bool ValidateWriteable { get; set; } + public bool? IsFile { get; set; } + } + [Route("/Environment/NetworkShares", "GET", Summary = "Gets shares from a network device")] public class GetNetworkShares : IReturn<List<FileSystemEntryInfo>> { @@ -112,7 +126,7 @@ namespace MediaBrowser.Api /// The _network manager /// </summary> private readonly INetworkManager _networkManager; - private IFileSystem _fileSystem; + private readonly IFileSystem _fileSystem; /// <summary> /// Initializes a new instance of the <see cref="EnvironmentService" /> class. @@ -129,6 +143,48 @@ namespace MediaBrowser.Api _fileSystem = fileSystem; } + public void Post(ValidatePath request) + { + if (request.IsFile.HasValue) + { + if (request.IsFile.Value) + { + if (!_fileSystem.FileExists(request.Path)) + { + throw new FileNotFoundException("File not found", request.Path); + } + } + else + { + if (!_fileSystem.DirectoryExists(request.Path)) + { + throw new FileNotFoundException("File not found", request.Path); + } + } + } + + else + { + if (!_fileSystem.FileExists(request.Path) && !_fileSystem.DirectoryExists(request.Path)) + { + throw new FileNotFoundException("Path not found", request.Path); + } + + if (request.ValidateWriteable) + { + EnsureWriteAccess(request.Path); + } + } + } + + protected void EnsureWriteAccess(string path) + { + var file = Path.Combine(path, Guid.NewGuid().ToString()); + + _fileSystem.WriteAllText(file, string.Empty); + _fileSystem.DeleteFile(file); + } + public object Get(GetDefaultDirectoryBrowser request) { var result = new DefaultDirectoryBrowserInfo(); diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs index 221755916b..f6c97e0919 100644 --- a/MediaBrowser.Api/Images/ImageService.cs +++ b/MediaBrowser.Api/Images/ImageService.cs @@ -17,6 +17,7 @@ using System.Threading.Tasks; using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.IO; +using MediaBrowser.Controller.LiveTv; using MediaBrowser.Model.IO; using MediaBrowser.Model.Services; @@ -567,7 +568,9 @@ namespace MediaBrowser.Api.Images }).ToList() : new List<IImageEnhancer>(); - var cropwhitespace = request.Type == ImageType.Logo || request.Type == ImageType.Art; + var cropwhitespace = request.Type == ImageType.Logo || + request.Type == ImageType.Art + || (request.Type == ImageType.Primary && item is LiveTvChannel); if (request.CropWhitespace.HasValue) { diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs index 80d8c072ee..3bb119cbae 100644 --- a/MediaBrowser.Api/Library/LibraryService.cs +++ b/MediaBrowser.Api/Library/LibraryService.cs @@ -512,10 +512,6 @@ namespace MediaBrowser.Api.Library var headers = new Dictionary<string, string>(); - // Quotes are valid in linux. They'll possibly cause issues here - var filename = Path.GetFileName(item.Path).Replace("\"", string.Empty); - headers["Content-Disposition"] = string.Format("attachment; filename=\"{0}\"", filename); - if (user != null) { LogDownload(item, user, auth); diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 8d01e4021f..c300fcce3e 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -22,6 +22,7 @@ using System.Threading.Tasks; using MediaBrowser.Common.Net; using MediaBrowser.Controller; using MediaBrowser.Controller.Net; +using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Diagnostics; namespace MediaBrowser.Api.Playback @@ -100,11 +101,7 @@ namespace MediaBrowser.Api.Playback /// <summary> /// Gets the command line arguments. /// </summary> - /// <param name="outputPath">The output path.</param> - /// <param name="state">The state.</param> - /// <param name="isEncoding">if set to <c>true</c> [is encoding].</param> - /// <returns>System.String.</returns> - protected abstract string GetCommandLineArguments(string outputPath, StreamState state, bool isEncoding); + protected abstract string GetCommandLineArguments(string outputPath, EncodingOptions encodingOptions, StreamState state, bool isEncoding); /// <summary> /// Gets the type of the transcoding job. @@ -125,11 +122,11 @@ namespace MediaBrowser.Api.Playback /// <summary> /// Gets the output file path. /// </summary> - private string GetOutputFilePath(StreamState state, string outputFileExtension) + private string GetOutputFilePath(StreamState state, EncodingOptions encodingOptions, string outputFileExtension) { var folder = ServerConfigurationManager.ApplicationPaths.TranscodingTempPath; - var data = GetCommandLineArguments("dummy\\dummy", state, false); + var data = GetCommandLineArguments("dummy\\dummy", encodingOptions, state, false); data += "-" + (state.Request.DeviceId ?? string.Empty); data += "-" + (state.Request.PlaySessionId ?? string.Empty); @@ -217,8 +214,10 @@ namespace MediaBrowser.Api.Playback } } + var encodingOptions = ApiEntryPoint.Instance.GetEncodingOptions(); + var transcodingId = Guid.NewGuid().ToString("N"); - var commandLineArgs = GetCommandLineArguments(outputPath, state, true); + var commandLineArgs = GetCommandLineArguments(outputPath, encodingOptions, state, true); var process = ApiEntryPoint.Instance.ProcessFactory.Create(new ProcessOptions { @@ -826,7 +825,10 @@ namespace MediaBrowser.Api.Playback var ext = string.IsNullOrWhiteSpace(state.OutputContainer) ? GetOutputFileExtension(state) : ("." + state.OutputContainer); - state.OutputFilePath = GetOutputFilePath(state, ext); + + var encodingOptions = ApiEntryPoint.Instance.GetEncodingOptions(); + + state.OutputFilePath = GetOutputFilePath(state, encodingOptions, ext); return state; } diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index 63d2cd9ebe..83157c7031 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -14,6 +14,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using MediaBrowser.Controller.Net; +using MediaBrowser.Model.Configuration; namespace MediaBrowser.Api.Playback.Hls { @@ -25,15 +26,12 @@ namespace MediaBrowser.Api.Playback.Hls /// <summary> /// Gets the audio arguments. /// </summary> - /// <param name="state">The state.</param> - /// <returns>System.String.</returns> - protected abstract string GetAudioArguments(StreamState state); + protected abstract string GetAudioArguments(StreamState state, EncodingOptions encodingOptions); + /// <summary> /// Gets the video arguments. /// </summary> - /// <param name="state">The state.</param> - /// <returns>System.String.</returns> - protected abstract string GetVideoArguments(StreamState state); + protected abstract string GetVideoArguments(StreamState state, EncodingOptions encodingOptions); /// <summary> /// Gets the segment file extension. @@ -242,10 +240,8 @@ namespace MediaBrowser.Api.Playback.Hls } } - protected override string GetCommandLineArguments(string outputPath, StreamState state, bool isEncoding) + protected override string GetCommandLineArguments(string outputPath, EncodingOptions encodingOptions, StreamState state, bool isEncoding) { - var encodingOptions = ApiEntryPoint.Instance.GetEncodingOptions(); - var itsOffsetMs = 0; var itsOffset = itsOffsetMs == 0 ? string.Empty : string.Format("-itsoffset {0} ", TimeSpan.FromMilliseconds(itsOffsetMs).TotalSeconds.ToString(UsCulture)); @@ -285,8 +281,8 @@ namespace MediaBrowser.Api.Playback.Hls EncodingHelper.GetInputArgument(state, encodingOptions), threads, EncodingHelper.GetMapArgs(state), - GetVideoArguments(state), - GetAudioArguments(state), + GetVideoArguments(state, encodingOptions), + GetAudioArguments(state, encodingOptions), state.SegmentLength.ToString(UsCulture), startNumberParam, outputPath, @@ -306,8 +302,8 @@ namespace MediaBrowser.Api.Playback.Hls EncodingHelper.GetInputArgument(state, encodingOptions), threads, EncodingHelper.GetMapArgs(state), - GetVideoArguments(state), - GetAudioArguments(state), + GetVideoArguments(state, encodingOptions), + GetAudioArguments(state, encodingOptions), state.SegmentLength.ToString(UsCulture), startNumberParam, state.HlsListSize.ToString(UsCulture), diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index c6282bbad5..6744fbd92c 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -18,6 +18,7 @@ using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Services; using MimeTypes = MediaBrowser.Model.Net.MimeTypes; @@ -777,20 +778,20 @@ namespace MediaBrowser.Api.Playback.Hls return ResultFactory.GetResult(playlistText, MimeTypes.GetMimeType("playlist.m3u8"), new Dictionary<string, string>()); } - protected override string GetAudioArguments(StreamState state) + protected override string GetAudioArguments(StreamState state, EncodingOptions encodingOptions) { - var codec = EncodingHelper.GetAudioEncoder(state); + var audioCodec = EncodingHelper.GetAudioEncoder(state); if (!state.IsOutputVideo) { - if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(audioCodec, "copy", StringComparison.OrdinalIgnoreCase)) { return "-acodec copy"; } var audioTranscodeParams = new List<string>(); - audioTranscodeParams.Add("-acodec " + codec); + audioTranscodeParams.Add("-acodec " + audioCodec); if (state.OutputAudioBitrate.HasValue) { @@ -811,12 +812,19 @@ namespace MediaBrowser.Api.Playback.Hls return string.Join(" ", audioTranscodeParams.ToArray()); } - if (string.Equals(codec, "copy", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(audioCodec, "copy", StringComparison.OrdinalIgnoreCase)) { - return "-codec:a:0 copy -copypriorss:a:0 0"; + var videoCodec = EncodingHelper.GetVideoEncoder(state, encodingOptions); + + if (string.Equals(videoCodec, "copy", StringComparison.OrdinalIgnoreCase) && state.EnableBreakOnNonKeyFrames(videoCodec)) + { + return "-codec:a:0 copy -copypriorss:a:0 0"; + } + + return "-codec:a:0 copy"; } - var args = "-codec:a:0 " + codec; + var args = "-codec:a:0 " + audioCodec; var channels = state.OutputAudioChannels; @@ -837,19 +845,19 @@ namespace MediaBrowser.Api.Playback.Hls args += " -ar " + state.OutputAudioSampleRate.Value.ToString(UsCulture); } - args += " " + EncodingHelper.GetAudioFilterParam(state, ApiEntryPoint.Instance.GetEncodingOptions(), true); + args += " " + EncodingHelper.GetAudioFilterParam(state, encodingOptions, true); return args; } - protected override string GetVideoArguments(StreamState state) + protected override string GetVideoArguments(StreamState state, EncodingOptions encodingOptions) { if (!state.IsOutputVideo) { return string.Empty; } - var codec = EncodingHelper.GetVideoEncoder(state, ApiEntryPoint.Instance.GetEncodingOptions()); + var codec = EncodingHelper.GetVideoEncoder(state, encodingOptions); var args = "-codec:v:0 " + codec; @@ -875,8 +883,6 @@ namespace MediaBrowser.Api.Playback.Hls var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode; - var encodingOptions = ApiEntryPoint.Instance.GetEncodingOptions(); - args += " " + EncodingHelper.GetVideoQualityParam(state, codec, encodingOptions, GetDefaultH264Preset()) + keyFrameArg; //args += " -mixed-refs 0 -refs 3 -x264opts b_pyramid=0:weightb=0:weightp=0"; @@ -911,9 +917,8 @@ namespace MediaBrowser.Api.Playback.Hls return args; } - protected override string GetCommandLineArguments(string outputPath, StreamState state, bool isEncoding) + protected override string GetCommandLineArguments(string outputPath, EncodingOptions encodingOptions, StreamState state, bool isEncoding) { - var encodingOptions = ApiEntryPoint.Instance.GetEncodingOptions(); var threads = EncodingHelper.GetNumberOfThreads(state, encodingOptions, false); var inputModifier = EncodingHelper.GetInputModifier(state, encodingOptions); @@ -940,7 +945,7 @@ namespace MediaBrowser.Api.Playback.Hls segmentFormat = "mpegts"; } - var videoCodec = EncodingHelper.GetVideoEncoder(state, ApiEntryPoint.Instance.GetEncodingOptions()); + var videoCodec = EncodingHelper.GetVideoEncoder(state, encodingOptions); var breakOnNonKeyFrames = state.EnableBreakOnNonKeyFrames(videoCodec); var breakOnNonKeyFramesArg = breakOnNonKeyFrames ? " -break_non_keyframes 1" : ""; @@ -950,8 +955,8 @@ namespace MediaBrowser.Api.Playback.Hls EncodingHelper.GetInputArgument(state, encodingOptions), threads, mapArgs, - GetVideoArguments(state), - GetAudioArguments(state), + GetVideoArguments(state, encodingOptions), + GetAudioArguments(state, encodingOptions), state.SegmentLength.ToString(UsCulture), startNumberParam, outputPath, diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs index e32970be53..9b3c8a08f1 100644 --- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs @@ -7,6 +7,7 @@ using MediaBrowser.Model.IO; using MediaBrowser.Model.Serialization; using System; using MediaBrowser.Controller.Net; +using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Services; @@ -31,9 +32,7 @@ namespace MediaBrowser.Api.Playback.Hls /// <summary> /// Gets the audio arguments. /// </summary> - /// <param name="state">The state.</param> - /// <returns>System.String.</returns> - protected override string GetAudioArguments(StreamState state) + protected override string GetAudioArguments(StreamState state, EncodingOptions encodingOptions) { var codec = EncodingHelper.GetAudioEncoder(state); @@ -63,7 +62,7 @@ namespace MediaBrowser.Api.Playback.Hls args += " -ar " + state.OutputAudioSampleRate.Value.ToString(UsCulture); } - args += " " + EncodingHelper.GetAudioFilterParam(state, ApiEntryPoint.Instance.GetEncodingOptions(), true); + args += " " + EncodingHelper.GetAudioFilterParam(state, encodingOptions, true); return args; } @@ -71,11 +70,14 @@ namespace MediaBrowser.Api.Playback.Hls /// <summary> /// Gets the video arguments. /// </summary> - /// <param name="state">The state.</param> - /// <returns>System.String.</returns> - protected override string GetVideoArguments(StreamState state) + protected override string GetVideoArguments(StreamState state, EncodingOptions encodingOptions) { - var codec = EncodingHelper.GetVideoEncoder(state, ApiEntryPoint.Instance.GetEncodingOptions()); + if (!state.IsOutputVideo) + { + return string.Empty; + } + + var codec = EncodingHelper.GetVideoEncoder(state, encodingOptions); var args = "-codec:v:0 " + codec; @@ -101,7 +103,6 @@ namespace MediaBrowser.Api.Playback.Hls var hasGraphicalSubs = state.SubtitleStream != null && !state.SubtitleStream.IsTextSubtitleStream && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode; - var encodingOptions = ApiEntryPoint.Instance.GetEncodingOptions(); args += " " + EncodingHelper.GetVideoQualityParam(state, codec, encodingOptions, GetDefaultH264Preset()) + keyFrameArg; // Add resolution params, if specified diff --git a/MediaBrowser.Api/Playback/MediaInfoService.cs b/MediaBrowser.Api/Playback/MediaInfoService.cs index 6853ddbebf..536236f5fe 100644 --- a/MediaBrowser.Api/Playback/MediaInfoService.cs +++ b/MediaBrowser.Api/Playback/MediaInfoService.cs @@ -134,7 +134,7 @@ namespace MediaBrowser.Api.Playback SetDeviceSpecificData(item, result.MediaSource, profile, authInfo, request.MaxStreamingBitrate, request.StartTimeTicks ?? 0, result.MediaSource.Id, request.AudioStreamIndex, - request.SubtitleStreamIndex, request.MaxAudioChannels, request.PlaySessionId, request.UserId, request.EnableDirectPlay, request.ForceDirectPlayRemoteMediaSource, request.EnableDirectStream, true, true, true); + request.SubtitleStreamIndex, request.MaxAudioChannels, request.PlaySessionId, request.UserId, request.EnableDirectPlay, true, request.EnableDirectStream, true, true, true); } else { @@ -176,7 +176,7 @@ namespace MediaBrowser.Api.Playback { var mediaSourceId = request.MediaSourceId; - SetDeviceSpecificData(request.Id, info, profile, authInfo, request.MaxStreamingBitrate ?? profile.MaxStreamingBitrate, request.StartTimeTicks ?? 0, mediaSourceId, request.AudioStreamIndex, request.SubtitleStreamIndex, request.MaxAudioChannels, request.UserId, request.EnableDirectPlay, request.ForceDirectPlayRemoteMediaSource, request.EnableDirectStream, request.EnableTranscoding, request.AllowVideoStreamCopy, request.AllowAudioStreamCopy); + SetDeviceSpecificData(request.Id, info, profile, authInfo, request.MaxStreamingBitrate ?? profile.MaxStreamingBitrate, request.StartTimeTicks ?? 0, mediaSourceId, request.AudioStreamIndex, request.SubtitleStreamIndex, request.MaxAudioChannels, request.UserId, request.EnableDirectPlay, true, request.EnableDirectStream, request.EnableTranscoding, request.AllowVideoStreamCopy, request.AllowAudioStreamCopy); } if (request.AutoOpenLiveStream) @@ -191,7 +191,6 @@ namespace MediaBrowser.Api.Playback DeviceProfile = request.DeviceProfile, EnableDirectPlay = request.EnableDirectPlay, EnableDirectStream = request.EnableDirectStream, - ForceDirectPlayRemoteMediaSource = request.ForceDirectPlayRemoteMediaSource, ItemId = request.Id, MaxAudioChannels = request.MaxAudioChannels, MaxStreamingBitrate = request.MaxStreamingBitrate, @@ -199,7 +198,8 @@ namespace MediaBrowser.Api.Playback StartTimeTicks = request.StartTimeTicks, SubtitleStreamIndex = request.SubtitleStreamIndex, UserId = request.UserId, - OpenToken = mediaSource.OpenToken + OpenToken = mediaSource.OpenToken, + EnableMediaProbe = request.EnableMediaProbe }).ConfigureAwait(false); diff --git a/MediaBrowser.Api/Playback/Progressive/AudioService.cs b/MediaBrowser.Api/Playback/Progressive/AudioService.cs index af8670eb15..44e096dd7f 100644 --- a/MediaBrowser.Api/Playback/Progressive/AudioService.cs +++ b/MediaBrowser.Api/Playback/Progressive/AudioService.cs @@ -10,6 +10,7 @@ using MediaBrowser.Model.Serialization; using System.Collections.Generic; using System.Threading.Tasks; using MediaBrowser.Controller.Net; +using MediaBrowser.Model.Configuration; using MediaBrowser.Model.IO; using MediaBrowser.Model.Services; using MediaBrowser.Model.System; @@ -58,10 +59,8 @@ namespace MediaBrowser.Api.Playback.Progressive return ProcessRequest(request, true); } - protected override string GetCommandLineArguments(string outputPath, StreamState state, bool isEncoding) + protected override string GetCommandLineArguments(string outputPath, EncodingOptions encodingOptions, StreamState state, bool isEncoding) { - var encodingOptions = ApiEntryPoint.Instance.GetEncodingOptions(); - return EncodingHelper.GetProgressiveAudioFullCommandLine(state, encodingOptions, outputPath); } } diff --git a/MediaBrowser.Api/Playback/Progressive/VideoService.cs b/MediaBrowser.Api/Playback/Progressive/VideoService.cs index 5e21f6a841..a41b4cbf54 100644 --- a/MediaBrowser.Api/Playback/Progressive/VideoService.cs +++ b/MediaBrowser.Api/Playback/Progressive/VideoService.cs @@ -8,6 +8,7 @@ using MediaBrowser.Model.IO; using MediaBrowser.Model.Serialization; using System.Threading.Tasks; using MediaBrowser.Controller.Net; +using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Services; using MediaBrowser.Model.System; @@ -91,10 +92,8 @@ namespace MediaBrowser.Api.Playback.Progressive return ProcessRequest(request, true); } - protected override string GetCommandLineArguments(string outputPath, StreamState state, bool isEncoding) + protected override string GetCommandLineArguments(string outputPath, EncodingOptions encodingOptions, StreamState state, bool isEncoding) { - var encodingOptions = ApiEntryPoint.Instance.GetEncodingOptions(); - return EncodingHelper.GetProgressiveVideoFullCommandLine(state, encodingOptions, outputPath, GetDefaultH264Preset()); } } diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs index 2cf7d81af7..eecc124324 100644 --- a/MediaBrowser.Api/Playback/StreamState.cs +++ b/MediaBrowser.Api/Playback/StreamState.cs @@ -80,7 +80,7 @@ namespace MediaBrowser.Api.Playback return 6; } - return 10; + return 6; } if (IsSegmentedLiveStream) diff --git a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs index 3b638208b5..4bb3de8826 100644 --- a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs +++ b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs @@ -224,7 +224,7 @@ namespace MediaBrowser.Api.UserLibrary [ApiMember(Name = "ParentId", Description = "Specify this to localize the search to a specific item or folder. Omit to use the root", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] public string ParentId { get; set; } - [ApiMember(Name = "Fields", Description = "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimeted. Options: Budget, Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, Revenue, SortName, Studios, Taglines", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] + [ApiMember(Name = "Fields", Description = "Optional. Specify additional fields of information to return in the output. This allows multiple, comma delimeted. Options: Chapters, DateCreated, Genres, HomePageUrl, IndexOptions, MediaStreams, Overview, ParentId, Path, People, ProviderIds, PrimaryImageAspectRatio, SortName, Studios, Taglines", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] public string Fields { get; set; } [ApiMember(Name = "IncludeItemTypes", Description = "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)] |
