update to latest js api client

pull/702/head
Luke Pulverenti 12 years ago
parent 8b32e3292a
commit 9b41a3d35c

@ -1571,7 +1571,70 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
dataType: "json" dataType: "json"
}); });
}; };
};
/**
* Reports progress viewing an item
* @param {String} userId
* @param {String} itemId
*/
self.reportPlaybackProgress = function (userId, itemId, positionTicks) {
if (!userId) {
throw new Error("null userId");
}
if (!itemId) {
throw new Error("null itemId");
}
var params = {
};
if (positionTicks) {
params.positionTicks = positionTicks;
}
var url = self.getUrl("Users/" + userId + "/PlayingItems/" + itemId + "/Progress", params);
return self.ajax({
type: "POST",
url: url,
dataType: "json"
});
};
/**
* Reports a user has stopped playing an item
* @param {String} userId
* @param {String} itemId
*/
self.reportPlaybackStopped = function (userId, itemId, positionTicks) {
if (!userId) {
throw new Error("null userId");
}
if (!itemId) {
throw new Error("null itemId");
}
var params = {
};
if (positionTicks) {
params.positionTicks = positionTicks;
}
var url = self.getUrl("Users/" + userId + "/PlayingItems/" + itemId, params);
return self.ajax({
type: "DELETE",
url: url,
dataType: "json"
});
};
}
}(jQuery, navigator, JSON, window.WebSocket, setTimeout); }(jQuery, navigator, JSON, window.WebSocket, setTimeout);
@ -1669,7 +1732,7 @@ MediaBrowser.SHA1 = function (msg) {
var word_array = new Array(); var word_array = new Array();
for (i = 0; i < msg_len - 3; i += 4) { for (i = 0; i < msg_len - 3; i += 4) {
j = msg.charCodeAt(i) << 24 | msg.charCodeAt(i + 1) << 16 | j = msg.charCodeAt(i) << 24 | msg.charCodeAt(i + 1) << 16 |
msg.charCodeAt(i + 2) << 8 | msg.charCodeAt(i + 3); msg.charCodeAt(i + 2) << 8 | msg.charCodeAt(i + 3);
word_array.push(j); word_array.push(j);
} }
@ -1756,4 +1819,4 @@ MediaBrowser.SHA1 = function (msg) {
var temp = cvt_hex(H0) + cvt_hex(H1) + cvt_hex(H2) + cvt_hex(H3) + cvt_hex(H4); var temp = cvt_hex(H0) + cvt_hex(H1) + cvt_hex(H2) + cvt_hex(H3) + cvt_hex(H4);
return temp.toLowerCase(); return temp.toLowerCase();
}; }

@ -83,6 +83,7 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="ApiClient.js" />
<Content Include="dashboard-ui\index.html"> <Content Include="dashboard-ui\index.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
@ -649,7 +650,6 @@
<Content Include="dashboard-ui\about.html"> <Content Include="dashboard-ui\about.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<EmbeddedResource Include="ApiClient.js" />
<Content Include="dashboard-ui\css\images\stars.png"> <Content Include="dashboard-ui\css\images\stars.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.50" targetFramework="net45" /> <package id="MediaBrowser.ApiClient.Javascript" version="3.0.58" targetFramework="net45" />
<package id="ServiceStack.Common" version="3.9.42" targetFramework="net45" /> <package id="ServiceStack.Common" version="3.9.42" targetFramework="net45" />
<package id="ServiceStack.Text" version="3.9.42" targetFramework="net45" /> <package id="ServiceStack.Text" version="3.9.42" targetFramework="net45" />
</packages> </packages>
Loading…
Cancel
Save