- If you have an existing Tautulli, PlexWatch, or Plexivity database, you can import the data into Tautulli.
+ If you have an existing Tautulli, PlexWatch, or Plexivity database, you can import the data
+ into Tautulli.
To import a database, navigate to the Settings page
@@ -200,18 +244,23 @@
@@ -243,7 +294,6 @@
function validateAuthentication(el) {
var http_username = $("#http_username").val();
var http_password = $("#http_password").val();
- var valid_authentication = el.val();
var retValue = {};
if (http_username === "" || http_password === "") {
@@ -310,71 +360,73 @@
return $.isNumeric(n) && (Math.floor(n) == n) && (n >= 0)
}
-$(document).ready(function() {
+ $(document).ready(function () {
- $.fn.wizard.logging = false;
- var options = {
- keyboard : false,
- contentHeight : 450,
- contentWidth : 700,
- backdrop: 'static',
- buttons: {submitText: 'Finish'},
- submitUrl: "configUpdate"
- };
- var wizard = $("#setup-wizard").wizard(options);
- wizard.show();
+ $.fn.wizard.logging = false;
+ var options = {
+ keyboard: false,
+ contentHeight: 450,
+ contentWidth: 700,
+ backdrop: 'static',
+ buttons: {submitText: 'Finish'},
+ submitUrl: "configUpdate"
+ };
+ var wizard = $("#setup-wizard").wizard(options);
+ wizard.show();
- // Change button classes
- wizard.find('.wizard-back').addClass('btn-dark');
- wizard.on('incrementCard', function(wizard) {
- wizard.find('.wizard-next.btn-success').removeClass('btn-success').addClass('btn-bright');
- });
- wizard.on('decrementCard', function(wizard) {
- wizard.find('.wizard-next').removeClass('btn-bright').text('Next');
- });
+ // Change button classes
+ wizard.find('.wizard-back').addClass('btn-dark');
+ wizard.on('incrementCard', function (wizard) {
+ wizard.find('.wizard-next.btn-success').removeClass('btn-success').addClass('btn-bright');
+ });
+ wizard.on('decrementCard', function (wizard) {
+ wizard.find('.wizard-next').removeClass('btn-bright').text('Next');
+ });
- wizard.on("submit", function(wizard) {
- // Probably should not success before we know, but hopefully validation is good enough.
- wizard.submitSuccess();
- $.ajax({
- type: "POST",
- url: wizard.args.submitUrl,
- data: wizard.serialize(),
- dataType: "json",
- complete: function (data) {
- $(".countdown").countdown(function () { location.reload(); }, 5, "");
- }
- })
- });
-
- $('.checkbox-toggle').click(function () {
- var configToggle = $(this).data('id');
- if ($(this).is(':checked')) {
- $('#'+configToggle).val(1);
- } else {
- $('#'+configToggle).val(0);
- }
- });
-
- var $select_pms = $('#pms_ip_selectize').selectize({
- createOnBlur: true,
- openOnFocus: true,
- maxItems: 1,
- closeAfterSelect: true,
- sortField: 'label',
- searchField: ['label', 'value'],
- inputClass: 'form-control selectize-input',
- render: {
- item: function (item, escape) {
- if (!item.label) {
- $.extend(item,
- $(this.revertSettings.$children)
- .filter('[value="' + item.value + '"]').data()
- );
+ wizard.on("submit", function (wizard) {
+ // Probably should not success before we know, but hopefully validation is good enough.
+ wizard.submitSuccess();
+ $.ajax({
+ type: "POST",
+ url: wizard.args.submitUrl,
+ data: wizard.serialize(),
+ dataType: "json",
+ complete: function (data) {
+ $(".countdown").countdown(function () {
+ location.reload();
+ }, 5, "");
}
- var label = item.label || item.value;
- var caption = item.label ? item.ip : null;
- return '
' + escape(label) + '' +
(caption ? '' + escape(caption) + '' : '') +
'
';
- },
- option: function (item, escape) {
- var label = item.label || item.value;
- var caption = item.label ? item.value : null;
- return '
' + escape(caption) + '' : '') +
'
';
- }
- },
- create: function(input) {
- return {label: '', value: input};
- },
- onInitialize: function () {
- var s = this;
- this.revertSettings.$children.each(function () {
- $.extend(s.options[this.value], $(this).data());
- });
- },
- onChange: function (item) {
- var pms_ip_selected = this.getItem(item)[0];
- var identifier = $(pms_ip_selected).data('identifier');
- var ip = $(pms_ip_selected).data('ip');
- var port = $(pms_ip_selected).data('port');
- var local = $(pms_ip_selected).data('local');
- var ssl = $(pms_ip_selected).data('ssl');
- var is_cloud = $(pms_ip_selected).data('is_cloud');
- var value = $(pms_ip_selected).data('value');
+ }
+ },
+ create: function (input) {
+ return {label: '', value: input};
+ },
+ onInitialize: function () {
+ var s = this;
+ this.revertSettings.$children.each(function () {
+ $.extend(s.options[this.value], $(this).data());
+ });
+ },
+ onChange: function (item) {
+ var pms_ip_selected = this.getItem(item)[0];
+ var identifier = $(pms_ip_selected).data('identifier');
+ var ip = $(pms_ip_selected).data('ip');
+ var port = $(pms_ip_selected).data('port');
+ var local = $(pms_ip_selected).data('local');
+ var ssl = $(pms_ip_selected).data('ssl');
+ var value = $(pms_ip_selected).data('value');
- $("#pms_valid").val(identifier !== 'undefined' ? 'valid' : '');
- $("#pms-verify-status").html(identifier !== 'undefined' ? '
Server found!' : '').fadeIn('fast');
+ $("#pms_valid").val(identifier !== 'undefined' ? 'valid' : '');
+ $("#pms-verify-status").html(identifier !== 'undefined' ? '
Server found!' : '').fadeIn('fast');
+
+ $("#pms_identifier").val(identifier !== 'undefined' ? identifier : '');
+ $('#pms_ip').val(ip !== 'undefined' ? ip : value);
+ $('#pms_port').val(port !== 'undefined' ? port : 8096);
+ $('#pms_is_remote_checkbox').prop('checked', (local !== 'undefined' && local === 0));
+ $('#pms_is_remote').val(local !== 'undefined' && local === 0 ? 1 : 0);
+ $('#pms_ssl_checkbox').prop('checked', (ssl !== 'undefined' && ssl === 1));
+ $('#pms_ssl').val(ssl !== 'undefined' && ssl === 1 ? 1 : 0);
- $("#pms_identifier").val(identifier !== 'undefined' ? identifier : '');
- $('#pms_ip').val(ip !== 'undefined' ? ip : value);
- $('#pms_port').val(port !== 'undefined' ? port : 32400);
- $('#pms_is_remote_checkbox').prop('checked', (local !== 'undefined' && local === 0));
- $('#pms_is_remote').val(local !== 'undefined' && local === 0 ? 1 : 0);
- $('#pms_ssl_checkbox').prop('checked', (ssl !== 'undefined' && ssl === 1));
- $('#pms_ssl').val(ssl !== 'undefined' && ssl === 1 ? 1 : 0);
- $('#pms_is_cloud').val(is_cloud !== 'undefined' && is_cloud === true ? 1 : 0);
- if (is_cloud === true) {
- $('#pms_port').prop('readonly', true);
- $('#pms_is_remote_checkbox').prop('disabled', true);
- $('#pms_ssl_checkbox').prop('disabled', true);
- } else {
$('#pms_port').prop('readonly', false);
$('#pms_is_remote_checkbox').prop('disabled', false);
$('#pms_ssl_checkbox').prop('disabled', false);
- }
- },
- onDropdownOpen: function() {
- this.clear();
- }
- });
- var select_pms = $select_pms[0].selectize;
-
- function getServerOptions(token) {
- /* Set token and returns server options */
- $.ajax({
- url: 'discover',
- data: {
- token: token
},
- success: function (result) {
- if (result) {
- var existing_ip = $('#pms_ip').val();
- var existing_port = $('#pms_port').val();
- result.forEach(function (item) {
- if (item.ip === existing_ip && item.port === existing_port) {
- select_pms.updateOption(item.value, item);
- } else {
- select_pms.addOption(item);
+ onDropdownOpen: function () {
+ this.clear();
+ }
+ });
+ var select_pms = $select_pms[0].selectize;
+
+ function getServerOptions(token) {
+ /* Set token and returns server options */
+ $.ajax({
+ url: 'discover',
+ data: {
+ token: token
+ },
+ success: function (result) {
+ if (result) {
+ var existing_ip = $('#pms_ip').val();
+ var existing_port = $('#pms_port').val();
+ result.forEach(function (item) {
+ if (item.ip === existing_ip && item.port === existing_port) {
+ select_pms.updateOption(item.value, item);
+ } else {
+ select_pms.addOption(item);
+ }
+ });
+ }
+ }
+ })
+ }
+
+ var pms_verified = false;
+ var authenticated = false;
+
+ $("#verify-plex-server").click(function () {
+ if (!(pms_verified)) {
+ var pms_ip = $("#pms_ip").val().trim();
+ var pms_port = $("#pms_port").val().trim();
+ var pms_identifier = $("#pms_identifier").val();
+ var pms_ssl = $("#pms_ssl").val();
+ var pms_is_remote = $("#pms_is_remote").val();
+ if ((pms_ip !== '') || (pms_port !== '')) {
+ $("#pms-verify-status").html('
Verifying server...');
+ $('#pms-verify-status').fadeIn('fast');
+ $.ajax({
+ url: 'get_server_id',
+ data: {
+ hostname: pms_ip,
+ port: pms_port,
+ identifier: pms_identifier,
+ ssl: pms_ssl,
+ remote: pms_is_remote
+ },
+ cache: true,
+ async: true,
+ timeout: 5000,
+ error: function (jqXHR, textStatus, errorThrown) {
+ $("#pms-verify-status").html('
Error verifying server: ' + textStatus);
+ $('#pms-verify-status').fadeIn('fast');
+ },
+ success: function (xhr, status) {
+ var result = xhr;
+ var identifier = result.identifier;
+ if (identifier) {
+ $("#pms_identifier").val(identifier);
+ $("#pms-verify-status").html('
Server found!');
+ $('#pms-verify-status').fadeIn('fast');
+ pms_verified = true;
+ $("#pms_valid").val("valid");
+ } else {
+ $("#pms-verify-status").html('
This is not a Plex Server!');
+ $('#pms-verify-status').fadeIn('fast');
+ }
}
});
+ } else {
+ $("#pms-verify-status").html('
Please enter both fields.');
+ $('#pms-verify-status').fadeIn('fast');
}
}
- })
- }
- var pms_verified = false;
- var authenticated = false;
+ });
- $("#verify-plex-server").click(function () {
- if (!(pms_verified)) {
- var pms_ip = $("#pms_ip").val().trim();
- var pms_port = $("#pms_port").val().trim();
- var pms_identifier = $("#pms_identifier").val();
- var pms_ssl = $("#pms_ssl").val();
- var pms_is_remote = $("#pms_is_remote").val();
- if ((pms_ip !== '') || (pms_port !== '')) {
- $("#pms-verify-status").html('
Verifying server...');
- $('#pms-verify-status').fadeIn('fast');
- $.ajax({
- url: 'get_server_id',
- data: {
- hostname: pms_ip,
- port: pms_port,
- identifier: pms_identifier,
- ssl: pms_ssl,
- remote: pms_is_remote
- },
- cache: true,
- async: true,
- timeout: 5000,
- error: function (jqXHR, textStatus, errorThrown) {
- $("#pms-verify-status").html('
Error verifying server: ' + textStatus);
- $('#pms-verify-status').fadeIn('fast');
- },
- success: function(xhr, status) {
- var result = xhr;
- var identifier = result.identifier;
- if (identifier) {
- $("#pms_identifier").val(identifier);
- $("#pms-verify-status").html('
Server found!');
- $('#pms-verify-status').fadeIn('fast');
- pms_verified = true;
- $("#pms_valid").val("valid");
- } else {
- $("#pms-verify-status").html('
This is not a Plex Server!');
- $('#pms-verify-status').fadeIn('fast');
- }
- }
- });
- } else {
- $("#pms-verify-status").html('
Please enter both fields.');
- $('#pms-verify-status').fadeIn('fast');
- }
- }
+ $(".pms-settings").change(function () {
+ pms_verified = false;
+ $("#pms_valid").val("");
+ $("#pms-verify-status").html("");
+ });
});
-
- $( ".pms-settings" ).change(function() {
- pms_verified = false;
- $("#pms_valid").val("");
- $("#pms-verify-status").html("");
- });
-
- function OAuthPreFunction() {
- $("#pms_token").val('');
- $("#pms-token-status").html('
Waiting for authentication...').fadeIn('fast');
- }
- function OAuthSuccessCallback(authToken) {
- $("#pms_token").val(authToken);
- $("#pms-token-status").html('
Authentication successful.').fadeIn('fast');
- authenticated = true;
- getServerOptions(authToken);
- }
- function OAuthErrorCallback() {
- $("#pms-token-status").html('
Error communicating with Plex.tv.').fadeIn('fast');
- }
-
- $('#sign-in-plex').click(function() {
- PlexOAuth(OAuthSuccessCallback, OAuthErrorCallback, OAuthPreFunction);
- });
-});