diff --git a/MediaBrowser.Dlna/PlayTo/PlaylistItemFactory.cs b/MediaBrowser.Dlna/PlayTo/PlaylistItemFactory.cs
index 2eb51e2149..f657df17f4 100644
--- a/MediaBrowser.Dlna/PlayTo/PlaylistItemFactory.cs
+++ b/MediaBrowser.Dlna/PlayTo/PlaylistItemFactory.cs
@@ -219,6 +219,15 @@ namespace MediaBrowser.Dlna.PlayTo
return true;
}
+ ///
+ /// Determines whether [is condition satisfied] [the specified condition].
+ ///
+ /// The condition.
+ /// The media path.
+ /// The video stream.
+ /// The audio stream.
+ /// true if [is condition satisfied] [the specified condition]; otherwise, false.
+ /// Unexpected ProfileConditionType
private bool IsConditionSatisfied(ProfileCondition condition, string mediaPath, MediaStream videoStream, MediaStream audioStream)
{
var actualValue = GetConditionValue(condition, mediaPath, videoStream, audioStream);
@@ -226,7 +235,7 @@ namespace MediaBrowser.Dlna.PlayTo
if (actualValue.HasValue)
{
long expected;
- if (long.TryParse("", NumberStyles.Any, _usCulture, out expected))
+ if (long.TryParse(condition.Value, NumberStyles.Any, _usCulture, out expected))
{
switch (condition.Condition)
{
@@ -247,6 +256,15 @@ namespace MediaBrowser.Dlna.PlayTo
return false;
}
+ ///
+ /// Gets the condition value.
+ ///
+ /// The condition.
+ /// The media path.
+ /// The video stream.
+ /// The audio stream.
+ /// System.Nullable{System.Int64}.
+ /// Unexpected Property
private long? GetConditionValue(ProfileCondition condition, string mediaPath, MediaStream videoStream, MediaStream audioStream)
{
switch (condition.Property)
@@ -270,6 +288,11 @@ namespace MediaBrowser.Dlna.PlayTo
}
}
+ ///
+ /// Converts to long.
+ ///
+ /// The value.
+ /// System.Nullable{System.Int64}.
private long? ConvertToLong(float? val)
{
return val.HasValue ? Convert.ToInt64(val.Value) : (long?)null;