diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-10-21 22:08:34 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-10-21 22:08:34 -0400 |
| commit | c7f559f8cefa4c4b90df3bff72290c8bd5b18e01 (patch) | |
| tree | 4d26b4995e7df5d44c39d76ba58db66f1e48dbc4 /MediaBrowser.Model/Dlna/ConditionProcessor.cs | |
| parent | f8c603d5ebc28e03140df4f1b155c97b387f09a5 (diff) | |
make model project portable
Diffstat (limited to 'MediaBrowser.Model/Dlna/ConditionProcessor.cs')
| -rw-r--r-- | MediaBrowser.Model/Dlna/ConditionProcessor.cs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/MediaBrowser.Model/Dlna/ConditionProcessor.cs b/MediaBrowser.Model/Dlna/ConditionProcessor.cs index ec13cacfae..6628e290e7 100644 --- a/MediaBrowser.Model/Dlna/ConditionProcessor.cs +++ b/MediaBrowser.Model/Dlna/ConditionProcessor.cs @@ -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: |
