mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-15 02:33:33 +01:00
make model project portable
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user