Make ConditionProcessor static

This commit is contained in:
Bond_009
2019-01-20 11:34:33 +01:00
parent c9b88ab741
commit 37be6c87eb
4 changed files with 93 additions and 123 deletions

View File

@@ -5,9 +5,10 @@ using MediaBrowser.Model.MediaInfo;
namespace MediaBrowser.Model.Dlna
{
public class ConditionProcessor
public static class ConditionProcessor
{
public bool IsVideoConditionSatisfied(ProfileCondition condition,
public static bool IsVideoConditionSatisfied(
ProfileCondition condition,
int? width,
int? height,
int? videoBitDepth,
@@ -64,7 +65,7 @@ namespace MediaBrowser.Model.Dlna
}
}
public bool IsImageConditionSatisfied(ProfileCondition condition, int? width, int? height)
public static bool IsImageConditionSatisfied(ProfileCondition condition, int? width, int? height)
{
switch (condition.Property)
{
@@ -77,7 +78,7 @@ namespace MediaBrowser.Model.Dlna
}
}
public bool IsAudioConditionSatisfied(ProfileCondition condition, int? audioChannels, int? audioBitrate, int? audioSampleRate, int? audioBitDepth)
public static bool IsAudioConditionSatisfied(ProfileCondition condition, int? audioChannels, int? audioBitrate, int? audioSampleRate, int? audioBitDepth)
{
switch (condition.Property)
{
@@ -94,7 +95,8 @@ namespace MediaBrowser.Model.Dlna
}
}
public bool IsVideoAudioConditionSatisfied(ProfileCondition condition,
public static bool IsVideoAudioConditionSatisfied(
ProfileCondition condition,
int? audioChannels,
int? audioBitrate,
int? audioSampleRate,
@@ -121,7 +123,7 @@ namespace MediaBrowser.Model.Dlna
}
}
private bool IsConditionSatisfied(ProfileCondition condition, int? currentValue)
private static bool IsConditionSatisfied(ProfileCondition condition, int? currentValue)
{
if (!currentValue.HasValue)
{
@@ -150,7 +152,7 @@ namespace MediaBrowser.Model.Dlna
return false;
}
private bool IsConditionSatisfied(ProfileCondition condition, string currentValue)
private static bool IsConditionSatisfied(ProfileCondition condition, string currentValue)
{
if (string.IsNullOrEmpty(currentValue))
{
@@ -175,7 +177,7 @@ namespace MediaBrowser.Model.Dlna
}
}
private bool IsConditionSatisfied(ProfileCondition condition, bool? currentValue)
private static bool IsConditionSatisfied(ProfileCondition condition, bool? currentValue)
{
if (!currentValue.HasValue)
{
@@ -199,7 +201,7 @@ namespace MediaBrowser.Model.Dlna
return false;
}
private bool IsConditionSatisfied(ProfileCondition condition, float currentValue)
private static bool IsConditionSatisfied(ProfileCondition condition, float currentValue)
{
if (currentValue <= 0)
{
@@ -227,7 +229,7 @@ namespace MediaBrowser.Model.Dlna
return false;
}
private bool IsConditionSatisfied(ProfileCondition condition, double? currentValue)
private static bool IsConditionSatisfied(ProfileCondition condition, double? currentValue)
{
if (!currentValue.HasValue)
{
@@ -255,7 +257,7 @@ namespace MediaBrowser.Model.Dlna
return false;
}
private bool IsConditionSatisfied(ProfileCondition condition, TransportStreamTimestamp? timestamp)
private static bool IsConditionSatisfied(ProfileCondition condition, TransportStreamTimestamp? timestamp)
{
if (!timestamp.HasValue)
{