mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 18:14:42 +01:00
ReSharper conform to 'var' settings
This commit is contained in:
@@ -100,7 +100,7 @@ namespace MediaBrowser.Model.Configuration
|
||||
|
||||
public ImageOption GetImageOptions(ImageType type)
|
||||
{
|
||||
foreach (ImageOption i in ImageOptions)
|
||||
foreach (var i in ImageOptions)
|
||||
{
|
||||
if (i.Type == type)
|
||||
{
|
||||
@@ -111,7 +111,7 @@ namespace MediaBrowser.Model.Configuration
|
||||
ImageOption[] options;
|
||||
if (DefaultImageOptions.TryGetValue(Type, out options))
|
||||
{
|
||||
foreach (ImageOption i in options)
|
||||
foreach (var i in options)
|
||||
{
|
||||
if (i.Type == type)
|
||||
{
|
||||
|
||||
@@ -267,7 +267,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
return !condition.IsRequired;
|
||||
}
|
||||
|
||||
TransportStreamTimestamp expected = (TransportStreamTimestamp)Enum.Parse(typeof(TransportStreamTimestamp), condition.Value, true);
|
||||
var expected = (TransportStreamTimestamp)Enum.Parse(typeof(TransportStreamTimestamp), condition.Value, true);
|
||||
|
||||
switch (condition.Condition)
|
||||
{
|
||||
|
||||
@@ -24,14 +24,14 @@ namespace MediaBrowser.Model.Dlna
|
||||
// 0 = native, 1 = transcoded
|
||||
var orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";
|
||||
|
||||
DlnaFlags flagValue = DlnaFlags.BackgroundTransferMode |
|
||||
var flagValue = DlnaFlags.BackgroundTransferMode |
|
||||
DlnaFlags.InteractiveTransferMode |
|
||||
DlnaFlags.DlnaV15;
|
||||
|
||||
string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
|
||||
DlnaMaps.FlagsToString(flagValue));
|
||||
|
||||
ResponseProfile mediaProfile = _profile.GetImageMediaProfile(container,
|
||||
var mediaProfile = _profile.GetImageMediaProfile(container,
|
||||
width,
|
||||
height);
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
// 0 = native, 1 = transcoded
|
||||
string orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";
|
||||
|
||||
DlnaFlags flagValue = DlnaFlags.StreamingTransferMode |
|
||||
var flagValue = DlnaFlags.StreamingTransferMode |
|
||||
DlnaFlags.BackgroundTransferMode |
|
||||
DlnaFlags.InteractiveTransferMode |
|
||||
DlnaFlags.DlnaV15;
|
||||
@@ -83,7 +83,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
|
||||
DlnaMaps.FlagsToString(flagValue));
|
||||
|
||||
ResponseProfile mediaProfile = _profile.GetAudioMediaProfile(container,
|
||||
var mediaProfile = _profile.GetAudioMediaProfile(container,
|
||||
audioCodec,
|
||||
audioChannels,
|
||||
audioBitrate,
|
||||
@@ -131,7 +131,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
// 0 = native, 1 = transcoded
|
||||
string orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";
|
||||
|
||||
DlnaFlags flagValue = DlnaFlags.StreamingTransferMode |
|
||||
var flagValue = DlnaFlags.StreamingTransferMode |
|
||||
DlnaFlags.BackgroundTransferMode |
|
||||
DlnaFlags.InteractiveTransferMode |
|
||||
DlnaFlags.DlnaV15;
|
||||
@@ -148,7 +148,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
|
||||
DlnaMaps.FlagsToString(flagValue));
|
||||
|
||||
ResponseProfile mediaProfile = _profile.GetVideoMediaProfile(container,
|
||||
var mediaProfile = _profile.GetVideoMediaProfile(container,
|
||||
audioCodec,
|
||||
videoCodec,
|
||||
width,
|
||||
@@ -168,7 +168,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
videoCodecTag,
|
||||
isAvc);
|
||||
|
||||
List<string> orgPnValues = new List<string>();
|
||||
var orgPnValues = new List<string>();
|
||||
|
||||
if (mediaProfile != null && !string.IsNullOrEmpty(mediaProfile.OrgPn))
|
||||
{
|
||||
@@ -183,7 +183,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
}
|
||||
|
||||
List<string> contentFeatureList = new List<string>();
|
||||
var contentFeatureList = new List<string>();
|
||||
|
||||
foreach (string orgPn in orgPnValues)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
/// Gets or sets the identification.
|
||||
/// </summary>
|
||||
/// <value>The identification.</value>
|
||||
public MediaBrowser.Model.Dlna.DeviceIdentification Identification { get; set; }
|
||||
public DeviceIdentification Identification { get; set; }
|
||||
|
||||
public string FriendlyName { get; set; }
|
||||
public string Manufacturer { get; set; }
|
||||
@@ -191,7 +191,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
var conditionProcessor = new ConditionProcessor();
|
||||
|
||||
var anyOff = false;
|
||||
foreach (ProfileCondition c in i.Conditions)
|
||||
foreach (var c in i.Conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsAudioConditionSatisfied(GetModelProfileCondition(c), audioChannels, audioBitrate, audioSampleRate, audioBitDepth))
|
||||
{
|
||||
@@ -238,7 +238,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
var conditionProcessor = new ConditionProcessor();
|
||||
|
||||
var anyOff = false;
|
||||
foreach (ProfileCondition c in i.Conditions)
|
||||
foreach (var c in i.Conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsImageConditionSatisfied(GetModelProfileCondition(c), width, height))
|
||||
{
|
||||
@@ -304,7 +304,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
var conditionProcessor = new ConditionProcessor();
|
||||
|
||||
var anyOff = false;
|
||||
foreach (ProfileCondition c in i.Conditions)
|
||||
foreach (var c in i.Conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsVideoConditionSatisfied(GetModelProfileCondition(c), width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg2video"))
|
||||
{
|
||||
List<MediaFormatProfile> list = new List<MediaFormatProfile>();
|
||||
var list = new List<MediaFormatProfile>();
|
||||
|
||||
list.Add(ValueOf("MPEG_TS_SD_NA" + suffix));
|
||||
list.Add(ValueOf("MPEG_TS_SD_EU" + suffix));
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
ValidateAudioInput(options);
|
||||
|
||||
var mediaSources = new List<MediaSourceInfo>();
|
||||
foreach (MediaSourceInfo i in options.MediaSources)
|
||||
foreach (var i in options.MediaSources)
|
||||
{
|
||||
if (string.IsNullOrEmpty(options.MediaSourceId) ||
|
||||
StringHelper.EqualsIgnoreCase(i.Id, options.MediaSourceId))
|
||||
@@ -42,16 +42,16 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
var streams = new List<StreamInfo>();
|
||||
foreach (MediaSourceInfo i in mediaSources)
|
||||
foreach (var i in mediaSources)
|
||||
{
|
||||
StreamInfo streamInfo = BuildAudioItem(i, options);
|
||||
var streamInfo = BuildAudioItem(i, options);
|
||||
if (streamInfo != null)
|
||||
{
|
||||
streams.Add(streamInfo);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (StreamInfo stream in streams)
|
||||
foreach (var stream in streams)
|
||||
{
|
||||
stream.DeviceId = options.DeviceId;
|
||||
stream.DeviceProfileId = options.Profile.Id;
|
||||
@@ -65,7 +65,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
ValidateInput(options);
|
||||
|
||||
var mediaSources = new List<MediaSourceInfo>();
|
||||
foreach (MediaSourceInfo i in options.MediaSources)
|
||||
foreach (var i in options.MediaSources)
|
||||
{
|
||||
if (string.IsNullOrEmpty(options.MediaSourceId) ||
|
||||
StringHelper.EqualsIgnoreCase(i.Id, options.MediaSourceId))
|
||||
@@ -75,16 +75,16 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
var streams = new List<StreamInfo>();
|
||||
foreach (MediaSourceInfo i in mediaSources)
|
||||
foreach (var i in mediaSources)
|
||||
{
|
||||
StreamInfo streamInfo = BuildVideoItem(i, options);
|
||||
var streamInfo = BuildVideoItem(i, options);
|
||||
if (streamInfo != null)
|
||||
{
|
||||
streams.Add(streamInfo);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (StreamInfo stream in streams)
|
||||
foreach (var stream in streams)
|
||||
{
|
||||
stream.DeviceId = options.DeviceId;
|
||||
stream.DeviceProfileId = options.Profile.Id;
|
||||
@@ -97,7 +97,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
var sorted = SortMediaSources(streams, maxBitrate);
|
||||
|
||||
foreach (StreamInfo stream in sorted)
|
||||
foreach (var stream in sorted)
|
||||
{
|
||||
return stream;
|
||||
}
|
||||
@@ -284,7 +284,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
var transcodeReasons = new List<TranscodeReason>();
|
||||
|
||||
StreamInfo playlistItem = new StreamInfo
|
||||
var playlistItem = new StreamInfo
|
||||
{
|
||||
ItemId = options.ItemId,
|
||||
MediaType = DlnaProfileType.Audio,
|
||||
@@ -308,14 +308,14 @@ namespace MediaBrowser.Model.Dlna
|
||||
return playlistItem;
|
||||
}
|
||||
|
||||
MediaStream audioStream = item.GetDefaultAudioStream(null);
|
||||
var audioStream = item.GetDefaultAudioStream(null);
|
||||
|
||||
var directPlayInfo = GetAudioDirectPlayMethods(item, audioStream, options);
|
||||
|
||||
var directPlayMethods = directPlayInfo.Item1;
|
||||
transcodeReasons.AddRange(directPlayInfo.Item2);
|
||||
|
||||
ConditionProcessor conditionProcessor = new ConditionProcessor();
|
||||
var conditionProcessor = new ConditionProcessor();
|
||||
|
||||
int? inputAudioChannels = audioStream == null ? null : audioStream.Channels;
|
||||
int? inputAudioBitrate = audioStream == null ? null : audioStream.BitDepth;
|
||||
@@ -328,12 +328,12 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
// Make sure audio codec profiles are satisfied
|
||||
var conditions = new List<ProfileCondition>();
|
||||
foreach (CodecProfile i in options.Profile.CodecProfiles)
|
||||
foreach (var i in options.Profile.CodecProfiles)
|
||||
{
|
||||
if (i.Type == CodecType.Audio && i.ContainsAnyCodec(audioCodec, item.Container))
|
||||
{
|
||||
bool applyConditions = true;
|
||||
foreach (ProfileCondition applyCondition in i.ApplyConditions)
|
||||
foreach (var applyCondition in i.ApplyConditions)
|
||||
{
|
||||
if (!conditionProcessor.IsAudioConditionSatisfied(applyCondition, inputAudioChannels, inputAudioBitrate, inputAudioSampleRate, inputAudioBitDepth))
|
||||
{
|
||||
@@ -345,7 +345,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (applyConditions)
|
||||
{
|
||||
foreach (ProfileCondition c in i.Conditions)
|
||||
foreach (var c in i.Conditions)
|
||||
{
|
||||
conditions.Add(c);
|
||||
}
|
||||
@@ -354,7 +354,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
bool all = true;
|
||||
foreach (ProfileCondition c in conditions)
|
||||
foreach (var c in conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsAudioConditionSatisfied(c, inputAudioChannels, inputAudioBitrate, inputAudioSampleRate, inputAudioBitDepth))
|
||||
{
|
||||
@@ -383,7 +383,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
TranscodingProfile transcodingProfile = null;
|
||||
foreach (TranscodingProfile i in options.Profile.TranscodingProfiles)
|
||||
foreach (var i in options.Profile.TranscodingProfiles)
|
||||
{
|
||||
if (i.Type == playlistItem.MediaType && i.Context == options.Context)
|
||||
{
|
||||
@@ -405,7 +405,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
SetStreamInfoOptionsFromTranscodingProfile(playlistItem, transcodingProfile);
|
||||
|
||||
var audioCodecProfiles = new List<CodecProfile>();
|
||||
foreach (CodecProfile i in options.Profile.CodecProfiles)
|
||||
foreach (var i in options.Profile.CodecProfiles)
|
||||
{
|
||||
if (i.Type == CodecType.Audio && i.ContainsAnyCodec(transcodingProfile.AudioCodec, transcodingProfile.Container))
|
||||
{
|
||||
@@ -416,10 +416,10 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
var audioTranscodingConditions = new List<ProfileCondition>();
|
||||
foreach (CodecProfile i in audioCodecProfiles)
|
||||
foreach (var i in audioCodecProfiles)
|
||||
{
|
||||
bool applyConditions = true;
|
||||
foreach (ProfileCondition applyCondition in i.ApplyConditions)
|
||||
foreach (var applyCondition in i.ApplyConditions)
|
||||
{
|
||||
if (!conditionProcessor.IsAudioConditionSatisfied(applyCondition, inputAudioChannels, inputAudioBitrate, inputAudioSampleRate, inputAudioBitDepth))
|
||||
{
|
||||
@@ -431,7 +431,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (applyConditions)
|
||||
{
|
||||
foreach (ProfileCondition c in i.Conditions)
|
||||
foreach (var c in i.Conditions)
|
||||
{
|
||||
audioTranscodingConditions.Add(c);
|
||||
}
|
||||
@@ -478,7 +478,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
var transcodeReasons = new List<TranscodeReason>();
|
||||
|
||||
DirectPlayProfile directPlayProfile = null;
|
||||
foreach (DirectPlayProfile i in options.Profile.DirectPlayProfiles)
|
||||
foreach (var i in options.Profile.DirectPlayProfiles)
|
||||
{
|
||||
if (i.Type == DlnaProfileType.Audio && IsAudioDirectPlaySupported(i, item, audioStream))
|
||||
{
|
||||
@@ -607,7 +607,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
int highestScore = -1;
|
||||
|
||||
foreach (MediaStream stream in item.MediaStreams)
|
||||
foreach (var stream in item.MediaStreams)
|
||||
{
|
||||
if (stream.Type == MediaStreamType.Subtitle && stream.Score.HasValue)
|
||||
{
|
||||
@@ -619,7 +619,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
var topStreams = new List<MediaStream>();
|
||||
foreach (MediaStream stream in item.MediaStreams)
|
||||
foreach (var stream in item.MediaStreams)
|
||||
{
|
||||
if (stream.Type == MediaStreamType.Subtitle && stream.Score.HasValue && stream.Score.Value == highestScore)
|
||||
{
|
||||
@@ -630,9 +630,9 @@ namespace MediaBrowser.Model.Dlna
|
||||
// If multiple streams have an equal score, try to pick the most efficient one
|
||||
if (topStreams.Count > 1)
|
||||
{
|
||||
foreach (MediaStream stream in topStreams)
|
||||
foreach (var stream in topStreams)
|
||||
{
|
||||
foreach (SubtitleProfile profile in subtitleProfiles)
|
||||
foreach (var profile in subtitleProfiles)
|
||||
{
|
||||
if (profile.Method == SubtitleDeliveryMethod.External && StringHelper.EqualsIgnoreCase(profile.Format, stream.Codec))
|
||||
{
|
||||
@@ -705,7 +705,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
var transcodeReasons = new List<TranscodeReason>();
|
||||
|
||||
StreamInfo playlistItem = new StreamInfo
|
||||
var playlistItem = new StreamInfo
|
||||
{
|
||||
ItemId = options.ItemId,
|
||||
MediaType = DlnaProfileType.Video,
|
||||
@@ -716,15 +716,15 @@ namespace MediaBrowser.Model.Dlna
|
||||
};
|
||||
|
||||
playlistItem.SubtitleStreamIndex = options.SubtitleStreamIndex ?? GetDefaultSubtitleStreamIndex(item, options.Profile.SubtitleProfiles);
|
||||
MediaStream subtitleStream = playlistItem.SubtitleStreamIndex.HasValue ? item.GetMediaStream(MediaStreamType.Subtitle, playlistItem.SubtitleStreamIndex.Value) : null;
|
||||
var subtitleStream = playlistItem.SubtitleStreamIndex.HasValue ? item.GetMediaStream(MediaStreamType.Subtitle, playlistItem.SubtitleStreamIndex.Value) : null;
|
||||
|
||||
MediaStream audioStream = item.GetDefaultAudioStream(options.AudioStreamIndex ?? item.DefaultAudioStreamIndex);
|
||||
var audioStream = item.GetDefaultAudioStream(options.AudioStreamIndex ?? item.DefaultAudioStreamIndex);
|
||||
if (audioStream != null)
|
||||
{
|
||||
playlistItem.AudioStreamIndex = audioStream.Index;
|
||||
}
|
||||
|
||||
MediaStream videoStream = item.VideoStream;
|
||||
var videoStream = item.VideoStream;
|
||||
|
||||
// TODO: This doesn't accout for situation of device being able to handle media bitrate, but wifi connection not fast enough
|
||||
var directPlayEligibilityResult = IsEligibleForDirectPlay(item, GetBitrateForDirectPlayCheck(item, options, true) ?? 0, subtitleStream, options, PlayMethod.DirectPlay);
|
||||
@@ -751,7 +751,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (subtitleStream != null)
|
||||
{
|
||||
SubtitleProfile subtitleProfile = GetSubtitleProfile(item, subtitleStream, options.Profile.SubtitleProfiles, directPlay.Value, _transcoderSupport, item.Container, null);
|
||||
var subtitleProfile = GetSubtitleProfile(item, subtitleStream, options.Profile.SubtitleProfiles, directPlay.Value, _transcoderSupport, item.Container, null);
|
||||
|
||||
playlistItem.SubtitleDeliveryMethod = subtitleProfile.Method;
|
||||
playlistItem.SubtitleFormat = subtitleProfile.Format;
|
||||
@@ -775,7 +775,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
// Can't direct play, find the transcoding profile
|
||||
TranscodingProfile transcodingProfile = null;
|
||||
foreach (TranscodingProfile i in options.Profile.TranscodingProfiles)
|
||||
foreach (var i in options.Profile.TranscodingProfiles)
|
||||
{
|
||||
if (i.Type == playlistItem.MediaType && i.Context == options.Context)
|
||||
{
|
||||
@@ -793,7 +793,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (subtitleStream != null)
|
||||
{
|
||||
SubtitleProfile subtitleProfile = GetSubtitleProfile(item, subtitleStream, options.Profile.SubtitleProfiles, PlayMethod.Transcode, _transcoderSupport, transcodingProfile.Container, transcodingProfile.Protocol);
|
||||
var subtitleProfile = GetSubtitleProfile(item, subtitleStream, options.Profile.SubtitleProfiles, PlayMethod.Transcode, _transcoderSupport, transcodingProfile.Container, transcodingProfile.Protocol);
|
||||
|
||||
playlistItem.SubtitleDeliveryMethod = subtitleProfile.Method;
|
||||
playlistItem.SubtitleFormat = subtitleProfile.Format;
|
||||
@@ -804,15 +804,15 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
SetStreamInfoOptionsFromTranscodingProfile(playlistItem, transcodingProfile);
|
||||
|
||||
ConditionProcessor conditionProcessor = new ConditionProcessor();
|
||||
var conditionProcessor = new ConditionProcessor();
|
||||
|
||||
var isFirstAppliedCodecProfile = true;
|
||||
foreach (CodecProfile i in options.Profile.CodecProfiles)
|
||||
foreach (var i in options.Profile.CodecProfiles)
|
||||
{
|
||||
if (i.Type == CodecType.Video && i.ContainsAnyCodec(transcodingProfile.VideoCodec, transcodingProfile.Container))
|
||||
{
|
||||
bool applyConditions = true;
|
||||
foreach (ProfileCondition applyCondition in i.ApplyConditions)
|
||||
foreach (var applyCondition in i.ApplyConditions)
|
||||
{
|
||||
int? width = videoStream == null ? null : videoStream.Width;
|
||||
int? height = videoStream == null ? null : videoStream.Height;
|
||||
@@ -863,12 +863,12 @@ namespace MediaBrowser.Model.Dlna
|
||||
playlistItem.AudioBitrate = Math.Min(playlistItem.AudioBitrate ?? audioBitrate, audioBitrate);
|
||||
|
||||
isFirstAppliedCodecProfile = true;
|
||||
foreach (CodecProfile i in options.Profile.CodecProfiles)
|
||||
foreach (var i in options.Profile.CodecProfiles)
|
||||
{
|
||||
if (i.Type == CodecType.VideoAudio && i.ContainsAnyCodec(transcodingProfile.AudioCodec, transcodingProfile.Container))
|
||||
{
|
||||
bool applyConditions = true;
|
||||
foreach (ProfileCondition applyCondition in i.ApplyConditions)
|
||||
foreach (var applyCondition in i.ApplyConditions)
|
||||
{
|
||||
bool? isSecondaryAudio = audioStream == null ? null : item.IsSecondaryAudio(audioStream);
|
||||
int? inputAudioBitrate = audioStream == null ? null : audioStream.BitRate;
|
||||
@@ -998,7 +998,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
bool isEligibleForDirectPlay,
|
||||
bool isEligibleForDirectStream)
|
||||
{
|
||||
DeviceProfile profile = options.Profile;
|
||||
var profile = options.Profile;
|
||||
|
||||
if (options.ForceDirectPlay)
|
||||
{
|
||||
@@ -1011,7 +1011,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
// See if it can be direct played
|
||||
DirectPlayProfile directPlay = null;
|
||||
foreach (DirectPlayProfile i in profile.DirectPlayProfiles)
|
||||
foreach (var i in profile.DirectPlayProfiles)
|
||||
{
|
||||
if (i.Type == DlnaProfileType.Video && IsVideoDirectPlaySupported(i, mediaSource, videoStream, audioStream))
|
||||
{
|
||||
@@ -1032,19 +1032,19 @@ namespace MediaBrowser.Model.Dlna
|
||||
string container = mediaSource.Container;
|
||||
|
||||
var conditions = new List<ProfileCondition>();
|
||||
foreach (ContainerProfile i in profile.ContainerProfiles)
|
||||
foreach (var i in profile.ContainerProfiles)
|
||||
{
|
||||
if (i.Type == DlnaProfileType.Video &&
|
||||
i.ContainsContainer(container))
|
||||
{
|
||||
foreach (ProfileCondition c in i.Conditions)
|
||||
foreach (var c in i.Conditions)
|
||||
{
|
||||
conditions.Add(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ConditionProcessor conditionProcessor = new ConditionProcessor();
|
||||
var conditionProcessor = new ConditionProcessor();
|
||||
|
||||
int? width = videoStream == null ? null : videoStream.Width;
|
||||
int? height = videoStream == null ? null : videoStream.Height;
|
||||
@@ -1072,7 +1072,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
int? numVideoStreams = mediaSource.GetStreamCount(MediaStreamType.Video);
|
||||
|
||||
// Check container conditions
|
||||
foreach (ProfileCondition i in conditions)
|
||||
foreach (var i in conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsVideoConditionSatisfied(i, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
|
||||
{
|
||||
@@ -1090,12 +1090,12 @@ namespace MediaBrowser.Model.Dlna
|
||||
string videoCodec = videoStream == null ? null : videoStream.Codec;
|
||||
|
||||
conditions = new List<ProfileCondition>();
|
||||
foreach (CodecProfile i in profile.CodecProfiles)
|
||||
foreach (var i in profile.CodecProfiles)
|
||||
{
|
||||
if (i.Type == CodecType.Video && i.ContainsAnyCodec(videoCodec, container))
|
||||
{
|
||||
bool applyConditions = true;
|
||||
foreach (ProfileCondition applyCondition in i.ApplyConditions)
|
||||
foreach (var applyCondition in i.ApplyConditions)
|
||||
{
|
||||
if (!conditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
|
||||
{
|
||||
@@ -1107,7 +1107,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (applyConditions)
|
||||
{
|
||||
foreach (ProfileCondition c in i.Conditions)
|
||||
foreach (var c in i.Conditions)
|
||||
{
|
||||
conditions.Add(c);
|
||||
}
|
||||
@@ -1115,7 +1115,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
}
|
||||
|
||||
foreach (ProfileCondition i in conditions)
|
||||
foreach (var i in conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsVideoConditionSatisfied(i, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
|
||||
{
|
||||
@@ -1137,12 +1137,12 @@ namespace MediaBrowser.Model.Dlna
|
||||
conditions = new List<ProfileCondition>();
|
||||
bool? isSecondaryAudio = audioStream == null ? null : mediaSource.IsSecondaryAudio(audioStream);
|
||||
|
||||
foreach (CodecProfile i in profile.CodecProfiles)
|
||||
foreach (var i in profile.CodecProfiles)
|
||||
{
|
||||
if (i.Type == CodecType.VideoAudio && i.ContainsAnyCodec(audioCodec, container))
|
||||
{
|
||||
bool applyConditions = true;
|
||||
foreach (ProfileCondition applyCondition in i.ApplyConditions)
|
||||
foreach (var applyCondition in i.ApplyConditions)
|
||||
{
|
||||
if (!conditionProcessor.IsVideoAudioConditionSatisfied(applyCondition, audioChannels, audioBitrate, audioSampleRate, audioBitDepth, audioProfile, isSecondaryAudio))
|
||||
{
|
||||
@@ -1154,7 +1154,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (applyConditions)
|
||||
{
|
||||
foreach (ProfileCondition c in i.Conditions)
|
||||
foreach (var c in i.Conditions)
|
||||
{
|
||||
conditions.Add(c);
|
||||
}
|
||||
@@ -1162,7 +1162,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
}
|
||||
|
||||
foreach (ProfileCondition i in conditions)
|
||||
foreach (var i in conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsVideoAudioConditionSatisfied(i, audioChannels, audioBitrate, audioSampleRate, audioBitDepth, audioProfile, isSecondaryAudio))
|
||||
{
|
||||
@@ -1206,7 +1206,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
if (subtitleStream != null)
|
||||
{
|
||||
SubtitleProfile subtitleProfile = GetSubtitleProfile(item, subtitleStream, options.Profile.SubtitleProfiles, playMethod, _transcoderSupport, item.Container, null);
|
||||
var subtitleProfile = GetSubtitleProfile(item, subtitleStream, options.Profile.SubtitleProfiles, playMethod, _transcoderSupport, item.Container, null);
|
||||
|
||||
if (subtitleProfile.Method != SubtitleDeliveryMethod.External && subtitleProfile.Method != SubtitleDeliveryMethod.Embed)
|
||||
{
|
||||
@@ -1230,7 +1230,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
if (!subtitleStream.IsExternal && (playMethod != PlayMethod.Transcode || !string.Equals(transcodingSubProtocol, "hls", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
// Look for supported embedded subs of the same format
|
||||
foreach (SubtitleProfile profile in subtitleProfiles)
|
||||
foreach (var profile in subtitleProfiles)
|
||||
{
|
||||
if (!profile.SupportsLanguage(subtitleStream.Language))
|
||||
{
|
||||
@@ -1259,7 +1259,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
// Look for supported embedded subs of a convertible format
|
||||
foreach (SubtitleProfile profile in subtitleProfiles)
|
||||
foreach (var profile in subtitleProfiles)
|
||||
{
|
||||
if (!profile.SupportsLanguage(subtitleStream.Language))
|
||||
{
|
||||
@@ -1328,7 +1328,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
private static SubtitleProfile GetExternalSubtitleProfile(MediaSourceInfo mediaSource, MediaStream subtitleStream, SubtitleProfile[] subtitleProfiles, PlayMethod playMethod, ITranscoderSupport transcoderSupport, bool allowConversion)
|
||||
{
|
||||
foreach (SubtitleProfile profile in subtitleProfiles)
|
||||
foreach (var profile in subtitleProfiles)
|
||||
{
|
||||
if (profile.Method != SubtitleDeliveryMethod.External && profile.Method != SubtitleDeliveryMethod.Hls)
|
||||
{
|
||||
@@ -1467,7 +1467,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
private void ApplyTranscodingConditions(StreamInfo item, IEnumerable<ProfileCondition> conditions, string qualifier, bool enableQualifiedConditions, bool enableNonQualifiedConditions)
|
||||
{
|
||||
foreach (ProfileCondition condition in conditions)
|
||||
foreach (var condition in conditions)
|
||||
{
|
||||
string value = condition.Value;
|
||||
|
||||
|
||||
@@ -145,8 +145,8 @@ namespace MediaBrowser.Model.Dlna
|
||||
throw new ArgumentNullException(nameof(baseUrl));
|
||||
}
|
||||
|
||||
List<string> list = new List<string>();
|
||||
foreach (NameValuePair pair in BuildParams(this, accessToken))
|
||||
var list = new List<string>();
|
||||
foreach (var pair in BuildParams(this, accessToken))
|
||||
{
|
||||
if (string.IsNullOrEmpty(pair.Value))
|
||||
{
|
||||
@@ -211,7 +211,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
private static List<NameValuePair> BuildParams(StreamInfo item, string accessToken)
|
||||
{
|
||||
List<NameValuePair> list = new List<NameValuePair>();
|
||||
var list = new List<NameValuePair>();
|
||||
|
||||
string audioCodecs = item.AudioCodecs.Length == 0 ?
|
||||
string.Empty :
|
||||
@@ -346,11 +346,11 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
public List<SubtitleStreamInfo> GetExternalSubtitles(ITranscoderSupport transcoderSupport, bool includeSelectedTrackOnly, bool enableAllProfiles, string baseUrl, string accessToken)
|
||||
{
|
||||
List<SubtitleStreamInfo> list = GetSubtitleProfiles(transcoderSupport, includeSelectedTrackOnly, enableAllProfiles, baseUrl, accessToken);
|
||||
List<SubtitleStreamInfo> newList = new List<SubtitleStreamInfo>();
|
||||
var list = GetSubtitleProfiles(transcoderSupport, includeSelectedTrackOnly, enableAllProfiles, baseUrl, accessToken);
|
||||
var newList = new List<SubtitleStreamInfo>();
|
||||
|
||||
// First add the selected track
|
||||
foreach (SubtitleStreamInfo stream in list)
|
||||
foreach (var stream in list)
|
||||
{
|
||||
if (stream.DeliveryMethod == SubtitleDeliveryMethod.External)
|
||||
{
|
||||
@@ -368,7 +368,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
public List<SubtitleStreamInfo> GetSubtitleProfiles(ITranscoderSupport transcoderSupport, bool includeSelectedTrackOnly, bool enableAllProfiles, string baseUrl, string accessToken)
|
||||
{
|
||||
List<SubtitleStreamInfo> list = new List<SubtitleStreamInfo>();
|
||||
var list = new List<SubtitleStreamInfo>();
|
||||
|
||||
// HLS will preserve timestamps so we can just grab the full subtitle stream
|
||||
long startPositionTicks = StringHelper.EqualsIgnoreCase(SubProtocol, "hls")
|
||||
@@ -378,7 +378,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
// First add the selected track
|
||||
if (SubtitleStreamIndex.HasValue)
|
||||
{
|
||||
foreach (MediaStream stream in MediaSource.MediaStreams)
|
||||
foreach (var stream in MediaSource.MediaStreams)
|
||||
{
|
||||
if (stream.Type == MediaStreamType.Subtitle && stream.Index == SubtitleStreamIndex.Value)
|
||||
{
|
||||
@@ -389,7 +389,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (!includeSelectedTrackOnly)
|
||||
{
|
||||
foreach (MediaStream stream in MediaSource.MediaStreams)
|
||||
foreach (var stream in MediaSource.MediaStreams)
|
||||
{
|
||||
if (stream.Type == MediaStreamType.Subtitle && (!SubtitleStreamIndex.HasValue || stream.Index != SubtitleStreamIndex.Value))
|
||||
{
|
||||
@@ -405,16 +405,16 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
if (enableAllProfiles)
|
||||
{
|
||||
foreach (SubtitleProfile profile in DeviceProfile.SubtitleProfiles)
|
||||
foreach (var profile in DeviceProfile.SubtitleProfiles)
|
||||
{
|
||||
SubtitleStreamInfo info = GetSubtitleStreamInfo(stream, baseUrl, accessToken, startPositionTicks, new[] { profile }, transcoderSupport);
|
||||
var info = GetSubtitleStreamInfo(stream, baseUrl, accessToken, startPositionTicks, new[] { profile }, transcoderSupport);
|
||||
|
||||
list.Add(info);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SubtitleStreamInfo info = GetSubtitleStreamInfo(stream, baseUrl, accessToken, startPositionTicks, DeviceProfile.SubtitleProfiles, transcoderSupport);
|
||||
var info = GetSubtitleStreamInfo(stream, baseUrl, accessToken, startPositionTicks, DeviceProfile.SubtitleProfiles, transcoderSupport);
|
||||
|
||||
list.Add(info);
|
||||
}
|
||||
@@ -422,8 +422,8 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
private SubtitleStreamInfo GetSubtitleStreamInfo(MediaStream stream, string baseUrl, string accessToken, long startPositionTicks, SubtitleProfile[] subtitleProfiles, ITranscoderSupport transcoderSupport)
|
||||
{
|
||||
SubtitleProfile subtitleProfile = StreamBuilder.GetSubtitleProfile(MediaSource, stream, subtitleProfiles, PlayMethod, transcoderSupport, Container, SubProtocol);
|
||||
SubtitleStreamInfo info = new SubtitleStreamInfo
|
||||
var subtitleProfile = StreamBuilder.GetSubtitleProfile(MediaSource, stream, subtitleProfiles, PlayMethod, transcoderSupport, Container, SubProtocol);
|
||||
var info = new SubtitleStreamInfo
|
||||
{
|
||||
IsForced = stream.IsForced,
|
||||
Language = stream.Language,
|
||||
@@ -502,7 +502,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
get
|
||||
{
|
||||
MediaStream stream = TargetAudioStream;
|
||||
var stream = TargetAudioStream;
|
||||
return stream == null ? null : stream.SampleRate;
|
||||
}
|
||||
}
|
||||
@@ -584,7 +584,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
get
|
||||
{
|
||||
MediaStream stream = TargetVideoStream;
|
||||
var stream = TargetVideoStream;
|
||||
return MaxFramerate.HasValue && !IsDirectStream
|
||||
? MaxFramerate
|
||||
: stream == null ? null : stream.AverageFrameRate ?? stream.RealFrameRate;
|
||||
@@ -689,7 +689,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
get
|
||||
{
|
||||
MediaStream stream = TargetVideoStream;
|
||||
var stream = TargetVideoStream;
|
||||
return !IsDirectStream
|
||||
? null
|
||||
: stream == null ? null : stream.PacketLength;
|
||||
@@ -727,7 +727,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
get
|
||||
{
|
||||
MediaStream stream = TargetVideoStream;
|
||||
var stream = TargetVideoStream;
|
||||
return !IsDirectStream
|
||||
? null
|
||||
: stream == null ? null : stream.CodecTag;
|
||||
@@ -741,7 +741,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
get
|
||||
{
|
||||
MediaStream stream = TargetAudioStream;
|
||||
var stream = TargetAudioStream;
|
||||
return AudioBitrate.HasValue && !IsDirectStream
|
||||
? AudioBitrate
|
||||
: stream == null ? null : stream.BitRate;
|
||||
@@ -797,7 +797,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
get
|
||||
{
|
||||
MediaStream stream = TargetAudioStream;
|
||||
var stream = TargetAudioStream;
|
||||
|
||||
string inputCodec = stream == null ? null : stream.Codec;
|
||||
|
||||
@@ -822,7 +822,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
get
|
||||
{
|
||||
MediaStream stream = TargetVideoStream;
|
||||
var stream = TargetVideoStream;
|
||||
|
||||
string inputCodec = stream == null ? null : stream.Codec;
|
||||
|
||||
@@ -878,7 +878,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
get
|
||||
{
|
||||
MediaStream stream = TargetVideoStream;
|
||||
var stream = TargetVideoStream;
|
||||
|
||||
return VideoBitrate.HasValue && !IsDirectStream
|
||||
? VideoBitrate
|
||||
@@ -890,7 +890,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
get
|
||||
{
|
||||
TransportStreamTimestamp defaultValue = StringHelper.EqualsIgnoreCase(Container, "m2ts")
|
||||
var defaultValue = StringHelper.EqualsIgnoreCase(Container, "m2ts")
|
||||
? TransportStreamTimestamp.Valid
|
||||
: TransportStreamTimestamp.None;
|
||||
|
||||
@@ -955,11 +955,11 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
get
|
||||
{
|
||||
MediaStream videoStream = TargetVideoStream;
|
||||
var videoStream = TargetVideoStream;
|
||||
|
||||
if (videoStream != null && videoStream.Width.HasValue && videoStream.Height.HasValue)
|
||||
{
|
||||
ImageSize size = new ImageSize
|
||||
var size = new ImageSize
|
||||
{
|
||||
Width = videoStream.Width.Value,
|
||||
Height = videoStream.Height.Value
|
||||
@@ -968,7 +968,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
double? maxWidth = MaxWidth.HasValue ? (double)MaxWidth.Value : (double?)null;
|
||||
double? maxHeight = MaxHeight.HasValue ? (double)MaxHeight.Value : (double?)null;
|
||||
|
||||
ImageSize newSize = DrawingUtils.Resize(size,
|
||||
var newSize = DrawingUtils.Resize(size,
|
||||
0,
|
||||
0,
|
||||
maxWidth ?? 0,
|
||||
@@ -985,11 +985,11 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
get
|
||||
{
|
||||
MediaStream videoStream = TargetVideoStream;
|
||||
var videoStream = TargetVideoStream;
|
||||
|
||||
if (videoStream != null && videoStream.Width.HasValue && videoStream.Height.HasValue)
|
||||
{
|
||||
ImageSize size = new ImageSize
|
||||
var size = new ImageSize
|
||||
{
|
||||
Width = videoStream.Width.Value,
|
||||
Height = videoStream.Height.Value
|
||||
@@ -998,7 +998,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
double? maxWidth = MaxWidth.HasValue ? (double)MaxWidth.Value : (double?)null;
|
||||
double? maxHeight = MaxHeight.HasValue ? (double)MaxHeight.Value : (double?)null;
|
||||
|
||||
ImageSize newSize = DrawingUtils.Resize(size,
|
||||
var newSize = DrawingUtils.Resize(size,
|
||||
0,
|
||||
0,
|
||||
maxWidth ?? 0,
|
||||
@@ -1059,9 +1059,9 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
public List<MediaStream> GetSelectableStreams(MediaStreamType type)
|
||||
{
|
||||
List<MediaStream> list = new List<MediaStream>();
|
||||
var list = new List<MediaStream>();
|
||||
|
||||
foreach (MediaStream stream in MediaSource.MediaStreams)
|
||||
foreach (var stream in MediaSource.MediaStreams)
|
||||
{
|
||||
if (type == stream.Type)
|
||||
{
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace MediaBrowser.Model.Dto
|
||||
{
|
||||
var val = defaultIndex.Value;
|
||||
|
||||
foreach (MediaStream i in MediaStreams)
|
||||
foreach (var i in MediaStreams)
|
||||
{
|
||||
if (i.Type == MediaStreamType.Audio && i.Index == val)
|
||||
{
|
||||
@@ -129,7 +129,7 @@ namespace MediaBrowser.Model.Dto
|
||||
}
|
||||
}
|
||||
|
||||
foreach (MediaStream i in MediaStreams)
|
||||
foreach (var i in MediaStreams)
|
||||
{
|
||||
if (i.Type == MediaStreamType.Audio && i.IsDefault)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ namespace MediaBrowser.Model.Dto
|
||||
}
|
||||
}
|
||||
|
||||
foreach (MediaStream i in MediaStreams)
|
||||
foreach (var i in MediaStreams)
|
||||
{
|
||||
if (i.Type == MediaStreamType.Audio)
|
||||
{
|
||||
@@ -153,7 +153,7 @@ namespace MediaBrowser.Model.Dto
|
||||
{
|
||||
get
|
||||
{
|
||||
foreach (MediaStream i in MediaStreams)
|
||||
foreach (var i in MediaStreams)
|
||||
{
|
||||
if (i.Type == MediaStreamType.Video)
|
||||
{
|
||||
@@ -167,7 +167,7 @@ namespace MediaBrowser.Model.Dto
|
||||
|
||||
public MediaStream GetMediaStream(MediaStreamType type, int index)
|
||||
{
|
||||
foreach (MediaStream i in MediaStreams)
|
||||
foreach (var i in MediaStreams)
|
||||
{
|
||||
if (i.Type == type && i.Index == index)
|
||||
{
|
||||
@@ -183,7 +183,7 @@ namespace MediaBrowser.Model.Dto
|
||||
int numMatches = 0;
|
||||
int numStreams = 0;
|
||||
|
||||
foreach (MediaStream i in MediaStreams)
|
||||
foreach (var i in MediaStreams)
|
||||
{
|
||||
numStreams++;
|
||||
if (i.Type == type)
|
||||
@@ -203,7 +203,7 @@ namespace MediaBrowser.Model.Dto
|
||||
public bool? IsSecondaryAudio(MediaStream stream)
|
||||
{
|
||||
// Look for the first audio track marked as default
|
||||
foreach (MediaStream currentStream in MediaStreams)
|
||||
foreach (var currentStream in MediaStreams)
|
||||
{
|
||||
if (currentStream.Type == MediaStreamType.Audio && currentStream.IsDefault)
|
||||
{
|
||||
@@ -215,7 +215,7 @@ namespace MediaBrowser.Model.Dto
|
||||
}
|
||||
|
||||
// Look for the first audio track
|
||||
foreach (MediaStream currentStream in MediaStreams)
|
||||
foreach (var currentStream in MediaStreams)
|
||||
{
|
||||
if (currentStream.Type == MediaStreamType.Audio)
|
||||
{
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace MediaBrowser.Model.Entities
|
||||
// return AddLanguageIfNeeded(Title);
|
||||
//}
|
||||
|
||||
List<string> attributes = new List<string>();
|
||||
var attributes = new List<string>();
|
||||
|
||||
if (!string.IsNullOrEmpty(Language))
|
||||
{
|
||||
@@ -109,7 +109,7 @@ namespace MediaBrowser.Model.Entities
|
||||
|
||||
if (Type == MediaStreamType.Video)
|
||||
{
|
||||
List<string> attributes = new List<string>();
|
||||
var attributes = new List<string>();
|
||||
|
||||
var resolutionText = GetResolutionText();
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace MediaBrowser.Model.Entities
|
||||
// return AddLanguageIfNeeded(Title);
|
||||
//}
|
||||
|
||||
List<string> attributes = new List<string>();
|
||||
var attributes = new List<string>();
|
||||
|
||||
if (!string.IsNullOrEmpty(Language))
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace MediaBrowser.Model.MediaInfo
|
||||
|
||||
DirectPlayProtocols = new MediaProtocol[] { MediaProtocol.Http };
|
||||
|
||||
VideoOptions videoOptions = options as VideoOptions;
|
||||
var videoOptions = options as VideoOptions;
|
||||
if (videoOptions != null)
|
||||
{
|
||||
AudioStreamIndex = videoOptions.AudioStreamIndex;
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace MediaBrowser.Model.Net
|
||||
|
||||
private static Dictionary<string, string> GetVideoFileExtensionsDictionary()
|
||||
{
|
||||
Dictionary<string, string> dict = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
var dict = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
foreach (string ext in VideoFileExtensions)
|
||||
{
|
||||
@@ -65,7 +65,7 @@ namespace MediaBrowser.Model.Net
|
||||
|
||||
private static Dictionary<string, string> GetMimeTypeLookup()
|
||||
{
|
||||
Dictionary<string, string> dict = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
var dict = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
dict.Add(".jpg", "image/jpeg");
|
||||
dict.Add(".jpeg", "image/jpeg");
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace MediaBrowser.Model.Notifications
|
||||
|
||||
public NotificationOption GetOptions(string type)
|
||||
{
|
||||
foreach (NotificationOption i in Options)
|
||||
foreach (var i in Options)
|
||||
{
|
||||
if (StringHelper.EqualsIgnoreCase(type, i.Type)) return i;
|
||||
}
|
||||
@@ -86,14 +86,14 @@ namespace MediaBrowser.Model.Notifications
|
||||
|
||||
public bool IsEnabled(string type)
|
||||
{
|
||||
NotificationOption opt = GetOptions(type);
|
||||
var opt = GetOptions(type);
|
||||
|
||||
return opt != null && opt.Enabled;
|
||||
}
|
||||
|
||||
public bool IsServiceEnabled(string service, string notificationType)
|
||||
{
|
||||
NotificationOption opt = GetOptions(notificationType);
|
||||
var opt = GetOptions(notificationType);
|
||||
|
||||
return opt == null ||
|
||||
!ListHelper.ContainsIgnoreCase(opt.DisabledServices, service);
|
||||
@@ -101,7 +101,7 @@ namespace MediaBrowser.Model.Notifications
|
||||
|
||||
public bool IsEnabledToMonitorUser(string type, Guid userId)
|
||||
{
|
||||
NotificationOption opt = GetOptions(type);
|
||||
var opt = GetOptions(type);
|
||||
|
||||
return opt != null && opt.Enabled &&
|
||||
!ListHelper.ContainsIgnoreCase(opt.DisabledMonitorUsers, userId.ToString(""));
|
||||
@@ -109,7 +109,7 @@ namespace MediaBrowser.Model.Notifications
|
||||
|
||||
public bool IsEnabledToSendToUser(string type, string userId, UserPolicy userPolicy)
|
||||
{
|
||||
NotificationOption opt = GetOptions(type);
|
||||
var opt = GetOptions(type);
|
||||
|
||||
if (opt != null && opt.Enabled)
|
||||
{
|
||||
|
||||
@@ -445,8 +445,8 @@ namespace MediaBrowser.Model.Services
|
||||
if (s.IndexOf('&') == -1)
|
||||
return s;
|
||||
|
||||
StringBuilder entity = new StringBuilder();
|
||||
StringBuilder output = new StringBuilder();
|
||||
var entity = new StringBuilder();
|
||||
var output = new StringBuilder();
|
||||
int len = s.Length;
|
||||
// 0 -> nothing,
|
||||
// 1 -> right after '&'
|
||||
@@ -623,7 +623,7 @@ namespace MediaBrowser.Model.Services
|
||||
if (query[0] == '?')
|
||||
query = query.Substring(1);
|
||||
|
||||
QueryParamCollection result = new QueryParamCollection();
|
||||
var result = new QueryParamCollection();
|
||||
ParseQueryString(query, encoding, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace MediaBrowser.Model.System
|
||||
{
|
||||
public interface IEnvironmentInfo
|
||||
{
|
||||
MediaBrowser.Model.System.OperatingSystem OperatingSystem { get; }
|
||||
OperatingSystem OperatingSystem { get; }
|
||||
string OperatingSystemName { get; }
|
||||
string OperatingSystemVersion { get; }
|
||||
Architecture SystemArchitecture { get; }
|
||||
|
||||
Reference in New Issue
Block a user