1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update to latest js api client

This commit is contained in:
Luke Pulverenti 2013-03-24 23:23:42 -04:00
parent 4d68177cdb
commit 9fea87bfac
2 changed files with 67 additions and 4 deletions

View file

@ -1571,8 +1571,71 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
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);
/**
@ -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);
return temp.toLowerCase();
};
}

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<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.Text" version="3.9.42" targetFramework="net45" />
</packages>