aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.WebDashboard/ApiClient.js
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.WebDashboard/ApiClient.js')
-rw-r--r--MediaBrowser.WebDashboard/ApiClient.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/MediaBrowser.WebDashboard/ApiClient.js b/MediaBrowser.WebDashboard/ApiClient.js
index ebd4f8a27..d047b494e 100644
--- a/MediaBrowser.WebDashboard/ApiClient.js
+++ b/MediaBrowser.WebDashboard/ApiClient.js
@@ -1573,6 +1573,30 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
};
/**
+ * Reports the user has started playing something
+ * @param {String} userId
+ * @param {String} itemId
+ */
+ self.reportPlaybackStart = function (userId, itemId) {
+
+ if (!userId) {
+ throw new Error("null userId");
+ }
+
+ if (!itemId) {
+ throw new Error("null itemId");
+ }
+
+ var url = self.getUrl("Users/" + userId + "/PlayingItems/" + itemId);
+
+ return self.ajax({
+ type: "POST",
+ url: url,
+ dataType: "json"
+ });
+ };
+
+ /**
* Reports progress viewing an item
* @param {String} userId
* @param {String} itemId