update libs

This commit is contained in:
Luke Pulverenti 2015-09-11 22:18:09 -04:00
parent e96f1d7e00
commit 0f37b99468
6 changed files with 138 additions and 29 deletions

View File

@ -26,6 +26,109 @@
var capabilities = ConnectionManager.capabilities();
ApiClientBridge.init(AppInfo.appName, AppInfo.appVersion, AppInfo.deviceId, AppInfo.deviceName, JSON.stringify(capabilities));
initAjax();
}
var baseAjaxMethod;
var currentId = 0;
function getNewRequestId() {
var id = currentId++;
return id.toString();
}
function initAjax() {
baseAjaxMethod = HttpClient.send;
HttpClient.send = sendRequest;
}
function sendRequest(request) {
// For now, we can only handle json responses
if (request.dataType) {
if (request.dataType != 'json') {
return baseAjaxMethod(request);
}
}
if (request.data) {
// For now, we can only handle request bodies that are strings
if (typeof (request.data) != 'string') {
return baseAjaxMethod(request);
}
}
var deferred = DeferredBuilder.Deferred();
var id = getNewRequestId();
request.headers = request.headers || {};
if (request.dataType == 'json') {
request.headers.accept = 'application/json';
}
var method = request.type || "GET";
var javaRequest = {
Method: method,
Url: request.url,
RequestHeaders: request.headers
};
if (request.timeout) {
javaRequest.Timeout = request.timeout;
}
if (request.data) {
javaRequest.RequestContent = request.data;
}
if (request.contentType) {
javaRequest.RequestContentType = request.contentType;
}
//Logger.log("Sending request: " + JSON.stringify(javaRequest));
ApiClientBridge.sendRequest(JSON.stringify(javaRequest), request.dataType, id);
Events.on(AndroidAjax, 'response' + id, function (e, isSuccess, response) {
Events.off(AndroidAjax, 'response' + id);
if (isSuccess) {
if (response) {
deferred.resolveWith(null, [response]);
} else {
deferred.resolve();
}
}
else {
// Need to mimic the jquery ajax error response
deferred.rejectWith(request, [getErrorResponse(response)]);
}
});
return deferred.promise();
}
function getErrorResponse(response) {
var error = {};
if (response.StatusCode) {
error.status = response.StatusCode;
}
error.ResponseHeaders = response.ResponseHeaders || {};
error.getResponseHeader = function (name) {
return error.ResponseHeaders[name];
};
return error;
}
function getDownloadSpeed(bytes, url) {
@ -78,6 +181,14 @@
window.AndroidAjax = {
onResponse: function (id, response) {
Events.trigger(AndroidAjax, 'response' + id, [true, response]);
},
onError: function (id, response) {
Events.trigger(AndroidAjax, 'response' + id, [false, response]);
},
onDownloadSpeedResponse: function (response) {
Events.trigger(AndroidAjax, 'downloadspeedresponse', [response]);

View File

@ -71,14 +71,14 @@
var deferred = DeferredBuilder.Deferred();
var key = getCacheKey(originalUrl);
Logger.log('getImageUrl:' + originalUrl);
//Logger.log('getImageUrl:' + originalUrl);
getFileSystem().done(function (fileSystem) {
var path = fileSystem.root.toURL() + "/emby/cache/" + key;
resolveLocalFileSystemURL(path, function (fileEntry) {
var localUrl = normalizeReturnUrl(fileEntry.toURL());
Logger.log('returning cached file: ' + localUrl);
//Logger.log('returning cached file: ' + localUrl);
deferred.resolveWith(null, [localUrl]);
}, function () {

View File

@ -527,15 +527,13 @@
minScale: 2
});
personHtml += '<div class="tileImage lazy" data-src="' + imgUrl + '" style="height:' + height + 'px;"></div>';
} else {
imgUrl = "css/images/items/list/person.png";
personHtml += '<div class="tileImage" style="background-image:url(\'' + imgUrl + '\');height:' + height + 'px;"></div>';
}
personHtml += '<div class="tileImage lazy" data-src="' + imgUrl + '" style="height:' + height + 'px;"></div>';
personHtml += '<div class="tileContent">';
personHtml += '<p>' + cast.Name + '</p>';

View File

@ -438,26 +438,26 @@
Format: 'srt',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'ass',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'ssa',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'pgs',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'pgssub',
Method: 'Embed'
});
profile.SubtitleProfiles.push({
Format: 'dvdsub',
Method: 'Embed'
});
//profile.SubtitleProfiles.push({
// Format: 'ass',
// Method: 'Embed'
//});
//profile.SubtitleProfiles.push({
// Format: 'ssa',
// Method: 'Embed'
//});
//profile.SubtitleProfiles.push({
// Format: 'pgs',
// Method: 'Embed'
//});
//profile.SubtitleProfiles.push({
// Format: 'pgssub',
// Method: 'Embed'
//});
//profile.SubtitleProfiles.push({
// Format: 'dvdsub',
// Method: 'Embed'
//});
profile.SubtitleProfiles.push({
Format: 'vtt',
Method: 'Embed'

View File

@ -1426,8 +1426,8 @@
"OptionAllowVideoPlaybackTranscoding": "Allow video playback that requires transcoding",
"OptionAllowMediaPlaybackTranscodingHelp": "Users will receive friendly messages when content is unplayable based on policy.",
"TabStreaming": "Streaming",
"LabelRemoteClientBitrateLimit": "Remote client bitrate limit (Mbps):",
"LabelRemoteClientBitrateLimitHelp": "An optional streaming bitrate limit for all remote clients. This is useful to prevent clients from requesting a higher bitrate than your connection can handle.",
"LabelRemoteClientBitrateLimit": "Internet streaming bitrate limit (Mbps):",
"LabelRemoteClientBitrateLimitHelp": "An optional streaming bitrate limit for all out of network clients. This is useful to prevent clients from requesting a higher bitrate than your internet connection can handle.",
"LabelConversionCpuCoreLimit": "CPU core limit:",
"LabelConversionCpuCoreLimitHelp": "Limit the number of CPU cores that will be used during sync conversion.",
"OptionEnableFullSpeedConversion": "Enable full speed conversion",

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.249" targetFramework="net45" />
<package id="WebMarkupMin.Core" version="0.9.12" targetFramework="net45" />
<package id="WebMarkupMin.Core" version="1.0.0" targetFramework="net45" />
</packages>