More style changes

pull/1159/head
Bond_009 6 years ago
parent 93e535d3a1
commit ca37ca291f

@ -686,7 +686,7 @@ namespace MediaBrowser.Api.Playback
var enableDlnaHeaders = !string.IsNullOrWhiteSpace(request.Params) /*|| var enableDlnaHeaders = !string.IsNullOrWhiteSpace(request.Params) /*||
string.Equals(Request.Headers.Get("GetContentFeatures.DLNA.ORG"), "1", StringComparison.OrdinalIgnoreCase)*/; string.Equals(Request.Headers.Get("GetContentFeatures.DLNA.ORG"), "1", StringComparison.OrdinalIgnoreCase)*/;
var state = new StreamState(MediaSourceManager, Logger, TranscodingJobType) var state = new StreamState(MediaSourceManager, TranscodingJobType)
{ {
Request = request, Request = request,
RequestedUrl = url, RequestedUrl = url,
@ -756,11 +756,11 @@ namespace MediaBrowser.Api.Playback
mediaSource = string.IsNullOrEmpty(request.MediaSourceId) mediaSource = string.IsNullOrEmpty(request.MediaSourceId)
? mediaSources[0] ? mediaSources[0]
: mediaSources.FirstOrDefault(i => string.Equals(i.Id, request.MediaSourceId)); : mediaSources.Find(i => string.Equals(i.Id, request.MediaSourceId));
if (mediaSource == null && request.MediaSourceId.Equals(request.Id)) if (mediaSource == null && request.MediaSourceId.Equals(request.Id))
{ {
mediaSource = mediaSources.First(); mediaSource = mediaSources[0];
} }
} }
} }

@ -2,13 +2,11 @@ using System;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Dlna;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.Api.Playback namespace MediaBrowser.Api.Playback
{ {
public class StreamState : EncodingJobInfo, IDisposable public class StreamState : EncodingJobInfo, IDisposable
{ {
private readonly ILogger _logger;
private readonly IMediaSourceManager _mediaSourceManager; private readonly IMediaSourceManager _mediaSourceManager;
private bool _disposed = false; private bool _disposed = false;
@ -99,11 +97,10 @@ namespace MediaBrowser.Api.Playback
public TranscodingJob TranscodingJob { get; set; } public TranscodingJob TranscodingJob { get; set; }
public StreamState(IMediaSourceManager mediaSourceManager, ILogger logger, TranscodingJobType transcodingType) public StreamState(IMediaSourceManager mediaSourceManager, TranscodingJobType transcodingType)
: base(transcodingType) : base(transcodingType)
{ {
_mediaSourceManager = mediaSourceManager; _mediaSourceManager = mediaSourceManager;
_logger = logger;
} }
public override void ReportTranscodingProgress(TimeSpan? transcodingPosition, float framerate, double? percentComplete, long bytesTranscoded, int? bitRate) public override void ReportTranscodingProgress(TimeSpan? transcodingPosition, float framerate, double? percentComplete, long bytesTranscoded, int? bitRate)

Loading…
Cancel
Save