|
|
@ -171,12 +171,15 @@ namespace MediaBrowser.Dlna.PlayTo
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var mediaPath = item.Path;
|
|
|
|
var mediaPath = item.Path;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (profile.Containers.Length > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
// Check container type
|
|
|
|
// Check container type
|
|
|
|
var mediaContainer = Path.GetExtension(mediaPath);
|
|
|
|
var mediaContainer = Path.GetExtension(mediaPath);
|
|
|
|
if (!profile.Containers.Any(i => string.Equals("." + i.TrimStart('.'), mediaContainer, StringComparison.OrdinalIgnoreCase)))
|
|
|
|
if (!profile.Containers.Any(i => string.Equals("." + i.TrimStart('.'), mediaContainer, StringComparison.OrdinalIgnoreCase)))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Check additional conditions
|
|
|
|
// Check additional conditions
|
|
|
|
if (!profile.Conditions.Any(i => IsConditionSatisfied(i, mediaPath, null, null)))
|
|
|
|
if (!profile.Conditions.Any(i => IsConditionSatisfied(i, mediaPath, null, null)))
|
|
|
@ -191,12 +194,15 @@ namespace MediaBrowser.Dlna.PlayTo
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var mediaPath = item.Path;
|
|
|
|
var mediaPath = item.Path;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (profile.Containers.Length > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
// Check container type
|
|
|
|
// Check container type
|
|
|
|
var mediaContainer = Path.GetExtension(mediaPath);
|
|
|
|
var mediaContainer = Path.GetExtension(mediaPath);
|
|
|
|
if (!profile.Containers.Any(i => string.Equals("." + i.TrimStart('.'), mediaContainer, StringComparison.OrdinalIgnoreCase)))
|
|
|
|
if (!profile.Containers.Any(i => string.Equals("." + i.TrimStart('.'), mediaContainer, StringComparison.OrdinalIgnoreCase)))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Check additional conditions
|
|
|
|
// Check additional conditions
|
|
|
|
if (!profile.Conditions.Any(i => IsConditionSatisfied(i, mediaPath, null, audioStream)))
|
|
|
|
if (!profile.Conditions.Any(i => IsConditionSatisfied(i, mediaPath, null, audioStream)))
|
|
|
@ -216,12 +222,15 @@ namespace MediaBrowser.Dlna.PlayTo
|
|
|
|
|
|
|
|
|
|
|
|
var mediaPath = item.Path;
|
|
|
|
var mediaPath = item.Path;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (profile.Containers.Length > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
// Check container type
|
|
|
|
// Check container type
|
|
|
|
var mediaContainer = Path.GetExtension(mediaPath);
|
|
|
|
var mediaContainer = Path.GetExtension(mediaPath);
|
|
|
|
if (!profile.Containers.Any(i => string.Equals("." + i.TrimStart('.'), mediaContainer, StringComparison.OrdinalIgnoreCase)))
|
|
|
|
if (!profile.Containers.Any(i => string.Equals("." + i.TrimStart('.'), mediaContainer, StringComparison.OrdinalIgnoreCase)))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Check video codec
|
|
|
|
// Check video codec
|
|
|
|
if (profile.VideoCodecs.Length > 0)
|
|
|
|
if (profile.VideoCodecs.Length > 0)
|
|
|
@ -330,9 +339,9 @@ namespace MediaBrowser.Dlna.PlayTo
|
|
|
|
return videoStream == null ? null : videoStream.BitRate;
|
|
|
|
return videoStream == null ? null : videoStream.BitRate;
|
|
|
|
case ProfileConditionValue.VideoFramerate:
|
|
|
|
case ProfileConditionValue.VideoFramerate:
|
|
|
|
return videoStream == null ? null : (ConvertToLong(videoStream.AverageFrameRate ?? videoStream.RealFrameRate));
|
|
|
|
return videoStream == null ? null : (ConvertToLong(videoStream.AverageFrameRate ?? videoStream.RealFrameRate));
|
|
|
|
case ProfileConditionValue.VideoHeight:
|
|
|
|
case ProfileConditionValue.Height:
|
|
|
|
return videoStream == null ? null : videoStream.Height;
|
|
|
|
return videoStream == null ? null : videoStream.Height;
|
|
|
|
case ProfileConditionValue.VideoWidth:
|
|
|
|
case ProfileConditionValue.Width:
|
|
|
|
return videoStream == null ? null : videoStream.Width;
|
|
|
|
return videoStream == null ? null : videoStream.Width;
|
|
|
|
case ProfileConditionValue.VideoLevel:
|
|
|
|
case ProfileConditionValue.VideoLevel:
|
|
|
|
return videoStream == null ? null : ConvertToLong(videoStream.Level);
|
|
|
|
return videoStream == null ? null : ConvertToLong(videoStream.Level);
|
|
|
|