diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-06-02 15:32:41 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-06-02 15:32:41 -0400 |
| commit | 858c37b8607ff0698a94b9e7bfff6190d3bca56d (patch) | |
| tree | ec673c5ebe7ffe813b6a16340471ac472a5dbf5b /MediaBrowser.Server.Implementations/Session/HttpSessionController.cs | |
| parent | 36648d27082c1ee50c1483e17f14ba1ae838a00e (diff) | |
add channel downloading settings
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/HttpSessionController.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Session/HttpSessionController.cs | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/HttpSessionController.cs b/MediaBrowser.Server.Implementations/Session/HttpSessionController.cs index f1d4c3555..a3a6d3630 100644 --- a/MediaBrowser.Server.Implementations/Session/HttpSessionController.cs +++ b/MediaBrowser.Server.Implementations/Session/HttpSessionController.cs @@ -6,6 +6,7 @@ using MediaBrowser.Model.Session; using MediaBrowser.Model.System; using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Net; using System.Threading; @@ -125,13 +126,16 @@ namespace MediaBrowser.Server.Implementations.Session public Task SendPlayCommand(PlayRequest command, CancellationToken cancellationToken) { - return Task.FromResult(true); - //return SendMessage(new WebSocketMessage<PlayRequest> - //{ - // MessageType = "Play", - // Data = command + var dict = new Dictionary<string, string>(); + + dict["ItemIds"] = string.Join(",", command.ItemIds); + + if (command.StartPositionTicks.HasValue) + { + dict["StartPositionTicks"] = command.StartPositionTicks.Value.ToString(CultureInfo.InvariantCulture); + } - //}, cancellationToken); + return SendMessage(command.PlayCommand.ToString(), dict, cancellationToken); } public Task SendPlaystateCommand(PlaystateRequest command, CancellationToken cancellationToken) @@ -140,7 +144,12 @@ namespace MediaBrowser.Server.Implementations.Session if (command.Command == PlaystateCommand.Seek) { + if (!command.SeekPositionTicks.HasValue) + { + throw new ArgumentException("SeekPositionTicks cannot be null"); + } + args["StartPositionTicks"] = command.SeekPositionTicks.Value.ToString(CultureInfo.InvariantCulture); } return SendMessage(command.Command.ToString(), cancellationToken); |
