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

@ -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;
};
});