From 62521eabc20cb73d7236b57a506181af277f3a9e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 26 Mar 2013 00:33:47 -0400 Subject: [PATCH] update to latest js api client --- .../Net/IWebSocketConnection.cs | 22 +--------- MediaBrowser.Model/MediaBrowser.Model.csproj | 1 + MediaBrowser.Model/Net/WebSocketMessage.cs | 22 ++++++++++ MediaBrowser.WebDashboard/ApiClient.js | 42 +++++++++++++++++++ MediaBrowser.WebDashboard/packages.config | 2 +- Nuget/MediaBrowser.Common.Internal.nuspec | 4 +- Nuget/MediaBrowser.Common.nuspec | 2 +- Nuget/MediaBrowser.Server.Core.nuspec | 4 +- 8 files changed, 73 insertions(+), 26 deletions(-) create mode 100644 MediaBrowser.Model/Net/WebSocketMessage.cs diff --git a/MediaBrowser.Common/Net/IWebSocketConnection.cs b/MediaBrowser.Common/Net/IWebSocketConnection.cs index c09d5ba2b..f0e499bd6 100644 --- a/MediaBrowser.Common/Net/IWebSocketConnection.cs +++ b/MediaBrowser.Common/Net/IWebSocketConnection.cs @@ -1,7 +1,7 @@ -using System; +using MediaBrowser.Model.Net; +using System; using System.Threading; using System.Threading.Tasks; -using MediaBrowser.Model.Net; namespace MediaBrowser.Common.Net { @@ -54,24 +54,6 @@ namespace MediaBrowser.Common.Net Task SendAsync(byte[] buffer, WebSocketMessageType type, CancellationToken cancellationToken); } - /// - /// Class WebSocketMessage - /// - /// - public class WebSocketMessage - { - /// - /// Gets or sets the type of the message. - /// - /// The type of the message. - public string MessageType { get; set; } - /// - /// Gets or sets the data. - /// - /// The data. - public T Data { get; set; } - } - /// /// Class WebSocketMessageInfo /// diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index ae6e21923..adbec288b 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -46,6 +46,7 @@ + diff --git a/MediaBrowser.Model/Net/WebSocketMessage.cs b/MediaBrowser.Model/Net/WebSocketMessage.cs new file mode 100644 index 000000000..2cd6828b3 --- /dev/null +++ b/MediaBrowser.Model/Net/WebSocketMessage.cs @@ -0,0 +1,22 @@ + +namespace MediaBrowser.Model.Net +{ + /// + /// Class WebSocketMessage + /// + /// + public class WebSocketMessage + { + /// + /// Gets or sets the type of the message. + /// + /// The type of the message. + public string MessageType { get; set; } + /// + /// Gets or sets the data. + /// + /// The data. + public T Data { get; set; } + } + +} diff --git a/MediaBrowser.WebDashboard/ApiClient.js b/MediaBrowser.WebDashboard/ApiClient.js index 5381a7abd..0f014f870 100644 --- a/MediaBrowser.WebDashboard/ApiClient.js +++ b/MediaBrowser.WebDashboard/ApiClient.js @@ -1516,6 +1516,48 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }); }; + /** + * Gets local trailers for an item + */ + self.getLocalTrailers = function (userId, itemId) { + + if (!userId) { + throw new Error("null userId"); + } + if (!itemId) { + throw new Error("null itemId"); + } + + var url = self.getUrl("Users/" + userId + "/Items/" + itemId + "/LocalTrailers"); + + return self.ajax({ + type: "GET", + url: url, + dataType: "json" + }); + }; + + /** + * Gets special features for an item + */ + self.getSpecialFeatures = function (userId, itemId) { + + if (!userId) { + throw new Error("null userId"); + } + if (!itemId) { + throw new Error("null itemId"); + } + + var url = self.getUrl("Users/" + userId + "/Items/" + itemId + "/SpecialFeatures"); + + return self.ajax({ + type: "GET", + url: url, + dataType: "json" + }); + }; + /** * Marks an item as played or unplayed * This should not be used to update playstate following playback. diff --git a/MediaBrowser.WebDashboard/packages.config b/MediaBrowser.WebDashboard/packages.config index 5599c176d..f1726c072 100644 --- a/MediaBrowser.WebDashboard/packages.config +++ b/MediaBrowser.WebDashboard/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index 2d084587d..19b811fe9 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common.Internal - 3.0.58 + 3.0.61 MediaBrowser.Common.Internal Luke ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains common components shared by Media Browser Theatre and Media Browser Server. Not intended for plugin developer consumption. Copyright © Media Browser 2013 - + diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index 3efe35230..78a4fbbad 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.58 + 3.0.61 MediaBrowser.Common Media Browser Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index 672a52245..4a9693e7f 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.58 + 3.0.61 Media Browser.Server.Core Media Browser Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Media Browser Server. Copyright © Media Browser 2013 - +