diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-02 17:55:19 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-02 17:55:19 -0400 |
| commit | 0200911afc125051b4f5e652ef1bebeca984b571 (patch) | |
| tree | d6f00cd6b521dd2232bf0ac1f9d110773e3abe7e /MediaBrowser.Model | |
| parent | dcf2e70f039a79dd93ac4f6f3cd5b2c8c9a4dcc8 (diff) | |
add latest translations
Diffstat (limited to 'MediaBrowser.Model')
| -rw-r--r-- | MediaBrowser.Model/Dlna/StreamBuilder.cs | 43 | ||||
| -rw-r--r-- | MediaBrowser.Model/Session/SessionCapabilities.cs | 14 | ||||
| -rw-r--r-- | MediaBrowser.Model/Session/SessionInfoDto.cs | 7 |
3 files changed, 24 insertions, 40 deletions
diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index d03567ffc1..afd696e544 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -1,10 +1,9 @@ -using System; +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.Entities; +using System; +using System.Collections.Generic; using System.Globalization; -using System.IO; using System.Linq; -using MediaBrowser.Model.Dto; -using System.Collections.Generic; -using MediaBrowser.Model.Entities; namespace MediaBrowser.Model.Dlna { @@ -453,19 +452,19 @@ namespace MediaBrowser.Model.Dlna if (actualValue.HasValue) { - long expected; - if (long.TryParse(condition.Value, NumberStyles.Any, _usCulture, out expected)) + double expected; + if (double.TryParse(condition.Value, NumberStyles.Any, _usCulture, out expected)) { switch (condition.Condition) { case ProfileConditionType.Equals: - return actualValue.Value == expected; + return actualValue.Value.Equals(expected); case ProfileConditionType.GreaterThanEqual: return actualValue.Value >= expected; case ProfileConditionType.LessThanEqual: return actualValue.Value <= expected; case ProfileConditionType.NotEquals: - return actualValue.Value != expected; + return !actualValue.Value.Equals(expected); default: throw new InvalidOperationException("Unexpected ProfileConditionType"); } @@ -486,7 +485,7 @@ namespace MediaBrowser.Model.Dlna /// <param name="audioStream">The audio stream.</param> /// <returns>System.Nullable{System.Int64}.</returns> /// <exception cref="System.InvalidOperationException">Unexpected Property</exception> - private long? GetConditionValue(ProfileCondition condition, string mediaPath, MediaStream videoStream, MediaStream audioStream) + private double? GetConditionValue(ProfileCondition condition, string mediaPath, MediaStream videoStream, MediaStream audioStream) { switch (condition.Property) { @@ -497,37 +496,17 @@ namespace MediaBrowser.Model.Dlna case ProfileConditionValue.VideoBitrate: return videoStream == null ? null : videoStream.BitRate; case ProfileConditionValue.VideoFramerate: - return videoStream == null ? null : (ConvertToLong(videoStream.AverageFrameRate ?? videoStream.RealFrameRate)); + return videoStream == null ? null : (videoStream.AverageFrameRate ?? videoStream.RealFrameRate); case ProfileConditionValue.Height: return videoStream == null ? null : videoStream.Height; case ProfileConditionValue.Width: return videoStream == null ? null : videoStream.Width; case ProfileConditionValue.VideoLevel: - return videoStream == null ? null : ConvertToLong(videoStream.Level); + return videoStream == null ? null : videoStream.Level; default: throw new InvalidOperationException("Unexpected Property"); } } - - /// <summary> - /// Converts to long. - /// </summary> - /// <param name="val">The value.</param> - /// <returns>System.Nullable{System.Int64}.</returns> - private long? ConvertToLong(float? val) - { - return val.HasValue ? Convert.ToInt64(val.Value) : (long?)null; - } - - /// <summary> - /// Converts to long. - /// </summary> - /// <param name="val">The value.</param> - /// <returns>System.Nullable{System.Int64}.</returns> - private long? ConvertToLong(double? val) - { - return val.HasValue ? Convert.ToInt64(val.Value) : (long?)null; - } } } diff --git a/MediaBrowser.Model/Session/SessionCapabilities.cs b/MediaBrowser.Model/Session/SessionCapabilities.cs index 7b3b04ce92..290b0e4d47 100644 --- a/MediaBrowser.Model/Session/SessionCapabilities.cs +++ b/MediaBrowser.Model/Session/SessionCapabilities.cs @@ -1,19 +1,17 @@ - +using System.Collections.Generic; + namespace MediaBrowser.Model.Session { public class SessionCapabilities { - public string[] PlayableMediaTypes { get; set; } - - public bool SupportsFullscreenToggle { get; set; } + public List<string> PlayableMediaTypes { get; set; } - public bool SupportsOsdToggle { get; set; } + public List<string> SupportedCommands { get; set; } - public bool SupportsNavigationControl { get; set; } - public SessionCapabilities() { - PlayableMediaTypes = new string[] {}; + PlayableMediaTypes = new List<string>(); + SupportedCommands = new List<string>(); } } } diff --git a/MediaBrowser.Model/Session/SessionInfoDto.cs b/MediaBrowser.Model/Session/SessionInfoDto.cs index 09a8375d81..5349a6360f 100644 --- a/MediaBrowser.Model/Session/SessionInfoDto.cs +++ b/MediaBrowser.Model/Session/SessionInfoDto.cs @@ -16,6 +16,12 @@ namespace MediaBrowser.Model.Session public bool CanSeek { get; set; } /// <summary> + /// Gets or sets the supported commands. + /// </summary> + /// <value>The supported commands.</value> + public List<string> SupportedCommands { get; set; } + + /// <summary> /// Gets or sets the remote end point. /// </summary> /// <value>The remote end point.</value> @@ -167,6 +173,7 @@ namespace MediaBrowser.Model.Session PlayableMediaTypes = new List<string>(); QueueableMediaTypes = new List<string>(); + SupportedCommands = new List<string>(); } } |
