make model project portable

This commit is contained in:
Luke Pulverenti
2016-10-21 22:08:34 -04:00
parent f8c603d5eb
commit c7f559f8ce
166 changed files with 1184 additions and 5477 deletions

View File

@@ -1,6 +1,7 @@
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.MediaInfo;
using System;
using System.Globalization;
namespace MediaBrowser.Model.Dlna
{
@@ -86,8 +87,8 @@ namespace MediaBrowser.Model.Dlna
}
}
public bool IsVideoAudioConditionSatisfied(ProfileCondition condition,
int? audioChannels,
public bool IsVideoAudioConditionSatisfied(ProfileCondition condition,
int? audioChannels,
int? audioBitrate,
string audioProfile,
bool? isSecondaryTrack)
@@ -116,7 +117,7 @@ namespace MediaBrowser.Model.Dlna
}
int expected;
if (IntHelper.TryParseCultureInvariant(condition.Value, out expected))
if (int.TryParse(condition.Value, NumberStyles.Any, CultureInfo.InvariantCulture, out expected))
{
switch (condition.Condition)
{
@@ -149,9 +150,9 @@ namespace MediaBrowser.Model.Dlna
switch (condition.Condition)
{
case ProfileConditionType.EqualsAny:
{
return ListHelper.ContainsIgnoreCase(expected.Split('|'), currentValue);
}
{
return ListHelper.ContainsIgnoreCase(expected.Split('|'), currentValue);
}
case ProfileConditionType.Equals:
return StringHelper.EqualsIgnoreCase(currentValue, expected);
case ProfileConditionType.NotEquals:
@@ -214,7 +215,7 @@ namespace MediaBrowser.Model.Dlna
return false;
}
private bool IsConditionSatisfied(ProfileCondition condition, double? currentValue)
{
if (!currentValue.HasValue)
@@ -243,7 +244,7 @@ namespace MediaBrowser.Model.Dlna
return false;
}
private bool IsConditionSatisfied(ProfileCondition condition, TransportStreamTimestamp? timestamp)
{
if (!timestamp.HasValue)
@@ -251,9 +252,9 @@ namespace MediaBrowser.Model.Dlna
// If the value is unknown, it satisfies if not marked as required
return !condition.IsRequired;
}
TransportStreamTimestamp expected = (TransportStreamTimestamp)Enum.Parse(typeof(TransportStreamTimestamp), condition.Value, true);
switch (condition.Condition)
{
case ProfileConditionType.Equals: