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

update channel db

This commit is contained in:
Luke Pulverenti 2015-11-02 12:25:01 -05:00
parent abdf95b4d7
commit 519af58a6a
10 changed files with 91 additions and 60 deletions

View file

@ -31,6 +31,6 @@
"commit": "34fc5e4a0f252964ed2790138b8d7d30d04b55c1" "commit": "34fc5e4a0f252964ed2790138b8d7d30d04b55c1"
}, },
"_source": "git://github.com/desandro/get-style-property.git", "_source": "git://github.com/desandro/get-style-property.git",
"_target": "1.x", "_target": "~1.0.4",
"_originalSource": "get-style-property" "_originalSource": "get-style-property"
} }

View file

@ -89,6 +89,7 @@
}).map(function (o) { }).map(function (o) {
o.buttonText = Globalize.translate(o.buttonText, getProduct(o.feature).price); o.buttonText = Globalize.translate(o.buttonText, getProduct(o.feature).price);
o.owned = getProduct(o.feature).owned;
return o; return o;
}); });

View file

@ -14,9 +14,9 @@
function updateProductInfo(product) { function updateProductInfo(product) {
if (product.id == 'appunlock') { //if (product.id == 'appunlock') {
product.owned = false; // product.owned = false;
} //}
updatedProducts = updatedProducts.filter(function (r) { updatedProducts = updatedProducts.filter(function (r) {
return r.id != product.id; return r.id != product.id;
@ -51,20 +51,42 @@
enteredEmail = email; enteredEmail = email;
} }
validationCache = {};
var id = getStoreFeatureId(feature); var id = getStoreFeatureId(feature);
store.order(id); store.order(id);
} }
function restorePurchase(id) { function restorePurchase(id) {
validationCache = {};
store.refresh(); store.refresh();
} }
var validationCache = {};
function validateProduct(product, callback) { function validateProduct(product, callback) {
var productId = product.id;
var cacheKey = productId + (product.transaction.id || '');
var cachedResult = validationCache[cacheKey];
if (cachedResult && (new Date().getTime() - cachedResult.date) < 60000) {
if (cachedResult.result) {
callback(true, product);
} else {
callback(false, {
code: cachedResult.errorCode,
error: {
message: cachedResult.errorMessage
}
});
}
return;
}
// product attributes: // product attributes:
// https://github.com/j3k0/cordova-plugin-purchase/blob/master/doc/api.md#validation-error-codes // https://github.com/j3k0/cordova-plugin-purchase/blob/master/doc/api.md#validation-error-codes
var productId = product.id;
var receipt = product.transaction.appStoreReceipt; var receipt = product.transaction.appStoreReceipt;
var price = product.price; var price = product.price;
@ -94,7 +116,7 @@
} else { } else {
promise = ApiClient.ajax({ promise = HttpClient.send({
type: "POST", type: "POST",
url: "http://mb3admin.com/admin/service/appstore/register", url: "http://mb3admin.com/admin/service/appstore/register",
data: JSON.stringify(postData), data: JSON.stringify(postData),
@ -107,12 +129,16 @@
promise.done(function () { promise.done(function () {
setCachedResult(cacheKey, true);
callback(true, product); callback(true, product);
}).fail(function (e) { }).fail(function (e) {
if (e.status == 402) { if (e.status == 402) {
setCachedResult(cacheKey, false, store.PURCHASE_EXPIRED, 'Subscription Expired');
callback(false, { callback(false, {
code: store.PURCHASE_EXPIRED, code: store.PURCHASE_EXPIRED,
error: { error: {
@ -121,7 +147,9 @@
}); });
} else { } else {
alert('validate fail - other'); //alert('validate fail - other ' + e.status);
validationCache = {};
callback(false, { callback(false, {
code: store.CONNECTION_FAILED, code: store.CONNECTION_FAILED,
@ -133,6 +161,16 @@
}); });
} }
function setCachedResult(key, result, code, message) {
validationCache[key] = {
date: new Date().getTime(),
result: result,
errorCode: code,
errorMessage: message
};
}
function initProduct(id, requiresVerification, type) { function initProduct(id, requiresVerification, type) {
store.register({ store.register({
@ -221,6 +259,7 @@
o.id = getStoreFeatureId(o.feature); o.id = getStoreFeatureId(o.feature);
o.buttonText = Globalize.translate(o.buttonText, getProduct(o.feature).price); o.buttonText = Globalize.translate(o.buttonText, getProduct(o.feature).price);
o.owned = getProduct(o.feature).owned;
return o; return o;
}); });

View file

@ -225,7 +225,14 @@
return; return;
} }
if (result.state == 4 || result.state == 6) { if (result.type === 'next') {
console.log('skip to next audio track'); // typically fired by remote control/lock screen controls
MediaPlayer.nextTrack();
} else if (result.type === 'previous') {
console.log('skip to previous track'); // typically fired by remote/control/lock screen controls
MediaPlayer.previousTrack();
}
else if (result.state == 4 || result.state == 6) {
reportEvent('playbackstop', result); reportEvent('playbackstop', result);
} }
else { else {

View file

@ -1,36 +1,23 @@
(function () { (function () {
function validateServerManagement(deferred) {
deferred.resolve();
}
function getRegistrationInfo(feature) { function getRegistrationInfo(feature) {
return ConnectionManager.getRegistrationInfo(feature, ApiClient); return ConnectionManager.getRegistrationInfo(feature, ApiClient);
} }
var validatedFeatures = [];
function validateFeature(feature, deferred) { function validateFeature(feature, deferred) {
if (validatedFeatures.indexOf(feature) != -1) { var unlockableProduct = IapManager.getProductInfo(feature) || {};
deferred.resolve();
return;
}
var info = IapManager.getProductInfo(feature) || {}; if (unlockableProduct.owned) {
if (info.owned) {
notifyServer(info.id);
validatedFeatures.push(feature);
deferred.resolve(); deferred.resolve();
return; return;
} }
var unlockableProductInfo = IapManager.isPurchaseAvailable(feature) ? { var unlockableProductInfo = IapManager.isPurchaseAvailable(feature) ? {
enableAppUnlock: IapManager.isPurchaseAvailable(feature), enableAppUnlock: true,
id: info.id, id: unlockableProduct.id,
price: info.price, price: unlockableProduct.price,
feature: feature feature: feature
} : null; } : null;
@ -41,13 +28,19 @@
getRegistrationInfo(prefix + 'appunlock').done(function (registrationInfo) { getRegistrationInfo(prefix + 'appunlock').done(function (registrationInfo) {
if (registrationInfo.IsRegistered) { if (registrationInfo.IsRegistered) {
validatedFeatures.push(feature);
deferred.resolve(); deferred.resolve();
return; return;
} }
IapManager.getSubscriptionOptions().done(function (subscriptionOptions) { IapManager.getSubscriptionOptions().done(function (subscriptionOptions) {
if (subscriptionOptions.filter(function (p) {
return p.owned;
}).length > 0) {
deferred.resolve();
return;
}
var dialogOptions = { var dialogOptions = {
title: Globalize.translate('HeaderUnlockApp') title: Globalize.translate('HeaderUnlockApp')
}; };
@ -60,33 +53,6 @@
}); });
} }
function notifyServer(id) {
if (!$.browser.android) {
return;
}
HttpClient.send({
type: "POST",
url: "https://mb3admin.com/admin/service/appstore/addDeviceFeature",
data: {
deviceId: ConnectionManager.deviceId(),
feature: 'com.mb.android.unlock'
},
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
headers: {
"X-EMBY-TOKEN": "EMBY_DEVICE"
}
}).done(function (result) {
Logger.log('addDeviceFeature succeeded');
}).fail(function () {
Logger.log('addDeviceFeature failed');
});
}
function cancelInAppPurchase() { function cancelInAppPurchase() {
var elem = document.querySelector('.inAppPurchaseOverlay'); var elem = document.querySelector('.inAppPurchaseOverlay');
@ -288,7 +254,6 @@
getRegistrationInfo('Sync').done(function (registrationInfo) { getRegistrationInfo('Sync').done(function (registrationInfo) {
if (registrationInfo.IsRegistered) { if (registrationInfo.IsRegistered) {
validatedFeatures.push(feature);
deferred.resolve(); deferred.resolve();
return; return;
} }

View file

@ -126,7 +126,7 @@
.searchInputIcon { .searchInputIcon {
position: absolute; position: absolute;
left: 20px; left: 20px;
top: 12px; top: 18px;
color: #ddd !important; color: #ddd !important;
} }

View file

@ -859,6 +859,8 @@
var html = ''; var html = '';
var scrollX = false;
if (item.Type == "MusicAlbum") { if (item.Type == "MusicAlbum") {
html = LibraryBrowser.getListViewHtml({ html = LibraryBrowser.getListViewHtml({
@ -874,9 +876,12 @@
} }
else if (item.Type == "Series") { else if (item.Type == "Series") {
scrollX = enableScrollX();
html = LibraryBrowser.getPosterViewHtml({ html = LibraryBrowser.getPosterViewHtml({
items: result.Items, items: result.Items,
shape: "detailPagePortrait", shape: getPortraitShape(),
showTitle: false, showTitle: false,
centerText: true, centerText: true,
context: context, context: context,
@ -911,6 +916,12 @@
elem.innerHTML = html; elem.innerHTML = html;
ImageLoader.lazyChildren(elem); ImageLoader.lazyChildren(elem);
if (scrollX) {
elem.classList.add('hiddenScrollX');
} else {
elem.classList.remove('hiddenScrollX');
}
if (item.Type == "BoxSet") { if (item.Type == "BoxSet") {
var collectionItemTypes = [ var collectionItemTypes = [

View file

@ -88,7 +88,8 @@
items: result.Items, items: result.Items,
shape: "auto", shape: "auto",
centerText: true, centerText: true,
lazy: true lazy: true,
coverImage: item.Type == 'PhotoAlbum'
}; };
if (view == "Backdrop") { if (view == "Backdrop") {

View file

@ -599,7 +599,10 @@
// This should be outside of the IF // This should be outside of the IF
// But for now, if you change songs but keep the same artist, the backdrop will flicker because in-between songs it clears out the image // But for now, if you change songs but keep the same artist, the backdrop will flicker because in-between songs it clears out the image
Backdrops.setBackdropUrl(page, backdropUrl); if (!$.browser.safari) {
// Exclude from safari because it just doesn't perform well
Backdrops.setBackdropUrl(page, backdropUrl);
}
ApiClient.getItem(Dashboard.getCurrentUserId(), item.Id).done(function (fullItem) { ApiClient.getItem(Dashboard.getCurrentUserId(), item.Id).done(function (fullItem) {
page.querySelector('.nowPlayingPageUserDataButtons').innerHTML = LibraryBrowser.getUserDataIconsHtml(fullItem, false); page.querySelector('.nowPlayingPageUserDataButtons').innerHTML = LibraryBrowser.getUserDataIconsHtml(fullItem, false);

View file

@ -387,7 +387,11 @@
Dashboard.getCurrentUser().done(function (user) { Dashboard.getCurrentUser().done(function (user) {
$('.categorySyncButton', page).visible(user.Policy.EnableSync); var item = {
SupportsSync: true
};
$('.categorySyncButton', page).visible(isAvailable(item));
}); });
} }