mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-10 01:38:49 +01:00
update translations
This commit is contained in:
@@ -924,30 +924,6 @@ namespace MediaBrowser.Model.ApiClient
|
||||
/// <returns>System.String.</returns>
|
||||
string GetThumbImageUrl(BaseItemDto item, ImageOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the url needed to stream an audio file
|
||||
/// </summary>
|
||||
/// <param name="options">The options.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
/// <exception cref="ArgumentNullException">options</exception>
|
||||
string GetAudioStreamUrl(StreamOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the url needed to stream a video file
|
||||
/// </summary>
|
||||
/// <param name="options">The options.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
/// <exception cref="ArgumentNullException">options</exception>
|
||||
string GetVideoStreamUrl(VideoStreamOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Formulates a url for streaming video using the HLS protocol
|
||||
/// </summary>
|
||||
/// <param name="options">The options.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
/// <exception cref="ArgumentNullException">options</exception>
|
||||
string GetHlsVideoStreamUrl(VideoStreamOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the live tv information asynchronous.
|
||||
/// </summary>
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
DlnaFlags.DlnaV15;
|
||||
|
||||
string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
|
||||
FlagsToString(flagValue));
|
||||
DlnaMaps.FlagsToString(flagValue));
|
||||
|
||||
ResponseProfile mediaProfile = _profile.GetImageMediaProfile(container,
|
||||
width,
|
||||
@@ -73,7 +73,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
|
||||
FlagsToString(flagValue));
|
||||
DlnaMaps.FlagsToString(flagValue));
|
||||
|
||||
ResponseProfile mediaProfile = _profile.GetAudioMediaProfile(container,
|
||||
audioCodec,
|
||||
@@ -92,12 +92,6 @@ namespace MediaBrowser.Model.Dlna
|
||||
return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';');
|
||||
}
|
||||
|
||||
private static string FlagsToString(DlnaFlags flags)
|
||||
{
|
||||
//return Enum.Format(typeof(DlnaFlags), flags, "x");
|
||||
return string.Format("{0:X8}{1:D24}", (ulong)flags, 0);
|
||||
}
|
||||
|
||||
public string BuildVideoHeader(string container,
|
||||
string videoCodec,
|
||||
string audioCodec,
|
||||
@@ -136,7 +130,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
string dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}",
|
||||
FlagsToString(flagValue));
|
||||
DlnaMaps.FlagsToString(flagValue));
|
||||
|
||||
ResponseProfile mediaProfile = _profile.GetVideoMediaProfile(container,
|
||||
audioCodec,
|
||||
|
||||
@@ -108,7 +108,8 @@ namespace MediaBrowser.Model.Dlna
|
||||
List<string> list = new List<string>();
|
||||
foreach (string i in (SupportedMediaTypes ?? string.Empty).Split(','))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(i)) list.Add(i);
|
||||
if (!string.IsNullOrEmpty(i))
|
||||
list.Add(i);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@@ -117,85 +118,102 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
container = (container ?? string.Empty).TrimStart('.');
|
||||
|
||||
return TranscodingProfiles.FirstOrDefault(i =>
|
||||
foreach (var i in TranscodingProfiles)
|
||||
{
|
||||
if (i.Type != DlnaProfileType.Audio)
|
||||
{
|
||||
return false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!string.Equals(container, i.Container, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!i.GetAudioCodecs().Contains(audioCodec ?? string.Empty))
|
||||
if (!i.GetAudioCodecs().Contains(audioCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
continue;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
return i;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public TranscodingProfile GetVideoTranscodingProfile(string container, string audioCodec, string videoCodec)
|
||||
{
|
||||
container = (container ?? string.Empty).TrimStart('.');
|
||||
|
||||
return TranscodingProfiles.FirstOrDefault(i =>
|
||||
foreach (var i in TranscodingProfiles)
|
||||
{
|
||||
if (i.Type != DlnaProfileType.Video)
|
||||
{
|
||||
return false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!string.Equals(container, i.Container, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!i.GetAudioCodecs().Contains(audioCodec ?? string.Empty))
|
||||
{
|
||||
return false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!string.Equals(videoCodec, i.VideoCodec, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
continue;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
return i;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ResponseProfile GetAudioMediaProfile(string container, string audioCodec, int? audioChannels, int? audioBitrate)
|
||||
{
|
||||
container = (container ?? string.Empty).TrimStart('.');
|
||||
|
||||
return ResponseProfiles.FirstOrDefault(i =>
|
||||
foreach (var i in ResponseProfiles)
|
||||
{
|
||||
if (i.Type != DlnaProfileType.Audio)
|
||||
{
|
||||
return false;
|
||||
continue;
|
||||
}
|
||||
|
||||
List<string> containers = i.GetContainers().ToList();
|
||||
if (containers.Count > 0 && !containers.Contains(container))
|
||||
List<string> containers = i.GetContainers();
|
||||
if (containers.Count > 0 && !containers.Contains(container, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
continue;
|
||||
}
|
||||
|
||||
List<string> audioCodecs = i.GetAudioCodecs().ToList();
|
||||
if (audioCodecs.Count > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty))
|
||||
List<string> audioCodecs = i.GetAudioCodecs();
|
||||
if (audioCodecs.Count > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
continue;
|
||||
}
|
||||
|
||||
ConditionProcessor conditionProcessor = new ConditionProcessor();
|
||||
return i.Conditions.All(c => conditionProcessor.IsAudioConditionSatisfied(c,
|
||||
audioChannels,
|
||||
audioBitrate));
|
||||
});
|
||||
|
||||
var anyOff = false;
|
||||
foreach (ProfileCondition c in i.Conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsAudioConditionSatisfied(c, audioChannels, audioBitrate))
|
||||
{
|
||||
anyOff = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (anyOff)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ResponseProfile GetImageMediaProfile(string container, int? width, int? height)
|
||||
@@ -209,16 +227,19 @@ namespace MediaBrowser.Model.Dlna
|
||||
return false;
|
||||
}
|
||||
|
||||
List<string> containers = i.GetContainers().ToList();
|
||||
if (containers.Count > 0 && !containers.Contains(container))
|
||||
List<string> containers = i.GetContainers();
|
||||
if (containers.Count > 0 && !containers.Contains(container, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ConditionProcessor conditionProcessor = new ConditionProcessor();
|
||||
return i.Conditions.All(c => conditionProcessor.IsImageConditionSatisfied(c,
|
||||
width,
|
||||
height));
|
||||
foreach (ProfileCondition c in i.Conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsImageConditionSatisfied(c, width, height))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -246,37 +267,31 @@ namespace MediaBrowser.Model.Dlna
|
||||
return false;
|
||||
}
|
||||
|
||||
List<string> containers = i.GetContainers().ToList();
|
||||
if (containers.Count > 0 && !containers.Contains(container))
|
||||
List<string> containers = i.GetContainers();
|
||||
if (containers.Count > 0 && !containers.Contains(container, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
List<string> audioCodecs = i.GetAudioCodecs().ToList();
|
||||
if (audioCodecs.Count > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty))
|
||||
List<string> audioCodecs = i.GetAudioCodecs();
|
||||
if (audioCodecs.Count > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
List<string> videoCodecs = i.GetVideoCodecs().ToList();
|
||||
if (videoCodecs.Count > 0 && !videoCodecs.Contains(videoCodec ?? string.Empty))
|
||||
List<string> videoCodecs = i.GetVideoCodecs();
|
||||
if (videoCodecs.Count > 0 && !videoCodecs.Contains(videoCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ConditionProcessor conditionProcessor = new ConditionProcessor();
|
||||
return i.Conditions.All(c => conditionProcessor.IsVideoConditionSatisfied(c,
|
||||
audioBitrate,
|
||||
audioChannels,
|
||||
width,
|
||||
height,
|
||||
bitDepth,
|
||||
videoBitrate,
|
||||
videoProfile,
|
||||
videoLevel,
|
||||
videoFramerate,
|
||||
packetLength,
|
||||
timestamp));
|
||||
foreach (ProfileCondition c in i.Conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsVideoConditionSatisfied(c, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -292,15 +307,18 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
List<string> containers = i.GetContainers().ToList();
|
||||
if (containers.Count > 0 && !containers.Contains(container))
|
||||
if (containers.Count > 0 && !containers.Contains(container, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ConditionProcessor conditionProcessor = new ConditionProcessor();
|
||||
return i.Conditions.All(c => conditionProcessor.IsImageConditionSatisfied(c,
|
||||
width,
|
||||
height));
|
||||
foreach (ProfileCondition c in i.Conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsImageConditionSatisfied(c, width, height))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
mediaSources = new List<MediaSourceInfo>();
|
||||
foreach (MediaSourceInfo i in mediaSources)
|
||||
{
|
||||
if (string.Equals(i.Id, mediaSourceId, StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(i.Id, mediaSourceId, StringComparison.OrdinalIgnoreCase))
|
||||
mediaSources.Add(i);
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
mediaSources = new List<MediaSourceInfo>();
|
||||
foreach (MediaSourceInfo i in mediaSources)
|
||||
{
|
||||
if (string.Equals(i.Id, mediaSourceId, StringComparison.OrdinalIgnoreCase))
|
||||
if (string.Equals(i.Id, mediaSourceId, StringComparison.OrdinalIgnoreCase))
|
||||
mediaSources.Add(i);
|
||||
}
|
||||
}
|
||||
@@ -109,13 +109,28 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
int? maxBitrateSetting = options.MaxBitrate ?? options.Profile.MaxBitrate;
|
||||
|
||||
MediaStream audioStream = item.MediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Audio);
|
||||
MediaStream audioStream = null;
|
||||
foreach (MediaStream i in item.MediaStreams)
|
||||
{
|
||||
if (i.Type == MediaStreamType.Audio)
|
||||
{
|
||||
audioStream = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Honor the max bitrate setting
|
||||
if (IsAudioEligibleForDirectPlay(item, maxBitrateSetting))
|
||||
{
|
||||
DirectPlayProfile directPlay = options.Profile.DirectPlayProfiles
|
||||
.FirstOrDefault(i => i.Type == playlistItem.MediaType && IsAudioDirectPlaySupported(i, item, audioStream));
|
||||
DirectPlayProfile directPlay = null;
|
||||
foreach (DirectPlayProfile i in options.Profile.DirectPlayProfiles)
|
||||
{
|
||||
if (i.Type == playlistItem.MediaType && IsAudioDirectPlaySupported(i, item, audioStream))
|
||||
{
|
||||
directPlay = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (directPlay != null)
|
||||
{
|
||||
@@ -126,13 +141,27 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
ConditionProcessor conditionProcessor = new ConditionProcessor();
|
||||
|
||||
IEnumerable<ProfileCondition> conditions = options.Profile.CodecProfiles.Where(i => i.Type == CodecType.Audio && i.ContainsCodec(audioCodec))
|
||||
.SelectMany(i => i.Conditions);
|
||||
List<ProfileCondition> conditions = new List<ProfileCondition>();
|
||||
foreach (CodecProfile i in options.Profile.CodecProfiles)
|
||||
{
|
||||
if (i.Type == CodecType.Audio && i.ContainsCodec(audioCodec))
|
||||
conditions.AddRange(i.Conditions);
|
||||
}
|
||||
|
||||
int? audioChannels = audioStream.Channels;
|
||||
int? audioBitrate = audioStream.BitRate;
|
||||
|
||||
if (conditions.All(c => conditionProcessor.IsAudioConditionSatisfied(c, audioChannels, audioBitrate)))
|
||||
bool all = true;
|
||||
foreach (ProfileCondition c in conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsAudioConditionSatisfied(c, audioChannels, audioBitrate))
|
||||
{
|
||||
all = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (all)
|
||||
{
|
||||
playlistItem.IsDirectStream = true;
|
||||
playlistItem.Container = item.Container;
|
||||
@@ -143,8 +172,15 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
}
|
||||
|
||||
TranscodingProfile transcodingProfile = options.Profile.TranscodingProfiles
|
||||
.FirstOrDefault(i => i.Type == playlistItem.MediaType);
|
||||
TranscodingProfile transcodingProfile = null;
|
||||
foreach (TranscodingProfile i in options.Profile.TranscodingProfiles)
|
||||
{
|
||||
if (i.Type == playlistItem.MediaType)
|
||||
{
|
||||
transcodingProfile = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (transcodingProfile != null)
|
||||
{
|
||||
@@ -155,10 +191,11 @@ namespace MediaBrowser.Model.Dlna
|
||||
playlistItem.AudioCodec = transcodingProfile.AudioCodec;
|
||||
playlistItem.Protocol = transcodingProfile.Protocol;
|
||||
|
||||
IEnumerable<ProfileCondition> audioTranscodingConditions = options.Profile.CodecProfiles
|
||||
List<ProfileCondition> audioTranscodingConditions = options.Profile.CodecProfiles
|
||||
.Where(i => i.Type == CodecType.Audio && i.ContainsCodec(transcodingProfile.AudioCodec))
|
||||
.Take(1)
|
||||
.SelectMany(i => i.Conditions);
|
||||
.SelectMany(i => i.Conditions)
|
||||
.ToList();
|
||||
|
||||
ApplyTranscodingConditions(playlistItem, audioTranscodingConditions);
|
||||
|
||||
@@ -192,8 +229,25 @@ namespace MediaBrowser.Model.Dlna
|
||||
RunTimeTicks = item.RunTimeTicks
|
||||
};
|
||||
|
||||
MediaStream audioStream = item.MediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Audio);
|
||||
MediaStream videoStream = item.MediaStreams.FirstOrDefault(i => i.Type == MediaStreamType.Video);
|
||||
MediaStream audioStream = null;
|
||||
foreach (MediaStream i in item.MediaStreams)
|
||||
{
|
||||
if (i.Type == MediaStreamType.Audio)
|
||||
{
|
||||
audioStream = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MediaStream videoStream = null;
|
||||
foreach (MediaStream i in item.MediaStreams)
|
||||
{
|
||||
if (i.Type == MediaStreamType.Video)
|
||||
{
|
||||
videoStream = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int? maxBitrateSetting = options.MaxBitrate ?? options.Profile.MaxBitrate;
|
||||
|
||||
@@ -306,9 +360,15 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
string container = mediaSource.Container;
|
||||
|
||||
IEnumerable<ProfileCondition> conditions = profile.ContainerProfiles
|
||||
.Where(i => i.Type == DlnaProfileType.Video && i.GetContainers().Contains(container, StringComparer.OrdinalIgnoreCase))
|
||||
.SelectMany(i => i.Conditions);
|
||||
List<ProfileCondition> conditions = new List<ProfileCondition>();
|
||||
foreach (ContainerProfile i in profile.ContainerProfiles)
|
||||
{
|
||||
if (i.Type == DlnaProfileType.Video &&
|
||||
i.GetContainers().Contains(container, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
conditions.AddRange(i.Conditions);
|
||||
}
|
||||
}
|
||||
|
||||
ConditionProcessor conditionProcessor = new ConditionProcessor();
|
||||
|
||||
@@ -328,20 +388,12 @@ namespace MediaBrowser.Model.Dlna
|
||||
int? packetLength = videoStream == null ? null : videoStream.PacketLength;
|
||||
|
||||
// Check container conditions
|
||||
if (!conditions.All(i => conditionProcessor.IsVideoConditionSatisfied(i,
|
||||
audioBitrate,
|
||||
audioChannels,
|
||||
width,
|
||||
height,
|
||||
bitDepth,
|
||||
videoBitrate,
|
||||
videoProfile,
|
||||
videoLevel,
|
||||
videoFramerate,
|
||||
packetLength,
|
||||
timestamp)))
|
||||
foreach (ProfileCondition i in conditions)
|
||||
{
|
||||
return null;
|
||||
if (!conditionProcessor.IsVideoConditionSatisfied(i, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
string videoCodec = videoStream == null ? null : videoStream.Codec;
|
||||
@@ -351,24 +403,19 @@ namespace MediaBrowser.Model.Dlna
|
||||
return null;
|
||||
}
|
||||
|
||||
conditions = profile.CodecProfiles
|
||||
.Where(i => i.Type == CodecType.Video && i.ContainsCodec(videoCodec))
|
||||
.SelectMany(i => i.Conditions);
|
||||
|
||||
if (!conditions.All(i => conditionProcessor.IsVideoConditionSatisfied(i,
|
||||
audioBitrate,
|
||||
audioChannels,
|
||||
width,
|
||||
height,
|
||||
bitDepth,
|
||||
videoBitrate,
|
||||
videoProfile,
|
||||
videoLevel,
|
||||
videoFramerate,
|
||||
packetLength,
|
||||
timestamp)))
|
||||
conditions = new List<ProfileCondition>();
|
||||
foreach (CodecProfile i in profile.CodecProfiles)
|
||||
{
|
||||
return null;
|
||||
if (i.Type == CodecType.Video && i.ContainsCodec(videoCodec))
|
||||
conditions.AddRange(i.Conditions);
|
||||
}
|
||||
|
||||
foreach (ProfileCondition i in conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsVideoConditionSatisfied(i, audioBitrate, audioChannels, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (audioStream != null)
|
||||
@@ -380,16 +427,19 @@ namespace MediaBrowser.Model.Dlna
|
||||
return null;
|
||||
}
|
||||
|
||||
conditions = profile.CodecProfiles
|
||||
.Where(i => i.Type == CodecType.VideoAudio && i.ContainsCodec(audioCodec))
|
||||
.SelectMany(i => i.Conditions);
|
||||
|
||||
if (!conditions.All(i => conditionProcessor.IsVideoAudioConditionSatisfied(i,
|
||||
audioChannels,
|
||||
audioBitrate,
|
||||
audioProfile)))
|
||||
conditions = new List<ProfileCondition>();
|
||||
foreach (CodecProfile i in profile.CodecProfiles)
|
||||
{
|
||||
return null;
|
||||
if (i.Type == CodecType.VideoAudio && i.ContainsCodec(audioCodec))
|
||||
conditions.AddRange(i.Conditions);
|
||||
}
|
||||
|
||||
foreach (ProfileCondition i in conditions)
|
||||
{
|
||||
if (!conditionProcessor.IsVideoAudioConditionSatisfied(i, audioChannels, audioBitrate, audioProfile))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,11 +505,15 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
private void ApplyTranscodingConditions(StreamInfo item, IEnumerable<ProfileCondition> conditions)
|
||||
{
|
||||
foreach (ProfileCondition condition in conditions
|
||||
.Where(i => !string.IsNullOrEmpty(i.Value)))
|
||||
foreach (ProfileCondition condition in conditions)
|
||||
{
|
||||
string value = condition.Value;
|
||||
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (condition.Property)
|
||||
{
|
||||
case ProfileConditionValue.AudioBitrate:
|
||||
@@ -551,7 +605,16 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
// Check container type
|
||||
string mediaContainer = item.Container ?? string.Empty;
|
||||
if (!profile.GetContainers().Any(i => string.Equals(i, mediaContainer, StringComparison.OrdinalIgnoreCase)))
|
||||
bool any = false;
|
||||
foreach (string i in profile.GetContainers())
|
||||
{
|
||||
if (string.Equals(i, mediaContainer, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
any = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!any)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -572,7 +635,16 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
// Check container type
|
||||
string mediaContainer = item.Container ?? string.Empty;
|
||||
if (!profile.GetContainers().Any(i => string.Equals(i, mediaContainer, StringComparison.OrdinalIgnoreCase)))
|
||||
bool any = false;
|
||||
foreach (string i in profile.GetContainers())
|
||||
{
|
||||
if (string.Equals(i, mediaContainer, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
any = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!any)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using MediaBrowser.Model.Updates;
|
||||
|
||||
|
||||
namespace MediaBrowser.Model.Plugins
|
||||
{
|
||||
/// <summary>
|
||||
@@ -7,26 +6,5 @@ namespace MediaBrowser.Model.Plugins
|
||||
/// </summary>
|
||||
public class BasePluginConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether or not this plug-in should be automatically updated when a
|
||||
/// compatible new version is released
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [enable auto update]; otherwise, <c>false</c>.</value>
|
||||
public bool EnableAutoUpdate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The classification of updates to which to subscribe.
|
||||
/// Options are: Dev, Beta or Release
|
||||
/// </summary>
|
||||
/// <value>The update class.</value>
|
||||
public PackageVersionClass UpdateClass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BasePluginConfiguration" /> class.
|
||||
/// </summary>
|
||||
public BasePluginConfiguration()
|
||||
{
|
||||
EnableAutoUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,25 +49,5 @@ namespace MediaBrowser.Model.Plugins
|
||||
/// </summary>
|
||||
/// <value>The unique id.</value>
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not this plug-in should be automatically updated when a
|
||||
/// compatible new version is released
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [enable auto update]; otherwise, <c>false</c>.</value>
|
||||
public bool EnableAutoUpdate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The classification of updates to which to subscribe.
|
||||
/// Options are: Dev, Beta or Release
|
||||
/// </summary>
|
||||
/// <value>The update class.</value>
|
||||
public PackageVersionClass UpdateClass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the minimum required UI version.
|
||||
/// </summary>
|
||||
/// <value>The minimum required UI version.</value>
|
||||
public string MinimumRequiredUIVersion { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user