update to latest js api client

This commit is contained in:
Luke Pulverenti 2013-03-26 00:33:47 -04:00
parent a4756fffe1
commit 62521eabc2
8 changed files with 73 additions and 26 deletions

View File

@ -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);
}
/// <summary>
/// Class WebSocketMessage
/// </summary>
/// <typeparam name="T"></typeparam>
public class WebSocketMessage<T>
{
/// <summary>
/// Gets or sets the type of the message.
/// </summary>
/// <value>The type of the message.</value>
public string MessageType { get; set; }
/// <summary>
/// Gets or sets the data.
/// </summary>
/// <value>The data.</value>
public T Data { get; set; }
}
/// <summary>
/// Class WebSocketMessageInfo
/// </summary>

View File

@ -46,6 +46,7 @@
<Compile Include="Dto\ChapterInfoDto.cs" />
<Compile Include="Dto\IItemDto.cs" />
<Compile Include="Entities\IByReferenceItem.cs" />
<Compile Include="Net\WebSocketMessage.cs" />
<Compile Include="Net\WebSocketMessageType.cs" />
<Compile Include="Net\WebSocketState.cs" />
<Compile Include="Querying\ItemsByNameQuery.cs" />

View File

@ -0,0 +1,22 @@

namespace MediaBrowser.Model.Net
{
/// <summary>
/// Class WebSocketMessage
/// </summary>
/// <typeparam name="T"></typeparam>
public class WebSocketMessage<T>
{
/// <summary>
/// Gets or sets the type of the message.
/// </summary>
/// <value>The type of the message.</value>
public string MessageType { get; set; }
/// <summary>
/// Gets or sets the data.
/// </summary>
/// <value>The data.</value>
public T Data { get; set; }
}
}

View File

@ -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.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.67" targetFramework="net45" />
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.68" targetFramework="net45" />
<package id="ServiceStack.Common" version="3.9.42" targetFramework="net45" />
<package id="ServiceStack.Text" version="3.9.42" targetFramework="net45" />
</packages>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common.Internal</id>
<version>3.0.58</version>
<version>3.0.61</version>
<title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains common components shared by Media Browser Theatre and Media Browser Server. Not intended for plugin developer consumption.</description>
<copyright>Copyright © Media Browser 2013</copyright>
<dependencies>
<dependency id="MediaBrowser.Common" version="3.0.58" />
<dependency id="MediaBrowser.Common" version="3.0.61" />
<dependency id="NLog" version="2.0.0.2000" />
<dependency id="ServiceStack.Text" version="3.9.38" />
<dependency id="protobuf-net" version="2.0.0.621" />

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common</id>
<version>3.0.58</version>
<version>3.0.61</version>
<title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>MediaBrowser.Server.Core</id>
<version>3.0.58</version>
<version>3.0.61</version>
<title>Media Browser.Server.Core</title>
<authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Media Browser Server.</description>
<copyright>Copyright © Media Browser 2013</copyright>
<dependencies>
<dependency id="MediaBrowser.Common" version="3.0.58" />
<dependency id="MediaBrowser.Common" version="3.0.61" />
</dependencies>
</metadata>
<files>