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

move completely to fetch

This commit is contained in:
Luke Pulverenti 2015-11-28 03:07:44 -05:00
parent ee899a7332
commit 9932bc3eb5
168 changed files with 948 additions and 945 deletions

View file

@ -58,7 +58,7 @@
function populateReviews(id, page) {
ApiClient.getPackageReviews(id, null, null, 3).done(function (positive) {
ApiClient.getPackageReviews(id, null, null, 3).then(function (positive) {
var html = '';
@ -185,7 +185,7 @@
var promise2 = ApiClient.getInstalledPlugins();
var promise3 = ApiClient.getPluginSecurityInfo();
$.when(promise1, promise2, promise3).done(function (response1, response2, response3) {
$.when(promise1, promise2, promise3).then(function (response1, response2, response3) {
renderPackage(response1[0], response2[0], response3[0], page);
@ -243,7 +243,7 @@
Dashboard.showLoadingMsg();
ApiClient.installPlugin(packageName, guid, updateClass, version).done(function () {
ApiClient.installPlugin(packageName, guid, updateClass, version).then(function () {
Dashboard.hideLoadingMsg();
});
@ -281,7 +281,7 @@
var name = getParameterByName('name');
var guid = getParameterByName('guid');
ApiClient.getInstalledPlugins().done(function (plugins) {
ApiClient.getInstalledPlugins().then(function (plugins) {
var installedPlugin = plugins.filter(function (ip) {
return ip.Name == name;

View file

@ -63,7 +63,7 @@
config.EnableDashboardResponseCaching = $('#chkEnableDashboardResponseCache', form).checked();
config.DashboardSourcePath = $('#txtDashboardSourcePath', form).val();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission

View file

@ -10,7 +10,7 @@
var promise2 = ApiClient.getInstalledPlugins();
$.when(promise1, promise2).done(function (response1, response2) {
$.when(promise1, promise2).then(function (response1, response2) {
renderInstalled(page, response1[0], response2[0]);
renderCatalog(page, response1[0], response2[0]);
});

View file

@ -38,13 +38,13 @@
Dashboard.showLoadingMsg();
ApiClient.deleteOriginalFileFromOrganizationResult(id).done(function () {
ApiClient.deleteOriginalFileFromOrganizationResult(id).then(function () {
Dashboard.hideLoadingMsg();
reloadItems(page);
}).fail(onApiFailure);
}, onApiFailure);
}
});
@ -121,13 +121,13 @@
Dashboard.showLoadingMsg();
ApiClient.performOrganization(id).done(function () {
ApiClient.performOrganization(id).then(function () {
Dashboard.hideLoadingMsg();
reloadItems(page);
}).fail(onApiFailure);
}, onApiFailure);
}
});
@ -149,7 +149,7 @@
EndingEpisodeNumber: $('#txtEndingEpisode', form).val()
};
ApiClient.performEpisodeOrganization(resultId, options).done(function () {
ApiClient.performEpisodeOrganization(resultId, options).then(function () {
Dashboard.hideLoadingMsg();
@ -157,20 +157,21 @@
reloadItems(page);
}).fail(onApiFailure);
}, onApiFailure);
}
function reloadItems(page) {
Dashboard.showLoadingMsg();
ApiClient.getFileOrganizationResults(query).done(function (result) {
ApiClient.getFileOrganizationResults(query).then(function (result) {
currentResult = result;
renderResults(page, result);
Dashboard.hideLoadingMsg();
}).fail(onApiFailure);
}, onApiFailure);
}
@ -351,9 +352,9 @@
$('.btnClearLog', page).on('click', function () {
ApiClient.clearOrganizationLog().done(function () {
ApiClient.clearOrganizationLog().then(function () {
reloadItems(page);
}).fail(onApiFailure);
}, onApiFailure);
});

View file

@ -81,7 +81,7 @@
function onSubmit() {
var form = this;
ApiClient.getNamedConfiguration('autoorganize').done(function (config) {
ApiClient.getNamedConfiguration('autoorganize').then(function (config) {
var tvOptions = config.TvOptions;
@ -103,7 +103,7 @@
tvOptions.CopyOriginalFile = $('#copyOrMoveFile', form).val();
ApiClient.updateNamedConfiguration('autoorganize', config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateNamedConfiguration('autoorganize', config).then(Dashboard.processServerConfigurationUpdateResult);
});
return false;
@ -160,7 +160,7 @@
var page = this;
ApiClient.getNamedConfiguration('autoorganize').done(function (config) {
ApiClient.getNamedConfiguration('autoorganize').then(function (config) {
loadPage(page, config);
});
});

View file

@ -36,7 +36,7 @@
var channelId = getParameterByName('id');
ApiClient.fetchJSON(ApiClient.getUrl("Channels/" + channelId + "/Features")).then(function (features) {
ApiClient.getJSON(ApiClient.getUrl("Channels/" + channelId + "/Features")).then(function (features) {
if (features.CanFilter) {
@ -93,7 +93,7 @@
query.folderId = folderId;
ApiClient.fetchJSON(ApiClient.getUrl("Channels/" + channelId + "/Items", query)).then(function (result) {
ApiClient.getJSON(ApiClient.getUrl("Channels/" + channelId + "/Items", query)).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);
@ -145,7 +145,9 @@
showSortMenu(page);
});
}).always(function () {
Dashboard.hideModalLoadingMsg();
}, function () {
Dashboard.hideModalLoadingMsg();
});

View file

@ -12,7 +12,7 @@
query.UserId = Dashboard.getCurrentUserId();
ApiClient.fetchJSON(ApiClient.getUrl("Channels", query)).then(function (result) {
ApiClient.getJSON(ApiClient.getUrl("Channels", query)).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);

View file

@ -13,12 +13,12 @@
var form = this;
ApiClient.getNamedConfiguration("channels").done(function (config) {
ApiClient.getNamedConfiguration("channels").then(function (config) {
// This should be null if empty
config.PreferredStreamingWidth = $('#selectChannelResolution', form).val() || null;
ApiClient.updateNamedConfiguration("channels", config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateNamedConfiguration("channels", config).then(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
@ -37,7 +37,7 @@
var page = this;
ApiClient.getNamedConfiguration("channels").done(function (config) {
ApiClient.getNamedConfiguration("channels").then(function (config) {
loadPage(page, config);

View file

@ -4,7 +4,9 @@
Dashboard.showLoadingMsg();
Sections.loadLatestChannelItems(page.querySelector('.latestItems'), Dashboard.getCurrentUserId()).always(function() {
Sections.loadLatestChannelItems(page.querySelector('.latestItems'), Dashboard.getCurrentUserId()).then(function() {
Dashboard.hideLoadingMsg();
}, function () {
Dashboard.hideLoadingMsg();
});
}

View file

@ -323,7 +323,7 @@
return deferred.promise();
}
return ApiClient.fetchJSON(ApiClient.getUrl('System/Endpoint')).then(function (info) {
return ApiClient.getJSON(ApiClient.getUrl('System/Endpoint')).then(function (info) {
endpointInfo = info;
});

View file

@ -28,7 +28,7 @@
var page = $(form).parents('.page');
ApiClient.getNamedConfiguration("cinemamode").done(function (config) {
ApiClient.getNamedConfiguration("cinemamode").then(function (config) {
config.CustomIntroPath = $('#txtCustomIntrosPath', page).val();
config.TrailerLimit = $('#txtNumTrailers', page).val();
@ -44,7 +44,7 @@
config.EnableIntrosFromUpcomingStreamingMovies = $('.chkUpcomingStreamingTrailers', page).checked();
config.EnableIntrosFromSimilarMovies = $('.chkOtherTrailers', page).checked();
ApiClient.updateNamedConfiguration("cinemamode", config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateNamedConfiguration("cinemamode", config).then(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
@ -84,7 +84,7 @@
var page = this;
ApiClient.getNamedConfiguration("cinemamode").done(function (config) {
ApiClient.getNamedConfiguration("cinemamode").then(function (config) {
loadPage(page, config);

View file

@ -4,12 +4,12 @@
Dashboard.showModalLoadingMsg();
ConnectionManager.loginToConnect(username, password).done(function () {
ConnectionManager.loginToConnect(username, password).then(function () {
Dashboard.hideModalLoadingMsg();
Dashboard.navigate('selectserver.html');
}).fail(function () {
}, function () {
Dashboard.hideModalLoadingMsg();
@ -70,7 +70,7 @@
Dashboard.showModalLoadingMsg();
ConnectionManager.connect().done(function (result) {
ConnectionManager.connect().then(function (result) {
handleConnectionResult(page, result);
@ -150,7 +150,7 @@
var page = $(this).parents('.page');
ConnectionManager.signupForConnect($('#txtSignupEmail', page).val(), $('#txtSignupUsername', page).val(), $('#txtSignupPassword', page).val(), $('#txtSignupPasswordConfirm', page).val()).done(function () {
ConnectionManager.signupForConnect($('#txtSignupEmail', page).val(), $('#txtSignupUsername', page).val(), $('#txtSignupPassword', page).val(), $('#txtSignupPasswordConfirm', page).val()).then(function () {
Dashboard.alert({
message: Globalize.translate('MessageThankYouForConnectSignUp'),
@ -159,7 +159,7 @@
}
});
}).fail(function (result) {
}, function (result) {
if (result.errorCode == 'passwordmatch') {
Dashboard.alert({
@ -282,11 +282,11 @@
Dashboard.showModalLoadingMsg();
ConnectionManager.connectToAddress(host).done(function (result) {
ConnectionManager.connectToAddress(host).then(function (result) {
handleConnectionResult(page, result);
}).fail(function () {
}, function () {
handleConnectionResult(page, {
State: MediaBrowser.ConnectionState.Unavailable
});

View file

@ -52,18 +52,18 @@
Dashboard.showDashboardRefreshNotification();
}
ApiClient.updateServerConfiguration(config).done(function () {
ApiClient.updateServerConfiguration(config).then(function () {
refreshPageTitle(page);
ApiClient.getNamedConfiguration(brandingConfigKey).done(function (brandingConfig) {
ApiClient.getNamedConfiguration(brandingConfigKey).then(function (brandingConfig) {
brandingConfig.LoginDisclaimer = form.querySelector('#txtLoginDisclaimer').value;
brandingConfig.CustomCss = form.querySelector('#txtCustomCss').value;
var cssChanged = currentBrandingOptions && brandingConfig.CustomCss != currentBrandingOptions.CustomCss;
ApiClient.updateNamedConfiguration(brandingConfigKey, brandingConfig).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateNamedConfiguration(brandingConfigKey, brandingConfig).then(Dashboard.processServerConfigurationUpdateResult);
if (cssChanged) {
Dashboard.showDashboardRefreshNotification();
@ -114,7 +114,7 @@
var promise1 = ApiClient.getServerConfiguration();
var promise2 = ApiClient.fetchJSON(ApiClient.getUrl("Localization/Options"));
var promise2 = ApiClient.getJSON(ApiClient.getUrl("Localization/Options"));
Promise.all([promise1, promise2]).then(function (responses) {
@ -122,7 +122,7 @@
});
ApiClient.getNamedConfiguration(brandingConfigKey).done(function (config) {
ApiClient.getNamedConfiguration(brandingConfigKey).then(function (config) {
currentBrandingOptions = config;

View file

@ -33,7 +33,7 @@
config.WanDdns = $('#txtDdns', form).val();
config.CertificatePath = $('#txtCertificatePath', form).val();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission

View file

@ -28,7 +28,7 @@
DashboardPage.lastAppUpdateCheck = null;
DashboardPage.lastPluginUpdateCheck = null;
Dashboard.getPluginSecurityInfo().done(function (pluginSecurityInfo) {
Dashboard.getPluginSecurityInfo().then(function (pluginSecurityInfo) {
DashboardPage.renderSupporterIcon(page, pluginSecurityInfo);
});
@ -120,7 +120,7 @@
Limit: 7
};
ApiClient.getProductNews(query).done(function (result) {
ApiClient.getProductNews(query).then(function (result) {
var html = result.Items.map(function (item) {
@ -242,11 +242,11 @@
return;
}
apiClient.getSessions().done(function (sessions) {
apiClient.getSessions().then(function (sessions) {
DashboardPage.renderInfo(page, sessions, forceUpdate);
});
apiClient.getScheduledTasks().done(function (tasks) {
apiClient.getScheduledTasks().then(function (tasks) {
DashboardPage.renderRunningTasks(page, tasks);
});
@ -834,7 +834,7 @@
DashboardPage.lastAppUpdateCheck = new Date().getTime();
ApiClient.getAvailableApplicationUpdate().done(function (packageInfo) {
ApiClient.getAvailableApplicationUpdate().then(function (packageInfo) {
var version = packageInfo[0];
@ -892,7 +892,7 @@
DashboardPage.lastPluginUpdateCheck = new Date().getTime();
ApiClient.getAvailablePluginUpdates().done(function (updates) {
ApiClient.getAvailablePluginUpdates().then(function (updates) {
var elem = $('#pPluginUpdates', page);
@ -932,7 +932,7 @@
Dashboard.showLoadingMsg();
ApiClient.installPlugin(name, guid, classification, version).done(function () {
ApiClient.installPlugin(name, guid, classification, version).then(function () {
Dashboard.hideLoadingMsg();
});
@ -945,14 +945,14 @@
Dashboard.showLoadingMsg();
ApiClient.getScheduledTasks().done(function (tasks) {
ApiClient.getScheduledTasks().then(function (tasks) {
var task = tasks.filter(function (t) {
return t.Key == DashboardPage.systemUpdateTaskKey;
})[0];
ApiClient.startScheduledTask(task.Id).done(function () {
ApiClient.startScheduledTask(task.Id).then(function () {
DashboardPage.pollForInfo(page);
@ -965,7 +965,7 @@
var page = $.mobile.activePage;
ApiClient.stopScheduledTask(id).done(function () {
ApiClient.stopScheduledTask(id).then(function () {
DashboardPage.pollForInfo(page);
});
@ -1170,7 +1170,7 @@ $(document).on('pageshow', "#dashboardPage", DashboardPage.onPageShow).on('pageb
var minDate = new Date();
minDate.setTime(minDate.getTime() - 86400000);
ApiClient.fetchJSON(ApiClient.getUrl('System/ActivityLog/Entries', {
ApiClient.getJSON(ApiClient.getUrl('System/ActivityLog/Entries', {
startIndex: startIndex,
limit: limit,
@ -1313,7 +1313,7 @@ $(document).on('pageshow', "#dashboardPage", DashboardPage.onPageShow).on('pageb
function takeTour(page, userId) {
Dashboard.loadSwipebox().done(function () {
Dashboard.loadSwipebox().then(function () {
$.swipebox([
{ href: 'css/images/tour/dashboard/dashboard.png', title: Globalize.translate('DashboardTourDashboard') },
@ -1366,7 +1366,7 @@ $(document).on('pageshow', "#dashboardPage", DashboardPage.onPageShow).on('pageb
var page = this;
Dashboard.getPluginSecurityInfo().done(function (pluginSecurityInfo) {
Dashboard.getPluginSecurityInfo().then(function (pluginSecurityInfo) {
if (!$('.customSupporterPromotion', page).length) {
$('.supporterPromotion', page).remove();

View file

@ -22,7 +22,7 @@
var promise1 = ApiClient.getJSON(ApiClient.getUrl('Devices/Info', { Id: id }));
var promise2 = ApiClient.getJSON(ApiClient.getUrl('Devices/Capabilities', { Id: id }));
$.when(promise1, promise2).done(function (response1, response2) {
$.when(promise1, promise2).then(function (response1, response2) {
load(page, response1[0], response2[0]);
@ -46,7 +46,7 @@
}),
contentType: "application/json"
}).done(Dashboard.processServerConfigurationUpdateResult);
}).then(Dashboard.processServerConfigurationUpdateResult);
}
function onSubmit() {

View file

@ -15,7 +15,7 @@
Id: id
})
}).done(function () {
}).then(function () {
loadData(page);
});
@ -82,7 +82,7 @@
function loadData(page) {
Dashboard.showLoadingMsg();
ApiClient.fetchJSON(ApiClient.getUrl('Devices', {
ApiClient.getJSON(ApiClient.getUrl('Devices', {
SupportsPersistentIdentifier: true

View file

@ -74,7 +74,7 @@
}));
$.when(promise1, promise2).done(function (response1, response2) {
$.when(promise1, promise2).then(function (response1, response2) {
load(page, response2[0].Items, response1[0]);
@ -85,7 +85,7 @@
function save(page) {
ApiClient.getNamedConfiguration("devices").done(function (config) {
ApiClient.getNamedConfiguration("devices").then(function (config) {
config.CameraUploadPath = $('#txtUploadPath', page).val();
@ -97,7 +97,7 @@
config.EnableCameraUploadSubfolders = $('#chkSubfolder', page).checked();
ApiClient.updateNamedConfiguration("devices", config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateNamedConfiguration("devices", config).then(Dashboard.processServerConfigurationUpdateResult);
});
}

View file

@ -14,7 +14,7 @@
var promise1 = getProfile();
var promise2 = ApiClient.getUsers();
$.when(promise1, promise2).done(function (response1, response2) {
$.when(promise1, promise2).then(function (response1, response2) {
currentProfile = response1[0];
@ -864,7 +864,7 @@
url: ApiClient.getUrl("Dlna/Profiles/" + id),
data: JSON.stringify(profile),
contentType: "application/json"
}).done(function () {
}).then(function () {
Dashboard.alert('Settings saved.');
});
@ -876,7 +876,7 @@
url: ApiClient.getUrl("Dlna/Profiles"),
data: JSON.stringify(profile),
contentType: "application/json"
}).done(function () {
}).then(function () {
Dashboard.navigate('dlnaprofiles.html');

View file

@ -4,7 +4,7 @@
Dashboard.showLoadingMsg();
ApiClient.fetchJSON(ApiClient.getUrl("Dlna/ProfileInfos")).then(function (result) {
ApiClient.getJSON(ApiClient.getUrl("Dlna/ProfileInfos")).then(function (result) {
renderProfiles(page, result);
@ -92,7 +92,7 @@
type: "DELETE",
url: ApiClient.getUrl("Dlna/Profiles/" + id)
}).done(function () {
}).then(function () {
Dashboard.hideLoadingMsg();

View file

@ -23,7 +23,7 @@
var form = this;
ApiClient.getNamedConfiguration("dlna").done(function (config) {
ApiClient.getNamedConfiguration("dlna").then(function (config) {
config.EnableServer = $('#chkEnableServer', form).checked();
config.BlastAliveMessages = $('#chkBlastAliveMessages', form).checked();
@ -32,7 +32,7 @@
config.EnableMovieFolders = $('#chkEnableMovieFolders', form).checked();
ApiClient.updateNamedConfiguration("dlna", config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateNamedConfiguration("dlna", config).then(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
@ -52,7 +52,7 @@
var promise1 = ApiClient.getNamedConfiguration("dlna");
var promise2 = ApiClient.getUsers();
$.when(promise1, promise2).done(function (response1, response2) {
$.when(promise1, promise2).then(function (response1, response2) {
loadPage(page, response1[0], response2[0]);

View file

@ -15,13 +15,13 @@
var form = this;
ApiClient.getNamedConfiguration("dlna").done(function (config) {
ApiClient.getNamedConfiguration("dlna").then(function (config) {
config.EnablePlayTo = $('#chkEnablePlayTo', form).checked();
config.EnableDebugLogging = $('#chkEnableDlnaDebugLogging', form).checked();
config.ClientDiscoveryIntervalSeconds = $('#txtClientDiscoveryInterval', form).val();
ApiClient.updateNamedConfiguration("dlna", config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateNamedConfiguration("dlna", config).then(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
@ -38,7 +38,7 @@
var page = this;
ApiClient.getNamedConfiguration("dlna").done(function (config) {
ApiClient.getNamedConfiguration("dlna").then(function (config) {
loadPage(page, config);

View file

@ -13,7 +13,7 @@
var promise1 = MetadataEditor.getItemPromise();
var promise2 = MetadataEditor.getCurrentItemId() ?
ApiClient.fetchJSON(ApiClient.getUrl('Items/' + MetadataEditor.getCurrentItemId() + '/MetadataEditor')) :
ApiClient.getJSON(ApiClient.getUrl('Items/' + MetadataEditor.getCurrentItemId() + '/MetadataEditor')) :
{};
Promise.all([promise1, promise2]).then(function (responses) {
@ -901,7 +901,7 @@
});
}
ApiClient.updateItem(item).done(function () {
ApiClient.updateItem(item).then(function () {
var newContentType = $('#selectContentType', form).val() || '';
@ -915,7 +915,7 @@
type: 'POST'
}).done(function () {
}).then(function () {
afterContentTypeUpdated();
});

View file

@ -106,7 +106,7 @@
var promise2 = ApiClient.getLiveTvChannels({ limit: 0 });
$.when(promise2).done(function (response2) {
$.when(promise2).then(function (response2) {
var result = response2;
@ -155,7 +155,7 @@
function loadLiveTvChannels(service, openItems, callback) {
ApiClient.getLiveTvChannels({ ServiceName: service, AddCurrentProgram: false }).done(function (result) {
ApiClient.getLiveTvChannels({ ServiceName: service, AddCurrentProgram: false }).then(function (result) {
var nodes = result.Items.map(function (i) {
@ -173,7 +173,7 @@
function loadMediaFolders(page, scope, openItems, callback) {
ApiClient.fetchJSON(ApiClient.getUrl("Library/MediaFolders")).then(function (result) {
ApiClient.getJSON(ApiClient.getUrl("Library/MediaFolders")).then(function (result) {
var nodes = result.Items.map(function (n) {
@ -278,7 +278,7 @@
function initializeTree(page, currentUser, openItems, selectedId) {
loadJsTree().done(function () {
loadJsTree().then(function () {
initializeTreeInternal(page, currentUser, openItems, selectedId);
});
}
@ -428,7 +428,7 @@
if (id) {
ApiClient.getAncestorItems(id, user.Id).done(function (ancestors) {
ApiClient.getAncestorItems(id, user.Id).then(function (ancestors) {
var ids = ancestors.map(function (i) {
return i.Id;

View file

@ -24,7 +24,7 @@
var form = this;
ApiClient.getNamedConfiguration("encoding").done(function (config) {
ApiClient.getNamedConfiguration("encoding").then(function (config) {
config.EnableDebugLogging = $('#chkEnableDebugEncodingLogging', form).checked();
config.EncodingQuality = $('.radioEncodingQuality:checked', form).val();
@ -34,7 +34,7 @@
config.EncodingThreadCount = $('#selectThreadCount', form).val();
config.HardwareAccelerationType = $('#selectVideoDecoder', form).val();
ApiClient.updateNamedConfiguration("encoding", config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateNamedConfiguration("encoding", config).then(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
@ -77,7 +77,7 @@
var page = this;
ApiClient.getNamedConfiguration("encoding").done(function (config) {
ApiClient.getNamedConfiguration("encoding").then(function (config) {
loadPage(page, config);

View file

@ -178,7 +178,7 @@
}
};
MediaPlayer.createStreamInfo('Video', item, mediaSource, startPosition).done(function (streamInfo) {
MediaPlayer.createStreamInfo('Video', item, mediaSource, startPosition).then(function (streamInfo) {
var currentSrc = streamInfo.url;
@ -437,7 +437,7 @@
ApiClient.getItem(userId, itemId).then(function (item) {
getVideoStreamInfo(item).done(function (streamInfo) {
getVideoStreamInfo(item).then(function (streamInfo) {
setTimeout(function () {
ExternalPlayer.showPlayerSelectionMenu(item, streamInfo.url, streamInfo.mimeType);
@ -460,7 +460,7 @@
function showPlayerSelectionMenu(item, url, mimeType) {
ExternalPlayer.getExternalPlayers(url, mimeType).done(function (players) {
ExternalPlayer.getExternalPlayers(url, mimeType).then(function (players) {
showMenuForItem(item, players);
});
}

View file

@ -160,7 +160,7 @@
promises.push(loadSection(elem, userId, topParentId, section, sections.length == 1));
}
$.when(promises).done(function () {
$.when(promises).then(function () {
Dashboard.hideLoadingMsg();
LibraryBrowser.setLastRefreshed(page);

View file

@ -53,7 +53,7 @@
EnteredUsername: $('#txtName', page).val()
}
}).done(function (result) {
}).then(function (result) {
processForgotPasswordResult(page, result);
});

View file

@ -44,7 +44,7 @@
Pin: $('#txtPin', page).val()
}
}).done(function (result) {
}).then(function (result) {
processForgotPasswordResult(page, result);
});

View file

@ -19,7 +19,7 @@
Dashboard.showLoadingMsg();
ApiClient.getGameGenres(Dashboard.getCurrentUserId(), query).done(function (result) {
ApiClient.getGameGenres(Dashboard.getCurrentUserId(), query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);

View file

@ -254,7 +254,7 @@
LibraryBrowser.loadSavedQueryValues(viewkey, query);
QueryFilters.onPageShow(page, query);
LibraryBrowser.getSavedViewSetting(viewkey).done(function (val) {
LibraryBrowser.getSavedViewSetting(viewkey).then(function (val) {
if (val) {
$('#selectView', page).val(val).trigger('change');

View file

@ -17,7 +17,7 @@
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
};
ApiClient.fetchJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
items: items,

View file

@ -20,7 +20,7 @@
Dashboard.showLoadingMsg();
ApiClient.getStudios(Dashboard.getCurrentUserId(), query).done(function (result) {
ApiClient.getStudios(Dashboard.getCurrentUserId(), query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);

View file

@ -22,7 +22,7 @@
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
};
ApiClient.getNextUpEpisodes(query).done(function (result) {
ApiClient.getNextUpEpisodes(query).then(function (result) {
if (result.Items.length) {
page.querySelector('.noNextUpItems').classList.add('hide');

View file

@ -16,7 +16,7 @@
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
};
ApiClient.fetchJSON(ApiClient.getUrl("Shows/Upcoming", query)).then(function (result) {
ApiClient.getJSON(ApiClient.getUrl("Shows/Upcoming", query)).then(function (result) {
var items = result.Items;

View file

@ -165,7 +165,7 @@
function takeTour(page, userId) {
Dashboard.loadSwipebox().done(function () {
Dashboard.loadSwipebox().then(function () {
$.swipebox([
{ href: 'css/images/tour/web/tourcontent.jpg', title: Globalize.translate('WebClientTourContent') },

View file

@ -1090,7 +1090,7 @@
type: "DELETE",
url: url
}).done(function () {
}).then(function () {
renderChildren(page, parentItem, user, context);
Dashboard.hideLoadingMsg();
@ -1873,7 +1873,7 @@
type: "DELETE",
url: ApiClient.getUrl("Videos/" + id + "/AlternateSources")
}).done(function () {
}).then(function () {
Dashboard.hideLoadingMsg();
@ -1934,7 +1934,7 @@
Dashboard.showLoadingMsg();
ApiClient.cancelLiveTvTimer(id).done(function () {
ApiClient.cancelLiveTvTimer(id).then(function () {
Dashboard.alert(Globalize.translate('MessageRecordingCancelled'));

View file

@ -53,7 +53,7 @@
var itemsPromise = ApiClient.getItems(userId, query);
Promise.all([parentItemPromise, itemsPromise]).done(function (responses) {
Promise.all([parentItemPromise, itemsPromise]).then(function (responses) {
var item = responses[0];
currentItem = item;

View file

@ -435,7 +435,7 @@
playAllFromHere: function (fn, index) {
fn(index, 100, "MediaSources,Chapters").done(function (result) {
fn(index, 100, "MediaSources,Chapters").then(function (result) {
MediaController.play({
items: result.Items
@ -445,7 +445,7 @@
queueAllFromHere: function (query, index) {
fn(index, 100, "MediaSources,Chapters").done(function (result) {
fn(index, 100, "MediaSources,Chapters").then(function (result) {
MediaController.queue({
items: result.Items
@ -577,7 +577,7 @@
playInExternalPlayer: function (id) {
Dashboard.loadExternalPlayer().done(function () {
Dashboard.loadExternalPlayer().then(function () {
ExternalPlayer.showMenu(id);
});
},

View file

@ -158,7 +158,7 @@
var id = this.getAttribute('data-itemid');
ApiClient.getLocalTrailers(Dashboard.getCurrentUserId(), id).done(function (trailers) {
ApiClient.getLocalTrailers(Dashboard.getCurrentUserId(), id).then(function (trailers) {
MediaController.play({ items: trailers });
});
@ -226,7 +226,7 @@
var albumid = card.getAttribute('data-albumid');
var artistid = card.getAttribute('data-artistid');
Dashboard.getCurrentUser().done(function (user) {
Dashboard.getCurrentUser().then(function (user) {
var items = [];
@ -495,7 +495,7 @@
MediaController.queue(itemId);
break;
case 'trailer':
ApiClient.getLocalTrailers(Dashboard.getCurrentUserId(), itemId).done(function (trailers) {
ApiClient.getLocalTrailers(Dashboard.getCurrentUserId(), itemId).then(function (trailers) {
MediaController.play({ items: trailers });
});
break;
@ -645,7 +645,7 @@
return;
}
ApiClient.fetchJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
if (items.length == 1) {
@ -1160,7 +1160,7 @@
type: "POST",
url: ApiClient.getUrl("Videos/MergeVersions", { Ids: selection.join(',') })
}).done(function () {
}).then(function () {
Dashboard.hideLoadingMsg();
hideSelections();

View file

@ -188,7 +188,7 @@
if (requiresDrawerRefresh || requiresDashboardDrawerRefresh) {
ConnectionManager.user(window.ApiClient).done(function (user) {
ConnectionManager.user(window.ApiClient).then(function (user) {
var drawer = document.querySelector('.mainDrawerPanel .mainDrawer');
@ -389,7 +389,7 @@
var deferred = $.Deferred();
apiClient.getUserViews({}, userId).done(function (result) {
apiClient.getUserViews({}, userId).then(function (result) {
var items = result.Items;
@ -445,7 +445,7 @@
var apiClient = window.ApiClient;
getUserViews(apiClient, userId).done(function (result) {
getUserViews(apiClient, userId).then(function (result) {
var items = result;
@ -786,7 +786,7 @@
updateLibraryNavLinks(page);
requiresViewMenuRefresh = false;
ConnectionManager.user(window.ApiClient).done(addUserToHeader);
ConnectionManager.user(window.ApiClient).then(addUserToHeader);
} else {
viewMenuBar.classList.remove('hide');

View file

@ -12,7 +12,7 @@
config.PathSubstitutions.splice(index, 1);
ApiClient.updateServerConfiguration(config).done(function () {
ApiClient.updateServerConfiguration(config).then(function () {
reload(page);
});
@ -103,7 +103,7 @@
ApiClient.getServerConfiguration().then(function (config) {
addSubstitution(page, config);
ApiClient.updateServerConfiguration(config).done(function () {
ApiClient.updateServerConfiguration(config).then(function () {
reload(page);
});

View file

@ -32,7 +32,7 @@
config.EnableAudioArchiveFiles = $('#chkEnableAudioArchiveFiles', form).checked();
config.EnableVideoArchiveFiles = $('#chkEnableVideoArchiveFiles', form).checked();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission

View file

@ -108,7 +108,7 @@
HasAired: false,
SortBy: "StartDate"
}).done(function (result) {
}).then(function (result) {
renderPrograms(page, result);

View file

@ -83,7 +83,7 @@
query.UserId = Dashboard.getCurrentUserId();
ApiClient.getLiveTvChannels(query).done(function (result) {
ApiClient.getLiveTvChannels(query).then(function (result) {
renderChannels(page, viewPanel, result);

View file

@ -342,7 +342,7 @@
var id = elem.getAttribute('data-programid');
ApiClient.getLiveTvProgram(id, Dashboard.getCurrentUserId()).done(function (item) {
ApiClient.getLiveTvProgram(id, Dashboard.getCurrentUserId()).then(function (item) {
showOverlay(elem, item);

View file

@ -15,19 +15,20 @@
function loadTemplate(page, type, providerId) {
HttpClient.send({
var xhr = new XMLHttpRequest();
xhr.open('GET', 'components/tvproviders/' + type + '.template.html', true);
type: 'GET',
url: 'components/tvproviders/' + type + '.template.html'
}).done(function (html) {
xhr.onload = function (e) {
var html = this.response;
var elem = page.querySelector('.providerTemplate');
elem.innerHTML = Globalize.translateDocument(html);
$(elem).trigger('create');
init(page, type, providerId);
});
}
xhr.send();
}
$(document).on('pageshow', "#liveTvGuideProviderPage", function () {

View file

@ -22,7 +22,7 @@
Dashboard.showLoadingMsg();
ApiClient.getLiveTvPrograms(query).done(function (result) {
ApiClient.getLiveTvPrograms(query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);

View file

@ -16,7 +16,7 @@
registrationInfo = null;
Dashboard.showLoadingMsg();
ApiClient.fetchJSON(ApiClient.getUrl('LiveTv/Registration', {
ApiClient.getJSON(ApiClient.getUrl('LiveTv/Registration', {
ProgramId: programId,
Feature: 'seriesrecordings'
@ -84,7 +84,7 @@
var promise1 = ApiClient.getNewLiveTvTimerDefaults({ programId: programId });
var promise2 = ApiClient.getLiveTvProgram(programId, Dashboard.getCurrentUserId());
$.when(promise1, promise2).done(function (response1, response2) {
$.when(promise1, promise2).then(function (response1, response2) {
var defaults = response1[0];
var program = response2[0];
@ -142,7 +142,7 @@
var programId = getParameterByName('programid');
ApiClient.getNewLiveTvTimerDefaults({ programId: programId }).done(function (item) {
ApiClient.getNewLiveTvTimerDefaults({ programId: programId }).then(function (item) {
item.PrePaddingSeconds = $('#txtPrePaddingMinutes', form).val() * 60;
item.PostPaddingSeconds = $('#txtPostPaddingMinutes', form).val() * 60;
@ -155,7 +155,7 @@
if ($('#chkRecordSeries', form).checked()) {
ApiClient.createLiveTvSeriesTimer(item).done(function () {
ApiClient.createLiveTvSeriesTimer(item).then(function () {
Dashboard.hideLoadingMsg();
Dashboard.navigate('livetv.html');
@ -163,7 +163,7 @@
});
} else {
ApiClient.createLiveTvTimer(item).done(function () {
ApiClient.createLiveTvTimer(item).then(function () {
Dashboard.hideLoadingMsg();
Dashboard.navigate('livetv.html');
@ -187,7 +187,7 @@
$('#seriesFields', page).show();
page.querySelector('.btnSubmitContainer').classList.remove('hide');
getRegistration(getParameterByName('programid')).done(function (regInfo) {
getRegistration(getParameterByName('programid')).then(function (regInfo) {
if (regInfo.IsValid) {
page.querySelector('.btnSubmitContainer').classList.remove('hide');

View file

@ -11,7 +11,7 @@
Dashboard.showLoadingMsg();
ApiClient.getLiveTvRecordings(query).done(function (result) {
ApiClient.getLiveTvRecordings(query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);
@ -107,7 +107,7 @@
if (query.GroupId) {
ApiClient.getLiveTvRecordingGroup(query.GroupId).done(function (group) {
ApiClient.getLiveTvRecordingGroup(query.GroupId).then(function (group) {
$('.listName', page).html(group.Name);
});

View file

@ -86,7 +86,7 @@
userId: Dashboard.getCurrentUserId(),
IsInProgress: true
}).done(function (result) {
}).then(function (result) {
renderRecordings(page.querySelector('#activeRecordings'), result.Items);
@ -98,7 +98,7 @@
limit: 12,
IsInProgress: false
}).done(function (result) {
}).then(function (result) {
renderRecordings(page.querySelector('#latestRecordings'), result.Items);
});
@ -107,7 +107,7 @@
userId: Dashboard.getCurrentUserId()
}).done(function (result) {
}).then(function (result) {
renderRecordingGroups(page, result.Items);

View file

@ -10,7 +10,7 @@
Dashboard.showLoadingMsg();
ApiClient.cancelLiveTvTimer(id).done(function () {
ApiClient.cancelLiveTvTimer(id).then(function () {
Dashboard.alert(Globalize.translate('MessageRecordingCancelled'));
@ -103,7 +103,7 @@
var form = this;
ApiClient.getLiveTvSeriesTimer(currentItem.Id).done(function (item) {
ApiClient.getLiveTvSeriesTimer(currentItem.Id).then(function (item) {
item.PrePaddingSeconds = $('#txtPrePaddingMinutes', form).val() * 60;
item.PostPaddingSeconds = $('#txtPostPaddingMinutes', form).val() * 60;
@ -114,7 +114,7 @@
item.Days = getDays(form);
ApiClient.updateLiveTvSeriesTimer(item).done(function () {
ApiClient.updateLiveTvSeriesTimer(item).then(function () {
Dashboard.alert(Globalize.translate('MessageRecordingSaved'));
});
});
@ -159,7 +159,7 @@
var id = getParameterByName('id');
ApiClient.getLiveTvSeriesTimer(id).done(function (result) {
ApiClient.getLiveTvSeriesTimer(id).then(function (result) {
renderTimer(page, result);
@ -170,7 +170,7 @@
userId: Dashboard.getCurrentUserId(),
seriesTimerId: id
}).done(function (recordingResult) {
}).then(function (recordingResult) {
renderRecordings(page, recordingResult);
@ -180,7 +180,7 @@
seriesTimerId: id
}).done(function (timerResult) {
}).then(function (timerResult) {
renderSchedule(page, timerResult);

View file

@ -14,7 +14,7 @@
Dashboard.showLoadingMsg();
ApiClient.cancelLiveTvSeriesTimer(id).done(function () {
ApiClient.cancelLiveTvSeriesTimer(id).then(function () {
Dashboard.alert(Globalize.translate('MessageSeriesCancelled'));
@ -102,7 +102,7 @@
Dashboard.showLoadingMsg();
ApiClient.getLiveTvSeriesTimers(query).done(function (result) {
ApiClient.getLiveTvSeriesTimers(query).then(function (result) {
renderTimers(page, result.Items);

View file

@ -24,7 +24,7 @@
var form = this;
ApiClient.getNamedConfiguration("livetv").done(function (config) {
ApiClient.getNamedConfiguration("livetv").then(function (config) {
config.GuideDays = $('#selectGuideDays', form).val() || null;
config.EnableMovieProviders = $('#chkMovies', form).checked();
@ -34,7 +34,7 @@
config.PrePaddingSeconds = $('#txtPrePaddingMinutes', form).val() * 60;
config.PostPaddingSeconds = $('#txtPostPaddingMinutes', form).val() * 60;
ApiClient.updateNamedConfiguration("livetv", config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateNamedConfiguration("livetv", config).then(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
@ -72,7 +72,7 @@
var page = this;
ApiClient.getNamedConfiguration("livetv").done(function (config) {
ApiClient.getNamedConfiguration("livetv").then(function (config) {
loadPage(page, config);

View file

@ -10,7 +10,7 @@
Dashboard.showLoadingMsg();
ApiClient.resetLiveTvTuner(id).done(function () {
ApiClient.resetLiveTvTuner(id).then(function () {
Dashboard.hideLoadingMsg();
@ -172,7 +172,7 @@
renderTuners(page, tuners);
ApiClient.getNamedConfiguration("livetv").done(function (config) {
ApiClient.getNamedConfiguration("livetv").then(function (config) {
renderDevices(page, config.TunerHosts);
renderProviders(page, config.ListingProviders);
@ -243,7 +243,7 @@
Id: id
})
}).done(function () {
}).then(function () {
reload(page);
});
@ -255,7 +255,7 @@
Dashboard.showLoadingMsg();
ApiClient.getLiveTvInfo().done(function (liveTvInfo) {
ApiClient.getLiveTvInfo().then(function (liveTvInfo) {
loadPage(page, liveTvInfo);
@ -276,11 +276,11 @@
}),
contentType: "application/json"
}).done(function () {
}).then(function () {
reload(page);
}).fail(function () {
}, function () {
Dashboard.alert({
message: Globalize.translate('ErrorAddingTunerDevice')
});
@ -345,7 +345,11 @@
Id: id
})
}).always(function () {
}).then(function () {
reload(page);
}, function () {
reload(page);
});

View file

@ -33,7 +33,7 @@
ImageTypeLimit: 1,
EnableImageTypes: "Primary"
}).done(function (result) {
}).then(function (result) {
renderItems(page, result.Items, 'activeProgramItems', 'play');
LibraryBrowser.setLastRefreshed(page);
@ -56,7 +56,7 @@
IsKids: false,
IsSeries: true
}).done(function (result) {
}).then(function (result) {
renderItems(page, result.Items, 'upcomingProgramItems');
});
@ -69,7 +69,7 @@
limit: getLimit(),
IsMovie: true
}).done(function (result) {
}).then(function (result) {
renderItems(page, result.Items, 'upcomingTvMovieItems', null, getPortraitShape());
});
@ -82,7 +82,7 @@
limit: getLimit(),
IsSports: true
}).done(function (result) {
}).then(function (result) {
renderItems(page, result.Items, 'upcomingSportsItems');
});
@ -95,7 +95,7 @@
limit: getLimit(),
IsKids: true
}).done(function (result) {
}).then(function (result) {
renderItems(page, result.Items, 'upcomingKidsItems');
});

View file

@ -10,7 +10,7 @@
Dashboard.showLoadingMsg();
ApiClient.cancelLiveTvTimer(id).done(function () {
ApiClient.cancelLiveTvTimer(id).then(function () {
Dashboard.alert(Globalize.translate('MessageRecordingCancelled'));
@ -72,12 +72,12 @@
var form = this;
ApiClient.getLiveTvTimer(currentItem.Id).done(function (item) {
ApiClient.getLiveTvTimer(currentItem.Id).then(function (item) {
item.PrePaddingSeconds = $('#txtPrePaddingMinutes', form).val() * 60;
item.PostPaddingSeconds = $('#txtPostPaddingMinutes', form).val() * 60;
ApiClient.updateLiveTvTimer(item).done(function () {
ApiClient.updateLiveTvTimer(item).then(function () {
Dashboard.hideLoadingMsg();
Dashboard.alert(Globalize.translate('MessageRecordingSaved'));
});
@ -94,7 +94,7 @@
var id = getParameterByName('id');
ApiClient.getLiveTvTimer(id).done(function (result) {
ApiClient.getLiveTvTimer(id).then(function (result) {
renderTimer(page, result);

View file

@ -8,7 +8,7 @@
Dashboard.showLoadingMsg();
ApiClient.cancelLiveTvTimer(id).done(function () {
ApiClient.cancelLiveTvTimer(id).then(function () {
Dashboard.alert(Globalize.translate('MessageRecordingCancelled'));
@ -39,7 +39,7 @@
Dashboard.showLoadingMsg();
ApiClient.getLiveTvTimers().done(function (result) {
ApiClient.getLiveTvTimers().then(function (result) {
renderTimers(page, result.Items);
});

View file

@ -6,7 +6,7 @@
page.querySelector('.chkFavorite').checked = false;
if (providerId) {
ApiClient.getNamedConfiguration("livetv").done(function (config) {
ApiClient.getNamedConfiguration("livetv").then(function (config) {
var info = config.TunerHosts.filter(function (i) {
return i.Id == providerId;
@ -45,12 +45,12 @@
data: JSON.stringify(info),
contentType: "application/json"
}).done(function (result) {
}).then(function (result) {
Dashboard.processServerConfigurationUpdateResult();
Dashboard.navigate('livetvstatus.html');
}).fail(function () {
}, function () {
Dashboard.alert({
message: Globalize.translate('ErrorSavingTvProvider')
});

View file

@ -5,7 +5,7 @@
page.querySelector('.txtDevicePath').value = '';
if (providerId) {
ApiClient.getNamedConfiguration("livetv").done(function (config) {
ApiClient.getNamedConfiguration("livetv").then(function (config) {
var info = config.TunerHosts.filter(function (i) {
return i.Id == providerId;
@ -37,12 +37,12 @@
data: JSON.stringify(info),
contentType: "application/json"
}).done(function (result) {
}).then(function (result) {
Dashboard.processServerConfigurationUpdateResult();
Dashboard.navigate('livetvstatus.html');
}).fail(function () {
}, function () {
Dashboard.hideLoadingMsg();
Dashboard.alert({
message: Globalize.translate('ErrorSavingTvProvider')

View file

@ -24,12 +24,12 @@
options.cameraUploadServers = AppSettings.cameraUploadServers();
syncPromise = new MediaBrowser.MultiServerSync(ConnectionManager).sync(options).done(function () {
syncPromise = new MediaBrowser.MultiServerSync(ConnectionManager).sync(options).then(function () {
syncPromise = null;
deferred.resolve();
}).fail(function () {
}, function () {
syncPromise = null;
});

View file

@ -21,9 +21,9 @@
var page = this;
LoginPage.getApiClient().done(function (apiClient) {
LoginPage.getApiClient().then(function (apiClient) {
apiClient.getPublicUsers().done(function (users) {
apiClient.getPublicUsers().then(function (users) {
var showManualForm = !users.length;
@ -40,7 +40,7 @@
Dashboard.hideLoadingMsg();
});
apiClient.fetchJSON(apiClient.getUrl('Branding/Configuration')).then(function (options) {
apiClient.getJSON(apiClient.getUrl('Branding/Configuration')).then(function (options) {
$('.disclaimer', page).html(options.LoginDisclaimer || '');
});
@ -93,7 +93,7 @@
Dashboard.showLoadingMsg();
apiClient.authenticateUserByName(username, password).done(function (result) {
apiClient.authenticateUserByName(username, password).then(function (result) {
var user = result.User;
@ -112,7 +112,7 @@
Dashboard.onServerChanged(user.Id, result.AccessToken, apiClient);
Dashboard.navigate(newUrl);
}).fail(function () {
}, function () {
$('#pw', page).val('');
$('#txtManualName', page).val('');
@ -207,7 +207,7 @@
var page = $(this).parents('.page');
LoginPage.getApiClient().done(function (apiClient) {
LoginPage.getApiClient().then(function (apiClient) {
LoginPage.authenticateUserByName(page, apiClient, $('#txtManualName', page).val(), $('#txtManualPassword', page).val());
});

View file

@ -6,7 +6,7 @@
var apiClient = ApiClient;
apiClient.fetchJSON(apiClient.getUrl('System/Logs')).then(function (logs) {
apiClient.getJSON(apiClient.getUrl('System/Logs')).then(function (logs) {
var html = '';

View file

@ -75,7 +75,7 @@
Dashboard.showModalLoadingMsg();
MediaController.getTargets().done(function (targets) {
MediaController.getTargets().then(function (targets) {
var menuItems = targets.map(function (t) {
@ -207,7 +207,7 @@
var player = controller.getCurrentPlayer();
player.getPlayerState().done(function (result) {
player.getPlayerState().then(function (result) {
var state = result;
@ -321,7 +321,7 @@
currentPairingId = targetInfo.id;
player.tryPair(targetInfo).done(function () {
player.tryPair(targetInfo).then(function () {
currentPlayer = player;
currentTargetInfo = targetInfo;
@ -340,7 +340,7 @@
name = normalizeName(name);
self.getTargets().done(function (result) {
self.getTargets().then(function (result) {
var target = result.filter(function (p) {
return normalizeName(p.name) == name;
@ -418,7 +418,7 @@
return p.getTargets();
});
$.when.apply($, promises).done(function () {
$.when.apply($, promises).then(function () {
var targets = [];
@ -461,7 +461,7 @@
self.playbackTimeLimitMs = null;
RegistrationServices.validateFeature('playback').done(fn).fail(function () {
RegistrationServices.validateFeature('playback').then(fn, function () {
self.playbackTimeLimitMs = lockedTimeLimitMs;
startAutoStopTimer();
@ -801,7 +801,7 @@
var serverInfo = ApiClient.serverInfo();
if (serverInfo.Id) {
LocalAssetManager.getLocalMediaSource(serverInfo.Id, itemId).done(function (localMediaSource) {
LocalAssetManager.getLocalMediaSource(serverInfo.Id, itemId).then(function (localMediaSource) {
// Use the local media source if a specific one wasn't requested, or the smae one was requested
if (localMediaSource && (!mediaSource || mediaSource.Id == localMediaSource.Id)) {
@ -823,9 +823,9 @@
}
function getPlaybackInfoWithoutLocalMediaSource(itemId, deviceProfile, startPosition, mediaSource, audioStreamIndex, subtitleStreamIndex, liveStreamId, deferred) {
self.getPlaybackInfoInternal(itemId, deviceProfile, startPosition, mediaSource, audioStreamIndex, subtitleStreamIndex, liveStreamId).done(function (result) {
self.getPlaybackInfoInternal(itemId, deviceProfile, startPosition, mediaSource, audioStreamIndex, subtitleStreamIndex, liveStreamId).then(function (result) {
deferred.resolveWith(null, [result]);
}).fail(function () {
}, function () {
deferred.reject();
});
}
@ -916,7 +916,7 @@
require(['localassetmanager'], function () {
LocalAssetManager.fileExists(mediaSource.Path).done(function (exists) {
LocalAssetManager.fileExists(mediaSource.Path).then(function (exists) {
Logger.log('LocalAssetManager.fileExists: path: ' + mediaSource.Path + ' result: ' + exists);
deferred.resolveWith(null, [exists]);
});

View file

@ -17,7 +17,7 @@
collectionTypeOptions: getCollectionTypeOptions(),
refresh: shouldRefreshLibraryAfterChanges(page)
}).done(function (hasChanges) {
}).then(function (hasChanges) {
if (hasChanges) {
reloadLibrary(page);
@ -35,7 +35,7 @@
refresh: shouldRefreshLibraryAfterChanges(page),
library: virtualFolder
}).done(function (hasChanges) {
}).then(function (hasChanges) {
if (hasChanges) {
reloadLibrary(page);
@ -59,7 +59,7 @@
var refreshAfterChange = shouldRefreshLibraryAfterChanges(page);
ApiClient.removeVirtualFolder(virtualFolder.Name, refreshAfterChange).done(function () {
ApiClient.removeVirtualFolder(virtualFolder.Name, refreshAfterChange).then(function () {
reloadLibrary(page);
});
}
@ -80,7 +80,7 @@
var refreshAfterChange = shouldRefreshLibraryAfterChanges(page);
ApiClient.renameVirtualFolder(virtualFolder.Name, newName, refreshAfterChange).done(function () {
ApiClient.renameVirtualFolder(virtualFolder.Name, newName, refreshAfterChange).then(function () {
reloadLibrary(page);
});
}
@ -156,7 +156,7 @@
Dashboard.showLoadingMsg();
ApiClient.getVirtualFolders().done(function (result) {
ApiClient.getVirtualFolders().then(function (result) {
reloadVirtualFolders(page, result);
});
}
@ -211,7 +211,7 @@
ImageEditor.show(virtualFolder.ItemId, {
theme: 'a'
}).done(function (hasChanged) {
}).then(function (hasChanged) {
if (hasChanged) {
reloadLibrary(page);
}
@ -441,7 +441,7 @@ var WizardLibraryPage = {
type: "POST",
url: apiClient.getUrl('System/Configuration/MetadataPlugins/Autoset')
}).done(function () {
}).then(function () {
Dashboard.hideLoadingMsg();
Dashboard.navigate('wizardsettings.html');

View file

@ -955,7 +955,7 @@
requirejs(['videorenderer'], function () {
self.createStreamInfo('Video', item, mediaSource, startPosition).done(function (streamInfo) {
self.createStreamInfo('Video', item, mediaSource, startPosition).then(function (streamInfo) {
// Huge hack alert. Safari doesn't seem to like if the segments aren't available right away when playback starts
// This will start the transcoding process before actually feeding the video url into the player
@ -964,14 +964,15 @@
Dashboard.showLoadingMsg();
ApiClient.ajax({
type: 'GET',
url: streamInfo.url.replace('master.m3u8', 'live.m3u8')
}).always(function () {
}).then(function () {
Dashboard.hideLoadingMsg();
}).done(function () {
self.playVideoInternal(item, mediaSource, startPosition, streamInfo, callback);
}, function () {
Dashboard.hideLoadingMsg();
});
} else {
@ -1135,7 +1136,7 @@
self.updateNowPlayingInfo(item);
mediaRenderer.init().done(function () {
mediaRenderer.init().then(function () {
self.onBeforePlaybackStart(mediaRenderer, item, mediaSource);

View file

@ -668,7 +668,7 @@
});
if (self.currentItem.MediaType == "Video") {
ApiClient.stopActiveEncodings(playSessionId).done(function () {
ApiClient.stopActiveEncodings(playSessionId).then(function () {
//self.startTimeTicksOffset = newPositionTicks;
self.setSrcIntoRenderer(mediaRenderer, streamInfo, self.currentItem, self.currentMediaSource);
@ -862,7 +862,7 @@
return;
}
ApiClient.fetchJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/' + firstItem.Id + '/Intros')).then(function (intros) {
ApiClient.getJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/' + firstItem.Id + '/Intros')).then(function (intros) {
items = intros.Items.concat(items);
self.playInternal(items[0], options.startPositionTicks, function () {
@ -880,7 +880,7 @@
return MediaController.supportsDirectPlay(v);
});
$.when.apply($, promises).done(function () {
$.when.apply($, promises).then(function () {
for (var i = 0, length = versions.length; i < length; i++) {
versions[i].enableDirectPlay = arguments[i] || false;
@ -1036,7 +1036,7 @@
require(['localassetmanager'], function () {
LocalAssetManager.translateFilePath(resultInfo.url).done(function (path) {
LocalAssetManager.translateFilePath(resultInfo.url).then(function (path) {
resultInfo.url = path;
Logger.log('LocalAssetManager.translateFilePath: path: ' + resultInfo.url + ' result: ' + path);
@ -1087,7 +1087,8 @@
AppSettings.maxStreamingBitrate(bitrate);
playOnDeviceProfileCreated(self.getDeviceProfile(), item, startPosition, callback);
}).fail(function () {
}, function () {
playOnDeviceProfileCreated(self.getDeviceProfile(), item, startPosition, callback);
});
@ -1108,14 +1109,14 @@
if (validatePlaybackInfoResult(playbackInfoResult)) {
getOptimalMediaSource(item.MediaType, playbackInfoResult.MediaSources).done(function (mediaSource) {
getOptimalMediaSource(item.MediaType, playbackInfoResult.MediaSources).then(function (mediaSource) {
if (mediaSource) {
if (mediaSource.RequiresOpening) {
MediaController.getLiveStream(item.Id, playbackInfoResult.PlaySessionId, deviceProfile, startPosition, mediaSource, null, null).done(function (openLiveStreamResult) {
MediaController.getLiveStream(item.Id, playbackInfoResult.PlaySessionId, deviceProfile, startPosition, mediaSource, null, null).then(function (openLiveStreamResult) {
MediaController.supportsDirectPlay(openLiveStreamResult.MediaSource).done(function (result) {
MediaController.supportsDirectPlay(openLiveStreamResult.MediaSource).then(function (result) {
openLiveStreamResult.MediaSource.enableDirectPlay = result;
callback(openLiveStreamResult.MediaSource);

View file

@ -107,23 +107,23 @@
});
ApiClient.getNamedConfiguration("metadata").done(function (metadata) {
ApiClient.getNamedConfiguration("metadata").then(function (metadata) {
loadMetadataConfig(page, metadata);
});
ApiClient.getNamedConfiguration("fanart").done(function (metadata) {
ApiClient.getNamedConfiguration("fanart").then(function (metadata) {
loadFanartConfig(page, metadata);
});
ApiClient.getNamedConfiguration("themoviedb").done(function (metadata) {
ApiClient.getNamedConfiguration("themoviedb").then(function (metadata) {
loadTmdbConfig(page, metadata);
});
ApiClient.getNamedConfiguration("tvdb").done(function (metadata) {
ApiClient.getNamedConfiguration("tvdb").then(function (metadata) {
loadTvdbConfig(page, metadata);
});
@ -131,7 +131,7 @@
var promise1 = ApiClient.getNamedConfiguration("chapters");
var promise2 = ApiClient.getJSON(ApiClient.getUrl("Providers/Chapters"));
$.when(promise1, promise2).done(function (response1, response2) {
$.when(promise1, promise2).then(function (response1, response2) {
loadChapters(page, response1[0], response2[0]);
});
@ -139,7 +139,7 @@
function saveFanart(form) {
ApiClient.getNamedConfiguration("fanart").done(function (config) {
ApiClient.getNamedConfiguration("fanart").then(function (config) {
config.EnableAutomaticUpdates = $('#chkEnableFanartUpdates', form).checked();
config.UserApiKey = $('#txtFanartApiKey', form).val();
@ -150,7 +150,7 @@
function saveTvdb(form) {
ApiClient.getNamedConfiguration("tvdb").done(function (config) {
ApiClient.getNamedConfiguration("tvdb").then(function (config) {
config.EnableAutomaticUpdates = $('#chkEnableTvdbUpdates', form).checked();
@ -160,7 +160,7 @@
function saveTmdb(form) {
ApiClient.getNamedConfiguration("themoviedb").done(function (config) {
ApiClient.getNamedConfiguration("themoviedb").then(function (config) {
config.EnableAutomaticUpdates = $('#chkEnableTmdbUpdates', form).checked();
@ -190,13 +190,13 @@
config.PeopleMetadataOptions.DownloadWriterMetadata = $('#chkPeopleWriters', form).checked();
config.PeopleMetadataOptions.DownloadOtherPeopleMetadata = $('#chkPeopleOthers', form).checked();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
});
}
function saveMetadata(form) {
ApiClient.getNamedConfiguration("metadata").done(function (config) {
ApiClient.getNamedConfiguration("metadata").then(function (config) {
config.UseFileCreationTimeForDateAdded = $('#selectDateAdded', form).val() == '1';
@ -206,7 +206,7 @@
function saveChapters(form) {
ApiClient.getNamedConfiguration("chapters").done(function (config) {
ApiClient.getNamedConfiguration("chapters").then(function (config) {
config.EnableMovieChapterImageExtraction = $('#chkChaptersMovies', form).checked();
config.EnableEpisodeChapterImageExtraction = $('#chkChaptersEpisodes', form).checked();

View file

@ -29,7 +29,7 @@
config.PreferredMetadataLanguage = $('#selectLanguage', form).val();
config.MetadataCountryCode = $('#selectCountry', form).val();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
@ -58,7 +58,7 @@
load(page, config, allCultures, allCountries);
});
ApiClient.getCultures().done(function (result) {
ApiClient.getCultures().then(function (result) {
Dashboard.populateLanguages($('#selectLanguage', page), result);
@ -66,7 +66,7 @@
load(page, config, allCultures, allCountries);
});
ApiClient.getCountries().done(function (result) {
ApiClient.getCountries().then(function (result) {
Dashboard.populateCountries($('#selectCountry', page), result);

View file

@ -27,7 +27,7 @@
currentType = type;
var promise1 = ApiClient.getServerConfiguration();
var promise2 = ApiClient.fetchJSON(ApiClient.getUrl("System/Configuration/MetadataPlugins"));
var promise2 = ApiClient.getJSON(ApiClient.getUrl("System/Configuration/MetadataPlugins"));
Promise.all([promise1, promise2]).then(function (responses) {
@ -46,7 +46,7 @@
} else {
ApiClient.fetchJSON(ApiClient.getUrl("System/Configuration/MetadataOptions/Default")).then(function (defaultConfig) {
ApiClient.getJSON(ApiClient.getUrl("System/Configuration/MetadataOptions/Default")).then(function (defaultConfig) {
config = defaultConfig;
@ -501,16 +501,16 @@
if (metadataOptions) {
saveSettingsIntoConfig(form, metadataOptions);
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
} else {
ApiClient.fetchJSON(ApiClient.getUrl("System/Configuration/MetadataOptions/Default")).then(function (defaultOptions) {
ApiClient.getJSON(ApiClient.getUrl("System/Configuration/MetadataOptions/Default")).then(function (defaultOptions) {
defaultOptions.ItemType = type;
config.MetadataOptions.push(defaultOptions);
saveSettingsIntoConfig(form, defaultOptions);
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
});
}

View file

@ -24,7 +24,7 @@
var form = this;
ApiClient.getNamedConfiguration(metadataKey).done(function (config) {
ApiClient.getNamedConfiguration(metadataKey).then(function (config) {
config.UserId = $('#selectUser', form).val() || null;
config.ReleaseDateFormat = $('#selectReleaseDateFormat', form).val();
@ -32,7 +32,7 @@
config.EnablePathSubstitution = $('#chkEnablePathSubstitution', form).checked();
config.EnableExtraThumbsDuplication = $('#chkEnableExtraThumbs', form).checked();
ApiClient.updateNamedConfiguration(metadataKey, config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateNamedConfiguration(metadataKey, config).then(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
@ -52,7 +52,7 @@
var promise1 = ApiClient.getUsers();
var promise2 = ApiClient.getNamedConfiguration(metadataKey);
$.when(promise1, promise2).done(function (response1, response2) {
$.when(promise1, promise2).then(function (response1, response2) {
loadPage(page, response2[0], response1[0]);
});

View file

@ -48,7 +48,7 @@
var form = this;
ApiClient.getNamedConfiguration("subtitles").done(function (config) {
ApiClient.getNamedConfiguration("subtitles").then(function (config) {
config.DownloadMovieSubtitles = $('#chkSubtitlesMovies', form).checked();
config.DownloadEpisodeSubtitles = $('#chkSubtitlesEpisodes', form).checked();
@ -70,7 +70,7 @@
});
ApiClient.updateNamedConfiguration("subtitles", config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateNamedConfiguration("subtitles", config).then(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
@ -90,7 +90,7 @@
var promise1 = ApiClient.getNamedConfiguration("subtitles");
var promise2 = ApiClient.getCultures();
$.when(promise1, promise2).done(function (response1, response2) {
$.when(promise1, promise2).then(function (response1, response2) {
loadPage(page, response1[0], response2[0]);

View file

@ -40,7 +40,7 @@
Dashboard.showLoadingMsg();
var query = getQuery();
ApiClient.getGenres(Dashboard.getCurrentUserId(), query).done(function (result) {
ApiClient.getGenres(Dashboard.getCurrentUserId(), query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);

View file

@ -36,7 +36,7 @@
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
};
ApiClient.fetchJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
var view = getView();
var html = '';
@ -216,7 +216,7 @@
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
});
ApiClient.fetchJSON(url).then(function (recommendations) {
ApiClient.getJSON(url).then(function (recommendations) {
if (!recommendations.length) {

View file

@ -38,7 +38,7 @@
var query = getQuery();
ApiClient.getStudios(Dashboard.getCurrentUserId(), query).done(function (result) {
ApiClient.getStudios(Dashboard.getCurrentUserId(), query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);

View file

@ -39,7 +39,7 @@
var query = getQuery();
query.UserId = Dashboard.getCurrentUserId();
ApiClient.fetchJSON(ApiClient.getUrl('Trailers', query)).then(function (result) {
ApiClient.getJSON(ApiClient.getUrl('Trailers', query)).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);

View file

@ -42,7 +42,7 @@
var query = getQuery();
ApiClient.getAlbumArtists(Dashboard.getCurrentUserId(), query).done(function (result) {
ApiClient.getAlbumArtists(Dashboard.getCurrentUserId(), query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);

View file

@ -42,7 +42,7 @@
var query = getQuery();
ApiClient.getArtists(Dashboard.getCurrentUserId(), query).done(function (result) {
ApiClient.getArtists(Dashboard.getCurrentUserId(), query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);

View file

@ -41,7 +41,7 @@
var query = getQuery();
ApiClient.getMusicGenres(Dashboard.getCurrentUserId(), query).done(function (result) {
ApiClient.getMusicGenres(Dashboard.getCurrentUserId(), query).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);

View file

@ -30,7 +30,7 @@
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
};
ApiClient.fetchJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
var elem = page.querySelector('#recentlyAddedSongs');
elem.innerHTML = LibraryBrowser.getPosterViewHtml({

View file

@ -28,7 +28,7 @@
appStorage.setItem('enableThemeSongs-' + user.Id, $('#selectThemeSong', page).val());
appStorage.setItem('enableBackdrops-' + user.Id, $('#selectBackdrop', page).val());
ApiClient.updateUserConfiguration(user.Id, user.Configuration).done(function () {
ApiClient.updateUserConfiguration(user.Id, user.Configuration).then(function () {
Dashboard.alert(Globalize.translate('SettingsSaved'));
loadForm(page, user);
@ -43,7 +43,7 @@
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
ApiClient.getUser(userId).done(function (user) {
ApiClient.getUser(userId).then(function (user) {
saveUser(page, user);
@ -67,7 +67,7 @@
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
ApiClient.getUser(userId).done(function (user) {
ApiClient.getUser(userId).then(function (user) {
loadForm(page, user);

View file

@ -140,8 +140,8 @@
sortBy: "SortName"
});
var promise2 = ApiClient.getUserViews({}, user.Id);
var promise3 = ApiClient.fetchJSON(ApiClient.getUrl("Users/" + user.Id + "/SpecialViewOptions"));
var promise4 = ApiClient.fetchJSON(ApiClient.getUrl("Users/" + user.Id + "/GroupingOptions"));
var promise3 = ApiClient.getJSON(ApiClient.getUrl("Users/" + user.Id + "/SpecialViewOptions"));
var promise4 = ApiClient.getJSON(ApiClient.getUrl("Users/" + user.Id + "/GroupingOptions"));
Promise.all([promise1, promise2, promise3, promise4]).then(function (responses) {
@ -200,9 +200,9 @@
displayPreferences.CustomPrefs.home2 = $('#selectHomeSection3', page).val();
displayPreferences.CustomPrefs.home3 = $('#selectHomeSection4', page).val();
ApiClient.updateDisplayPreferences('home', displayPreferences, user.Id, AppSettings.displayPreferencesKey()).done(function () {
ApiClient.updateDisplayPreferences('home', displayPreferences, user.Id, AppSettings.displayPreferencesKey()).then(function () {
ApiClient.updateUserConfiguration(user.Id, user.Configuration).done(function () {
ApiClient.updateUserConfiguration(user.Id, user.Configuration).then(function () {
Dashboard.alert(Globalize.translate('SettingsSaved'));
loadForm(page, user, displayPreferences);
@ -218,7 +218,7 @@
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
ApiClient.getUser(userId).done(function (user) {
ApiClient.getUser(userId).then(function (user) {
ApiClient.getDisplayPreferences('home', user.Id, AppSettings.displayPreferencesKey()).then(function (displayPreferences) {
@ -283,7 +283,7 @@
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
ApiClient.getUser(userId).done(function (user) {
ApiClient.getUser(userId).then(function (user) {
ApiClient.getDisplayPreferences('home', user.Id, AppSettings.displayPreferencesKey()).then(function (result) {

View file

@ -18,7 +18,7 @@
function loadForm(page, user, loggedInUser, allCulturesPromise) {
allCulturesPromise.done(function (allCultures) {
allCulturesPromise.then(function (allCultures) {
populateLanguages($('#selectAudioLanguage', page), allCultures);
populateLanguages($('#selectSubtitleLanguage', page), allCultures);
@ -67,13 +67,13 @@
var allCulturesPromise = ApiClient.getCultures();
$.when(promise1, promise2).done(function (response1, response2) {
$.when(promise1, promise2).then(function (response1, response2) {
loadForm(page, response1[0] || response1, response2[0], allCulturesPromise);
});
ApiClient.getNamedConfiguration("cinemamode").done(function (cinemaConfig) {
ApiClient.getNamedConfiguration("cinemamode").then(function (cinemaConfig) {
if (cinemaConfig.EnableIntrosForMovies || cinemaConfig.EnableIntrosForEpisodes) {
$('.cinemaModeOptions', page).show();
@ -93,10 +93,12 @@
AppSettings.enableCinemaMode(page.querySelector('.chkEnableCinemaMode').checked);
ApiClient.updateUserConfiguration(user.Id, user.Configuration).done(function () {
ApiClient.updateUserConfiguration(user.Id, user.Configuration).then(function () {
Dashboard.hideLoadingMsg();
Dashboard.alert(Globalize.translate('SettingsSaved'));
}).always(function () {
}, function () {
Dashboard.hideLoadingMsg();
});
}
@ -121,7 +123,7 @@
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
ApiClient.getUser(userId).done(function (result) {
ApiClient.getUser(userId).then(function (result) {
saveUser(page, result);

View file

@ -8,7 +8,7 @@
Dashboard.showLoadingMsg();
ApiClient.getUser(userId).done(function (user) {
ApiClient.getUser(userId).then(function (user) {
$('.username', page).html(user.Name);
Events.trigger($('#uploadUserImage', page).val('')[0], 'change');
@ -168,7 +168,7 @@
var userId = getParameterByName("userId");
ApiClient.uploadUserImage(userId, 'Primary', file).done(processImageChangeResult);
ApiClient.uploadUserImage(userId, 'Primary', file).then(processImageChangeResult);
return false;
};
@ -199,7 +199,7 @@
var userId = getParameterByName("userId");
ApiClient.deleteUserImage(userId, "primary").done(processImageChangeResult);
ApiClient.deleteUserImage(userId, "primary").then(processImageChangeResult);
}
});
@ -218,7 +218,7 @@
var userid = getParameterByName("userId");
ApiClient.getUser(userid).done(function (user) {
ApiClient.getUser(userid).then(function (user) {
Dashboard.setPageTitle(user.Name);
@ -262,7 +262,7 @@
if (easyPassword) {
ApiClient.updateEasyPassword(userId, easyPassword).done(function () {
ApiClient.updateEasyPassword(userId, easyPassword).then(function () {
onEasyPasswordSaved(page, userId);
@ -275,11 +275,11 @@
function onEasyPasswordSaved(page, userId) {
ApiClient.getUser(userId).done(function (user) {
ApiClient.getUser(userId).then(function (user) {
user.Configuration.EnableLocalPassword = page.querySelector('.chkEnableLocalEasyPassword').checked;
ApiClient.updateUserConfiguration(user.Id, user.Configuration).done(function () {
ApiClient.updateUserConfiguration(user.Id, user.Configuration).then(function () {
Dashboard.hideLoadingMsg();
@ -296,7 +296,7 @@
var currentPassword = $('#txtCurrentPassword', page).val();
var newPassword = $('#txtNewPassword', page).val();
ApiClient.updateUserPassword(userId, currentPassword, newPassword).done(function () {
ApiClient.updateUserPassword(userId, currentPassword, newPassword).then(function () {
Dashboard.hideLoadingMsg();
@ -356,7 +356,7 @@
Dashboard.showLoadingMsg();
ApiClient.resetUserPassword(userId).done(function () {
ApiClient.resetUserPassword(userId).then(function () {
Dashboard.hideLoadingMsg();
@ -386,7 +386,7 @@
Dashboard.showLoadingMsg();
ApiClient.resetEasyPassword(userId).done(function () {
ApiClient.resetEasyPassword(userId).then(function () {
Dashboard.hideLoadingMsg();

View file

@ -47,7 +47,7 @@
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
ApiClient.getUser(userId).done(function (user) {
ApiClient.getUser(userId).then(function (user) {
saveUser(page, user);
@ -66,7 +66,7 @@
$('.btnSelectSyncPath', page).on('click', function () {
require(['nativedirectorychooser'], function () {
NativeDirectoryChooser.chooseDirectory().done(function (path) {
NativeDirectoryChooser.chooseDirectory().then(function (path) {
$('#txtSyncPath', page).val(path);
});
});
@ -80,7 +80,7 @@
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
ApiClient.getUser(userId).done(function (user) {
ApiClient.getUser(userId).then(function (user) {
loadForm(page, user);
});

View file

@ -37,7 +37,7 @@
return;
}
promise.done(function (summary) {
promise.then(function (summary) {
var item = $('.btnNotificationsInner').removeClass('levelNormal').removeClass('levelWarning').removeClass('levelError').html(summary.UnreadCount);
@ -49,7 +49,7 @@
self.markNotificationsRead = function (ids, callback) {
ApiClient.markNotificationsRead(Dashboard.getCurrentUserId(), ids, true).done(function () {
ApiClient.markNotificationsRead(Dashboard.getCurrentUserId(), ids, true).then(function () {
self.getNotificationsSummaryPromise = null;
@ -75,7 +75,7 @@
var apiClient = window.ApiClient;
if (apiClient) {
return apiClient.getNotifications(Dashboard.getCurrentUserId(), { StartIndex: startIndex, Limit: limit }).done(function (result) {
return apiClient.getNotifications(Dashboard.getCurrentUserId(), { StartIndex: startIndex, Limit: limit }).then(function (result) {
listUnreadNotifications(result.Notifications, result.TotalRecordCount, startIndex, limit, elem, showPaging);

View file

@ -32,7 +32,7 @@
var promise3 = ApiClient.getJSON(ApiClient.getUrl("Notifications/Types"));
var promise4 = ApiClient.getJSON(ApiClient.getUrl("Notifications/Services"));
$.when(promise1, promise2, promise3, promise4).done(function (response1, response2, response3, response4) {
$.when(promise1, promise2, promise3, promise4).then(function (response1, response2, response3, response4) {
var users = response1[0];
var notificationOptions = response2[0];
@ -102,7 +102,7 @@
var promise1 = ApiClient.getNamedConfiguration(notificationsConfigurationKey);
var promise2 = ApiClient.getJSON(ApiClient.getUrl("Notifications/Types"));
$.when(promise1, promise2).done(function (response1, response2) {
$.when(promise1, promise2).then(function (response1, response2) {
var notificationOptions = response1[0];
var types = response2[0];
@ -147,7 +147,7 @@
return c.getAttribute('data-itemid');
});
ApiClient.updateNamedConfiguration(notificationsConfigurationKey, notificationOptions).done(function (r) {
ApiClient.updateNamedConfiguration(notificationsConfigurationKey, notificationOptions).then(function (r) {
Dashboard.navigate('notificationsettings.html');
});

View file

@ -4,7 +4,7 @@
Dashboard.showLoadingMsg();
ApiClient.fetchJSON(ApiClient.getUrl("Notifications/Types")).then(function (list) {
ApiClient.getJSON(ApiClient.getUrl("Notifications/Types")).then(function (list) {
var html = '';

View file

@ -533,7 +533,7 @@
var player = this;
player.getPlayerState().done(function (state) {
player.getPlayerState().then(function (state) {
if (player.isDefaultPlayer && state.NowPlayingItem && state.NowPlayingItem.MediaType == 'Video') {
return;
@ -549,7 +549,7 @@
currentPlayer = player;
player.getPlayerState().done(function (state) {
player.getPlayerState().then(function (state) {
if (state.NowPlayingItem) {
player.beginPlayerUpdates();

View file

@ -648,7 +648,7 @@
currentPlayer = player;
player.getPlayerState().done(function (state) {
player.getPlayerState().then(function (state) {
if (state.NowPlayingItem) {
player.beginPlayerUpdates();

View file

@ -154,7 +154,7 @@
index = 0;
}
Dashboard.loadSwipebox().done(function () {
Dashboard.loadSwipebox().then(function () {
$.swipebox(slideshowItems, {
initialIndexOnArray: index,

View file

@ -20,7 +20,7 @@
config.MaxResumePct = $('#txtMaxResumePct', form).val();
config.MinResumeDurationSeconds = $('#txtMinResumeDuration', form).val();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission

View file

@ -41,7 +41,7 @@
query.UserId = Dashboard.getCurrentUserId();
ApiClient.fetchJSON(ApiClient.getUrl('Playlists/' + item.Id + '/Items', query)).then(function (result) {
ApiClient.getJSON(ApiClient.getUrl('Playlists/' + item.Id + '/Items', query)).then(function (result) {
// Scroll back up so they can see the results from the beginning
window.scrollTo(0, 0);
@ -142,11 +142,11 @@
type: 'POST'
}).done(function () {
}).then(function () {
Dashboard.hideLoadingMsg();
}).fail(function () {
}, function () {
Dashboard.hideLoadingMsg();
reloadItems(page, item);
@ -163,7 +163,7 @@
type: 'DELETE'
}).done(function () {
}).then(function () {
reloadItems(page, item);
});

View file

@ -22,7 +22,7 @@
var promise2 = ApiClient.getInstalledPlugins();
$.when(promise1, promise2).done(function (response1, response2) {
$.when(promise1, promise2).then(function (response1, response2) {
populateList({

View file

@ -9,7 +9,7 @@
if (result) {
Dashboard.showLoadingMsg();
ApiClient.uninstallPlugin(uniqueid).done(function () {
ApiClient.uninstallPlugin(uniqueid).then(function () {
reloadList(page);
});
@ -110,7 +110,7 @@
function renderPlugins(page, plugins, showNoPluginsMessage) {
ApiClient.fetchJSON(ApiClient.getUrl("dashboard/configurationpages") + "?pageType=PluginConfiguration").then(function (configPages) {
ApiClient.getJSON(ApiClient.getUrl("dashboard/configurationpages") + "?pageType=PluginConfiguration").then(function (configPages) {
populateList(page, plugins, configPages, showNoPluginsMessage);
@ -213,7 +213,7 @@
Dashboard.showLoadingMsg();
ApiClient.getInstalledPlugins().done(function (plugins) {
ApiClient.getInstalledPlugins().then(function (plugins) {
renderPlugins(page, plugins, true);
});

View file

@ -131,7 +131,7 @@
function loadFilters(page, userId, itemQuery, reloadItemsFn) {
return ApiClient.fetchJSON(ApiClient.getUrl('Items/Filters', {
return ApiClient.getJSON(ApiClient.getUrl('Items/Filters', {
UserId: userId,
ParentId: itemQuery.ParentId,

View file

@ -101,7 +101,7 @@
Logger.log(review);
dialog.close();
ApiClient.createPackageReview(review).done(function () {
ApiClient.createPackageReview(review).then(function () {
Dashboard.alert({
message: Globalize.translate('MessageThankYouForYourReview'),
title: Globalize.translate('HeaderThankYou')

View file

@ -4,7 +4,7 @@
function validatePlayback(deferred) {
Dashboard.getPluginSecurityInfo().done(function (pluginSecurityInfo) {
Dashboard.getPluginSecurityInfo().then(function (pluginSecurityInfo) {
if (pluginSecurityInfo.IsMBSupporter) {
deferred.resolve();
@ -138,7 +138,7 @@
function validateSync(deferred) {
Dashboard.getPluginSecurityInfo().done(function (pluginSecurityInfo) {
Dashboard.getPluginSecurityInfo().then(function (pluginSecurityInfo) {
if (pluginSecurityInfo.IsMBSupporter) {
deferred.resolve();
@ -147,7 +147,7 @@
Dashboard.showLoadingMsg();
ApiClient.getRegistrationInfo('Sync').done(function (registrationInfo) {
ApiClient.getRegistrationInfo('Sync').then(function (registrationInfo) {
Dashboard.hideLoadingMsg();
@ -161,7 +161,7 @@
title: Globalize.translate('HeaderSync')
});
}).fail(function () {
}, function () {
Dashboard.hideLoadingMsg();

View file

@ -172,7 +172,7 @@
var apiClient = window.ApiClient;
if (apiClient) {
apiClient.getSessions().done(function (sessions) {
apiClient.getSessions().then(function (sessions) {
var currentTargetId = MediaController.getPlayerInfo().id;
@ -203,7 +203,7 @@
var apiClient = window.ApiClient;
if (apiClient) {
apiClient.getSessions().done(processUpdatedSessions);
apiClient.getSessions().then(processUpdatedSessions);
}
}
}
@ -272,7 +272,7 @@
var apiClient = window.ApiClient;
if (apiClient) {
apiClient.getSessions(sessionQuery).done(function (sessions) {
apiClient.getSessions(sessionQuery).then(function (sessions) {
var targets = sessions.filter(function (s) {
@ -293,10 +293,11 @@
deferred.resolveWith(null, [targets]);
}).fail(function () {
}, function () {
deferred.reject();
});
} else {
deferred.resolveWith(null, []);
}

View file

@ -274,7 +274,7 @@
var url = "";
url = ApiClient.getUrl("Reports/Headers", query);
ApiClient.fetchJSON(url).then(function (result) {
ApiClient.getJSON(url).then(function (result) {
var selected = "None";
$('#selectReportGroup', page).find('option').remove().end();
@ -438,7 +438,7 @@
break;
}
ApiClient.fetchJSON(url).then(function (result) {
ApiClient.getJSON(url).then(function (result) {
updateFilterControls(page);
renderItems(page, result);
});
@ -1029,7 +1029,7 @@
function loadFilters(page, userId, itemQuery, reloadItemsFn) {
return ApiClient.fetchJSON(ApiClient.getUrl('Items/Filters', {
return ApiClient.getJSON(ApiClient.getUrl('Items/Filters', {
UserId: userId,
ParentId: itemQuery.ParentId,
@ -1047,7 +1047,7 @@
function loadColumns(page, userId, itemQuery, reloadItemsFn) {
return ApiClient.fetchJSON(ApiClient.getUrl('Reports/Headers', {
return ApiClient.getJSON(ApiClient.getUrl('Reports/Headers', {
UserId: userId,
IncludeItemTypes: itemQuery.IncludeItemTypes,

Some files were not shown because too many files have changed in this diff Show more