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

update live tv database

This commit is contained in:
Luke Pulverenti 2015-06-01 10:49:23 -04:00
parent 8e0dc6d8e4
commit d4abbd5560
9 changed files with 116 additions and 25 deletions

View file

@ -36,7 +36,7 @@
top: 0;
}
@media all and (max-width: 740px) {
@media all and (max-width: 600px) {
.headerSelectedPlayer {
display: none;
}

View file

@ -29,7 +29,7 @@
}
.flyoutNotification {
border-top: 1px solid #444;
border-top: 1px solid #404040;
padding: 0 0 .5em;
}
@ -40,7 +40,7 @@
}
.flyoutNotification:last-child {
border-bottom: 1px solid #444;
border-bottom: 1px solid #404040;
}
.flyoutNotification a {

View file

@ -124,7 +124,8 @@ var WebNotifications = {
show: function (data) {
if (window.cordova && window.cordova.plugins && window.cordova.plugins.notification) {
// Seeing crashes in android
if (window.cordova && window.cordova.plugins && window.cordova.plugins.notification && !$.browser.android) {
if (!WebNotifications.lastId) {
// Cordova plugin will crash on android with long. need an int

View file

@ -68,7 +68,7 @@
elem.popup("open").parents(".ui-popup-container").css("margin-top", 30);
if ($.browser.safari) {
$('.itemVideo').css('visibility', 'hidden');
//$('.itemVideo').css('visibility', 'hidden');
}
}

View file

@ -185,23 +185,30 @@
function switchConnectionMode(connectionMode) {
var newConnectionMode;
var currentServerInfo = self.serverInfo();
var newConnectionMode = connectionMode;
if (connectionMode == MediaBrowser.ConnectionMode.Local && currentServerInfo.RemoteAddress) {
newConnectionMode = MediaBrowser.ConnectionMode.Remote;
}
else if (connectionMode != MediaBrowser.ConnectionMode.Local && currentServerInfo.LocalAddress) {
newConnectionMode = MediaBrowser.ConnectionMode.Local;
}
else {
newConnectionMode = connectionMode;
newConnectionMode--;
if (newConnectionMode < 0) {
newConnectionMode = MediaBrowser.ConnectionMode.Manual;
}
if (MediaBrowser.ServerInfo.getServerAddress(currentServerInfo, newConnectionMode)) {
return newConnectionMode;
}
newConnectionMode--;
if (newConnectionMode < 0) {
newConnectionMode = MediaBrowser.ConnectionMode.Manual;
}
if (MediaBrowser.ServerInfo.getServerAddress(currentServerInfo, newConnectionMode)) {
return newConnectionMode;
}
return connectionMode;
}
function tryReconnectInternal(deferred, connectionMode, currentRetryCount) {
connectionMode = switchConnectionMode(connectionMode);
@ -209,13 +216,15 @@
logger.log("Attempting reconnection to " + url);
var timeout = connectionMode == MediaBrowser.ConnectionMode.Local ? 5000 : 15000;
AjaxApi.ajax({
type: "GET",
url: url + "/system/info/public",
dataType: "json",
timeout: 15000
timeout: timeout
}).done(function () {

View file

@ -9,10 +9,14 @@
return r.id != id;
});
updatedProducts.push({
var product = {
id: id,
owned: owned
});
};
updatedProducts.push(product);
Events.trigger(IapManager, 'productupdated', [product]);
}
function hasPurchased(id) {
@ -39,7 +43,14 @@
}
function onPurchaseComplete(result) {
alert(result);
if (result) {
refreshPurchases();
}
}
function refreshPurchases() {
NativeIapManager.isPurchased(unlockId, "window.IapManager.updateProduct");
}
window.IapManager = {
@ -50,6 +61,6 @@
onPurchaseComplete: onPurchaseComplete
};
NativeIapManager.isPurchased(unlockId, "window.IapManager.updateProduct");
refreshPurchases();
})();

View file

@ -139,11 +139,30 @@
return deferred.promise();
};
function getCacheKey(url) {
// Try to strip off the domain to share the cache between local and remote connections
var index = url.indexOf('://');
if (index != -1) {
url = url.substring(index + 3);
index = url.indexOf('/');
if (index != -1) {
url = url.substring(index + 1);
}
}
return CryptoJS.MD5(url).toString();
}
self.getImageUrl = function (originalUrl) {
console.log('getImageUrl:' + originalUrl);
var key = CryptoJS.MD5(originalUrl + "1").toString();
var key = getCacheKey(originalUrl);
var deferred = DeferredBuilder.Deferred();

View file

@ -76,12 +76,29 @@
return deferred.promise();
};
function getCacheKey(url) {
// Try to strip off the domain to share the cache between local and remote connections
var index = url.indexOf('://');
if (index != -1) {
url = url.substring(index + 3);
index = url.indexOf('/');
if (index != -1) {
url = url.substring(index + 1);
}
}
return CryptoJS.MD5(url).toString();
}
self.getImageUrl = function (originalUrl) {
console.log('getImageUrl:' + originalUrl);
var key = CryptoJS.SHA1(originalUrl).toString();
var key = getCacheKey(originalUrl);
var deferred = DeferredBuilder.Deferred();

View file

@ -140,10 +140,21 @@
$('.inAppPurchaseOverlay').remove();
}
var currentDisplayingProductInfo = null;
var currentDisplayingDeferred = null;
function clearCurrentDisplayingInfo() {
currentDisplayingProductInfo = null;
currentDisplayingDeferred = null;
}
function showInAppPurchaseInfo(info, serverRegistrationInfo, deferred) {
var elem = getInAppPurchaseElement(info);
currentDisplayingProductInfo = info;
currentDisplayingDeferred = deferred;
$('.inAppPurchaseForm', elem).on('submit', function () {
IapManager.beginPurchase(info.id);
@ -151,6 +162,8 @@
});
$('.btnCancel', elem).on('click', function () {
clearCurrentDisplayingInfo();
cancelInAppPurchase();
// For testing purposes
@ -162,6 +175,8 @@
});
$('.btnSignInSupporter', elem).on('click', function () {
clearCurrentDisplayingInfo();
Dashboard.alert({
message: Globalize.translate('MessagePleaseSignInLocalNetwork'),
callback: function () {
@ -172,6 +187,21 @@
});
}
function onProductUpdated(e, product) {
var currentInfo = currentDisplayingProductInfo;
var deferred = currentDisplayingDeferred;
if (currentInfo && deferred) {
if (product.owned && product.id == currentInfo.id) {
clearCurrentDisplayingInfo();
cancelInAppPurchase();
deferred.resolve();
}
}
}
window.RegistrationServices = {
renderPluginInfo: function (page, pkg, pluginSecurityInfo) {
@ -203,10 +233,14 @@
}
};
function onIapManagerLoaded() {
Events.on(IapManager, 'productupdated', onProductUpdated);
}
if (isAndroid()) {
requirejs(['thirdparty/cordova/android/iap']);
requirejs(['thirdparty/cordova/android/iap', onIapManagerLoaded]);
} else {
requirejs(['thirdparty/cordova/iap']);
requirejs(['thirdparty/cordova/iap', onIapManagerLoaded]);
}
})();