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

reduce traffic from play to feature

This commit is contained in:
Luke Pulverenti 2017-01-24 14:54:18 -05:00
parent 7b80b2ea32
commit 58cebe2486
18 changed files with 157 additions and 59 deletions

View file

@ -16,12 +16,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.1.121",
"_release": "1.1.121",
"version": "1.1.125",
"_release": "1.1.125",
"_resolution": {
"type": "version",
"tag": "1.1.121",
"commit": "5785022dd5fdf3633606d4c84d59f52ffa61251d"
"tag": "1.1.125",
"commit": "de914c8db94b994ea45746626ba73bfb72a594a0"
},
"_source": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
"_target": "^1.1.51",

View file

@ -1408,6 +1408,26 @@
return self.getJSON(url);
};
self.getPlaybackInfo = function(itemId, options, deviceProfile) {
var postData = {
DeviceProfile: deviceProfile
};
return self.ajax({
url: self.getUrl('Items/' + itemId + '/PlaybackInfo', options),
type: 'POST',
data: JSON.stringify(postData),
contentType: "application/json",
dataType: "json"
});
};
self.getIntros = function(itemId) {
return self.getJSON(self.getUrl('Users/' + self.getCurrentUserId() + '/Items/' + itemId + '/Intros'));
};
/**
* Gets the directory contents of a path on the server
*/

View file

@ -298,7 +298,65 @@
return result;
}
function getPlaybackInfo(itemId, options, deviceProfile) {
return localassetmanager.getLocalItem(apiclientcore.serverId(), stripStart(itemId, localPrefix)).then(function (item) {
// TODO: This was already done during the sync process, right? If so, remove it
var mediaSources = item.Item.MediaSources.map(function (m) {
m.SupportsDirectPlay = true;
m.SupportsDirectStream = false;
m.SupportsTranscoding = false;
return m;
});
return {
MediaSources: mediaSources
};
});
}
// "Override" methods
self.detectBitrate = function () {
return Promise.reject();
};
self.reportPlaybackStart = function (options) {
if (!options) {
throw new Error("null options");
}
return Promise.resolve();
};
self.reportPlaybackProgress = function (options) {
if (!options) {
throw new Error("null options");
}
return Promise.resolve();
};
self.reportPlaybackStopped = function (options) {
if (!options) {
throw new Error("null options");
}
return Promise.resolve();
};
self.getIntros = function (itemId) {
return Promise.resolve({
Items: [],
TotalRecordCount: 0
});
};
self.getUserViews = getUserViews;
self.getItems = getItems;
self.getItem = getItem;
@ -309,6 +367,7 @@
self.getSimilarItems = getSimilarItems;
self.updateFavoriteStatus = updateFavoriteStatus;
self.getScaledImageUrl = getScaledImageUrl;
self.getPlaybackInfo = getPlaybackInfo;
};
});