mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
make metadata path configurable
This commit is contained in:
parent
3caaa0fbc2
commit
a41f301fe2
@ -11,6 +11,7 @@
|
||||
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="#" data-role="button" class="ui-btn-active">General</a>
|
||||
<a href="advancedpaths.html" data-role="button">Paths</a>
|
||||
<a href="advancedserversettings.html" data-role="button">Server</a>
|
||||
<a href="encodingsettings.html" data-role="button">Transcoding</a>
|
||||
</div>
|
||||
@ -50,25 +51,8 @@
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<h2>Cache Path</h2>
|
||||
<br />
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<input type="checkbox" id="chkEnableCustomCachePath" name="chkEnableCustomCachePath" data-mini="true" />
|
||||
<label for="chkEnableCustomCachePath">Use custom server cache path</label>
|
||||
<div class="fieldDescription">
|
||||
This folder contains server cache files, such as images.
|
||||
</div>
|
||||
</li>
|
||||
<li id="fldEnterCachePath" style="display: none;">
|
||||
<label for="txtCachePath">Server cache path: </label>
|
||||
<div style="display: inline-block; width: 92%;">
|
||||
<input type="text" id="txtCachePath" name="txtCachePath" data-mini="true" />
|
||||
</div>
|
||||
<button id="btnSelectCachePath" type="button" data-icon="search" data-iconpos="notext" data-inline="true">Select Directory</button>
|
||||
<div class="fieldDescription">
|
||||
Supply a custom cache path. Media Browser Server must have write access to this folder. The location of this folder will directly impact server performance and should ideally be placed on a solid state drive.
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
|
||||
Save
|
||||
|
79
dashboard-ui/advancedpaths.html
Normal file
79
dashboard-ui/advancedpaths.html
Normal file
@ -0,0 +1,79 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Advanced</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="advancedPathsPage" data-role="page" class="page type-interior advancedConfigurationPage">
|
||||
|
||||
<div data-role="content">
|
||||
<div class="content-primary">
|
||||
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="advanced.html" data-role="button">General</a>
|
||||
<a href="#" data-role="button" class="ui-btn-active">Paths</a>
|
||||
<a href="advancedserversettings.html" data-role="button">Server</a>
|
||||
<a href="encodingsettings.html" data-role="button">Transcoding</a>
|
||||
</div>
|
||||
<form class="advancedPathsForm">
|
||||
|
||||
<p>Specify custom paths where desired. Leave fields empty to use the defaults.</p>
|
||||
<br />
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<label for="txtCachePath">Cache path: </label>
|
||||
<div style="display: inline-block; width: 92%;">
|
||||
<input type="text" id="txtCachePath" name="txtCachePath" data-mini="true" />
|
||||
</div>
|
||||
<button id="btnSelectCachePath" type="button" data-icon="search" data-iconpos="notext" data-inline="true">Select Directory</button>
|
||||
<div class="fieldDescription">This folder contains server cache files, such as images.</div>
|
||||
</li>
|
||||
<li>
|
||||
<label for="txtItemsByNamePath">Images by name path: </label>
|
||||
<div style="display: inline-block; width: 92%;">
|
||||
<input type="text" id="txtItemsByNamePath" name="txtItemsByNamePath" />
|
||||
</div>
|
||||
<button id="btnSelectIBNPath" type="button" data-icon="search" data-iconpos="notext" data-inline="true">Select Directory</button>
|
||||
<div class="fieldDescription">This folder contains actor, artist, genre and studio images.</div>
|
||||
</li>
|
||||
<li>
|
||||
<label for="txtMetadataPath">Metadata path: </label>
|
||||
<div style="display: inline-block; width: 92%;">
|
||||
<input type="text" id="txtMetadataPath" name="txtMetadataPath" />
|
||||
</div>
|
||||
<button id="btnSelectMetadataPath" type="button" data-icon="search" data-iconpos="notext" data-inline="true">Select Directory</button>
|
||||
<div class="fieldDescription">This location contains downloaded artwork and metadata that is not configured to be stored in media folders.</div>
|
||||
</li>
|
||||
<li>
|
||||
<label for="txtTranscodingTempPath">Transcoding temporary path: </label>
|
||||
<div style="display: inline-block; width: 92%;">
|
||||
<input type="text" id="txtTranscodingTempPath" name="txtTranscodingTempPath" data-mini="true" />
|
||||
</div>
|
||||
<button id="btnSelectTranscodingTempPath" type="button" data-icon="search" data-iconpos="notext" data-inline="true">Select Directory</button>
|
||||
<div class="fieldDescription">
|
||||
This folder contains working files used by the transcoder.
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<br />
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
|
||||
Save
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete" data-mini="true">
|
||||
Cancel
|
||||
</button>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('.advancedPathsForm').off('submit', AdvancedPathsPage.onSubmit).on('submit', AdvancedPathsPage.onSubmit);
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -11,6 +11,7 @@
|
||||
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="advanced.html" data-role="button">General</a>
|
||||
<a href="advancedpaths.html" data-role="button">Paths</a>
|
||||
<a href="#" data-role="button" class="ui-btn-active">Server</a>
|
||||
<a href="encodingsettings.html" data-role="button">Transcoding</a>
|
||||
</div>
|
||||
|
@ -72,9 +72,6 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$('.collectionItemSearchForm').off('submit', EditCollectionItemsPage.onSearchFormSubmit).on('submit', EditCollectionItemsPage.onSearchFormSubmit);
|
||||
$("body").on("popupafteropen", ".popupIdentify", function (e) {
|
||||
$("#txtLookupName").focus().select();
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="advanced.html" data-role="button">General</a>
|
||||
<a href="advancedpaths.html" data-role="button">Paths</a>
|
||||
<a href="advancedserversettings.html" data-role="button">Server</a>
|
||||
<a href="#" data-role="button" class="ui-btn-active">Transcoding</a>
|
||||
</div>
|
||||
@ -51,25 +52,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2>Transcoding Temporary Path</h2>
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<input type="checkbox" id="chkEnableCustomTranscodingTempPath" name="chkEnableCustomTranscodingTempPath" data-mini="true" />
|
||||
<label for="chkEnableCustomTranscodingTempPath">Use custom transcoding temporary path</label>
|
||||
<div class="fieldDescription">
|
||||
This folder contains working files used by the transcoder.
|
||||
</div>
|
||||
</li>
|
||||
<li id="fldEnterTranscodingTempPath" style="display: none;">
|
||||
<label for="txtTranscodingTempPath">Transcoding temporary path: </label>
|
||||
<div style="display: inline-block; width: 92%;">
|
||||
<input type="text" id="txtTranscodingTempPath" name="txtTranscodingTempPath" data-mini="true" />
|
||||
</div>
|
||||
<button id="btnSelectTranscodingTempPath" type="button" data-icon="search" data-iconpos="notext" data-inline="true">Select Directory</button>
|
||||
<div class="fieldDescription">
|
||||
Supply a custom transcoding temporary path. Media Browser Server must have write access to this folder.
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
|
||||
Save
|
||||
|
@ -24,23 +24,6 @@
|
||||
Changes will be processed immediately, on supported file systems.
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<input type="checkbox" id="chkEnableCustomIBNPath" name="chkEnableCustomIBNPath" />
|
||||
<label for="chkEnableCustomIBNPath">Use custom images by name path</label>
|
||||
<div class="fieldDescription">
|
||||
This folder contains actor, artist, genre and studio images.
|
||||
</div>
|
||||
</li>
|
||||
<li id="fieldEnterIBNPath" style="display: none;">
|
||||
<label for="txtItemsByNamePath">Images by name path: </label>
|
||||
<div style="display: inline-block; width: 92%;">
|
||||
<input type="text" id="txtItemsByNamePath" name="txtItemsByNamePath" />
|
||||
</div>
|
||||
<button id="btnSelectIBNPath" type="button" data-icon="search" data-iconpos="notext" data-inline="true">Select Directory</button>
|
||||
<div class="fieldDescription">
|
||||
Supply a custom path for images by name. MB server must have write access to this folder.
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<label for="txtSeasonZeroName">Season 0 display name: </label>
|
||||
<input type="text" id="txtSeasonZeroName" name="txtSeasonZeroName" required="required" />
|
||||
|
@ -28,20 +28,6 @@
|
||||
|
||||
$('#chkRunAtStartup', page).checked(config.RunAtStartup).checkboxradio("refresh");
|
||||
|
||||
|
||||
$('#txtCachePath', page).val(config.CachePath || '');
|
||||
|
||||
var customCachePath = config.CachePath ? true : false;
|
||||
$('#chkEnableCustomCachePath', page).checked(customCachePath).checkboxradio("refresh");
|
||||
|
||||
if (customCachePath) {
|
||||
$('#fldEnterCachePath', page).show();
|
||||
$('#txtCachePath', page).attr("required", "required");
|
||||
} else {
|
||||
$('#fldEnterCachePath', page).hide();
|
||||
$('#txtCachePath', page).removeAttr("required");
|
||||
}
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
@ -61,45 +47,6 @@
|
||||
|
||||
});
|
||||
|
||||
$('#btnSelectCachePath', page).on("click.selectDirectory", function () {
|
||||
|
||||
var picker = new DirectoryBrowser(page);
|
||||
|
||||
picker.show({
|
||||
|
||||
callback: function (path) {
|
||||
|
||||
if (path) {
|
||||
$('#txtCachePath', page).val(path);
|
||||
}
|
||||
picker.close();
|
||||
},
|
||||
|
||||
header: "Select Server Cache Path",
|
||||
|
||||
instruction: "Browse or enter the path to use for Media Browser Server cache. The folder must be writeable. The location of this folder will directly impact server performance and should ideally be placed on a solid state drive."
|
||||
});
|
||||
});
|
||||
|
||||
$('#chkEnableCustomCachePath', page).on("change.showCachePathText", function () {
|
||||
|
||||
if (this.checked) {
|
||||
$('#fldEnterCachePath', page).show();
|
||||
$('#txtCachePath', page).attr("required", "required");
|
||||
} else {
|
||||
$('#fldEnterCachePath', page).hide();
|
||||
$('#txtCachePath', page).removeAttr("required");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}).on('pagehide', "#advancedConfigurationPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#chkEnableCustomCachePath', page).off("change.showCachePathText");
|
||||
$('#btnSelectCachePath', page).off("click.selectDirectory");
|
||||
|
||||
}).on('pageinit', "#advancedConfigurationPage", function () {
|
||||
|
||||
var page = this;
|
||||
@ -127,12 +74,6 @@
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
if ($('#chkEnableCustomCachePath', form).checked()) {
|
||||
config.CachePath = $('#txtCachePath', form).val();
|
||||
} else {
|
||||
config.CachePath = '';
|
||||
}
|
||||
|
||||
config.EnableDebugLevelLogging = $('#chkDebugLog', form).checked();
|
||||
|
||||
config.RunAtStartup = $('#chkRunAtStartup', form).checked();
|
||||
|
134
dashboard-ui/scripts/advancedpaths.js
Normal file
134
dashboard-ui/scripts/advancedpaths.js
Normal file
@ -0,0 +1,134 @@
|
||||
(function ($, document, window) {
|
||||
|
||||
function loadPage(page, config) {
|
||||
|
||||
$('#txtCachePath', page).val(config.CachePath || '');
|
||||
$('#txtTranscodingTempPath', page).val(config.TranscodingTempPath || '');
|
||||
$('#txtItemsByNamePath', page).val(config.ItemsByNamePath || '');
|
||||
$('#txtMetadataPath', page).val(config.MetadataPath || '');
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageshow', "#advancedPathsPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
loadPage(page, config);
|
||||
|
||||
});
|
||||
|
||||
}).on('pageinit', "#advancedPathsPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#btnSelectCachePath', page).on("click.selectDirectory", function () {
|
||||
|
||||
var picker = new DirectoryBrowser(page);
|
||||
|
||||
picker.show({
|
||||
|
||||
callback: function (path) {
|
||||
|
||||
if (path) {
|
||||
$('#txtCachePath', page).val(path);
|
||||
}
|
||||
picker.close();
|
||||
},
|
||||
|
||||
header: "Select Server Cache Path",
|
||||
|
||||
instruction: "Browse or enter the path to use for Media Browser Server cache. The folder must be writeable. The location of this folder will directly impact server performance and should ideally be placed on a solid state drive."
|
||||
});
|
||||
});
|
||||
|
||||
$('#btnSelectTranscodingTempPath', page).on("click.selectDirectory", function () {
|
||||
|
||||
var picker = new DirectoryBrowser(page);
|
||||
|
||||
picker.show({
|
||||
|
||||
callback: function (path) {
|
||||
|
||||
if (path) {
|
||||
$('#txtTranscodingTempPath', page).val(path);
|
||||
}
|
||||
picker.close();
|
||||
},
|
||||
|
||||
header: "Select Transcoding Temporary Path",
|
||||
|
||||
instruction: "Browse or enter the path to use for transcoding temporary files. The folder must be writeable."
|
||||
});
|
||||
});
|
||||
|
||||
$('#btnSelectIBNPath', page).on("click.selectDirectory", function () {
|
||||
|
||||
var picker = new DirectoryBrowser(page);
|
||||
|
||||
picker.show({
|
||||
|
||||
callback: function (path) {
|
||||
|
||||
if (path) {
|
||||
$('#txtItemsByNamePath', page).val(path);
|
||||
}
|
||||
picker.close();
|
||||
},
|
||||
|
||||
header: "Select Images By Name Path",
|
||||
|
||||
instruction: "Browse or enter the path to your items by name folder. The folder must be writeable."
|
||||
});
|
||||
});
|
||||
|
||||
$('#btnSelectMetadataPath', page).on("click.selectDirectory", function () {
|
||||
|
||||
var picker = new DirectoryBrowser(page);
|
||||
|
||||
picker.show({
|
||||
|
||||
callback: function (path) {
|
||||
|
||||
if (path) {
|
||||
$('#txtMetadataPath', page).val(path);
|
||||
}
|
||||
picker.close();
|
||||
},
|
||||
|
||||
header: "Select Metadata Path",
|
||||
|
||||
instruction: "Browse or enter the path you'd like to store metadata within. The folder must be writeable."
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
window.AdvancedPathsPage = {
|
||||
|
||||
onSubmit: function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
config.CachePath = $('#txtCachePath', form).val();
|
||||
config.TranscodingTempPath = $('#txtTranscodingTempPath', form).val();
|
||||
config.ItemsByNamePath = $('#txtItemsByNamePath', form).val();
|
||||
config.MetadataPath = $('#txtMetadataPath', form).val();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery, document, window);
|
@ -11,7 +11,11 @@
|
||||
Dashboard.showLoadingMsg();
|
||||
DashboardPage.pollForInfo(page);
|
||||
DashboardPage.startInterval();
|
||||
$(ApiClient).on("websocketmessage", DashboardPage.onWebSocketMessage).on("websocketopen", DashboardPage.onWebSocketConnectionChange).on("websocketerror", DashboardPage.onWebSocketConnectionChange).on("websocketclose", DashboardPage.onWebSocketConnectionChange);
|
||||
|
||||
$(ApiClient).on("websocketmessage", DashboardPage.onWebSocketMessage)
|
||||
.on("websocketopen", DashboardPage.onWebSocketConnectionChange)
|
||||
.on("websocketerror", DashboardPage.onWebSocketConnectionChange)
|
||||
.on("websocketclose", DashboardPage.onWebSocketConnectionChange);
|
||||
|
||||
DashboardPage.lastAppUpdateCheck = null;
|
||||
DashboardPage.lastPluginUpdateCheck = null;
|
||||
@ -26,9 +30,47 @@
|
||||
|
||||
});
|
||||
|
||||
DashboardPage.reloadSystemInfo(page);
|
||||
DashboardPage.reloadNews(page);
|
||||
},
|
||||
|
||||
reloadSystemInfo: function (page) {
|
||||
|
||||
ApiClient.getSystemInfo().done(function (systemInfo) {
|
||||
|
||||
Dashboard.updateSystemInfo(systemInfo);
|
||||
|
||||
$('#appVersionNumber', page).html(systemInfo.Version);
|
||||
|
||||
var port = systemInfo.HttpServerPortNumber;
|
||||
|
||||
if (port == systemInfo.WebSocketPortNumber) {
|
||||
$('#ports', page).html('Running on port <b>' + port + '</b>');
|
||||
} else {
|
||||
$('#ports', page).html('Running on ports <b>' + port + '</b> and <b>' + systemInfo.WebSocketPortNumber + '</b>');
|
||||
}
|
||||
|
||||
if (systemInfo.CanSelfRestart) {
|
||||
$('.btnRestartContainer', page).removeClass('hide');
|
||||
} else {
|
||||
$('.btnRestartContainer', page).addClass('hide');
|
||||
}
|
||||
|
||||
DashboardPage.renderUrls(page, systemInfo);
|
||||
DashboardPage.renderPendingInstallations(page, systemInfo);
|
||||
|
||||
if (systemInfo.CanSelfUpdate) {
|
||||
$('#btnUpdateApplicationContainer', page).show();
|
||||
$('#btnManualUpdateContainer', page).hide();
|
||||
} else {
|
||||
$('#btnUpdateApplicationContainer', page).hide();
|
||||
$('#btnManualUpdateContainer', page).show();
|
||||
}
|
||||
|
||||
DashboardPage.renderHasPendingRestart(page, systemInfo.HasPendingRestart);
|
||||
});
|
||||
},
|
||||
|
||||
reloadNews: function (page) {
|
||||
|
||||
var query = {
|
||||
@ -85,14 +127,16 @@
|
||||
startInterval: function () {
|
||||
|
||||
if (ApiClient.isWebSocketOpen()) {
|
||||
ApiClient.sendWebSocketMessage("DashboardInfoStart", "0,1500");
|
||||
ApiClient.sendWebSocketMessage("SessionsStart", "0,1500");
|
||||
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStart", "0,1500");
|
||||
}
|
||||
},
|
||||
|
||||
stopInterval: function () {
|
||||
|
||||
if (ApiClient.isWebSocketOpen()) {
|
||||
ApiClient.sendWebSocketMessage("DashboardInfoStop");
|
||||
ApiClient.sendWebSocketMessage("SessionsStop");
|
||||
ApiClient.sendWebSocketMessage("ScheduledTasksInfoStop");
|
||||
}
|
||||
},
|
||||
|
||||
@ -100,9 +144,24 @@
|
||||
|
||||
var page = $.mobile.activePage;
|
||||
|
||||
if (msg.MessageType == "DashboardInfo") {
|
||||
if (msg.MessageType == "Sessions") {
|
||||
DashboardPage.renderInfo(page, msg.Data);
|
||||
}
|
||||
else if (msg.MessageType == "RestartRequired") {
|
||||
DashboardPage.renderHasPendingRestart(page, true);
|
||||
}
|
||||
else if (msg.MessageType == "ServerShuttingDown") {
|
||||
DashboardPage.renderHasPendingRestart(page, false);
|
||||
}
|
||||
else if (msg.MessageType == "ServerRestarting") {
|
||||
DashboardPage.renderHasPendingRestart(page, false);
|
||||
}
|
||||
else if (msg.MessageType == "ScheduledTasksInfo") {
|
||||
|
||||
var tasks = msg.Data;
|
||||
|
||||
DashboardPage.renderRunningTasks(page, tasks);
|
||||
}
|
||||
},
|
||||
|
||||
onWebSocketConnectionChange: function () {
|
||||
@ -113,25 +172,21 @@
|
||||
|
||||
pollForInfo: function (page) {
|
||||
|
||||
$.getJSON("dashboardInfo").done(function (result) {
|
||||
|
||||
DashboardPage.renderInfo(page, result);
|
||||
ApiClient.getSessions().done(function (sessions) {
|
||||
|
||||
DashboardPage.renderInfo(page, sessions);
|
||||
});
|
||||
},
|
||||
|
||||
renderInfo: function (page, dashboardInfo) {
|
||||
renderInfo: function (page, sessions) {
|
||||
|
||||
DashboardPage.lastDashboardInfo = dashboardInfo;
|
||||
|
||||
DashboardPage.renderRunningTasks(dashboardInfo);
|
||||
DashboardPage.renderSystemInfo(page, dashboardInfo);
|
||||
DashboardPage.renderActiveConnections(page, dashboardInfo);
|
||||
DashboardPage.renderActiveConnections(page, sessions);
|
||||
DashboardPage.renderPluginUpdateInfo(page);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
},
|
||||
|
||||
renderActiveConnections: function (page, dashboardInfo) {
|
||||
renderActiveConnections: function (page, sessions) {
|
||||
|
||||
var html = '';
|
||||
|
||||
@ -141,9 +196,9 @@
|
||||
|
||||
var deviceId = ApiClient.deviceId();
|
||||
|
||||
for (var i = 0, length = dashboardInfo.ActiveConnections.length; i < length; i++) {
|
||||
for (var i = 0, length = sessions.length; i < length; i++) {
|
||||
|
||||
var connection = dashboardInfo.ActiveConnections[i];
|
||||
var connection = sessions[i];
|
||||
|
||||
var rowId = 'trSession' + connection.Id;
|
||||
|
||||
@ -351,23 +406,38 @@
|
||||
return html;
|
||||
},
|
||||
|
||||
renderRunningTasks: function (dashboardInfo) {
|
||||
systemUpdateTaskName: "Check for application updates",
|
||||
|
||||
var page = $.mobile.activePage;
|
||||
renderRunningTasks: function (page, tasks) {
|
||||
|
||||
var html = '';
|
||||
|
||||
if (!dashboardInfo.RunningTasks.length) {
|
||||
tasks = tasks.filter(function (t) {
|
||||
return t.State != 'Idle';
|
||||
});
|
||||
|
||||
if (tasks.filter(function (t) {
|
||||
|
||||
return t.Name == DashboardPage.systemUpdateTaskName;
|
||||
|
||||
}).length) {
|
||||
|
||||
$('#btnUpdateApplication', page).buttonEnabled(false);
|
||||
} else {
|
||||
$('#btnUpdateApplication', page).buttonEnabled(true);
|
||||
}
|
||||
|
||||
if (!tasks.length) {
|
||||
html += '<p>No tasks are currently running.</p>';
|
||||
$('#runningTasksCollapsible', page).hide();
|
||||
} else {
|
||||
$('#runningTasksCollapsible', page).show();
|
||||
}
|
||||
|
||||
for (var i = 0, length = dashboardInfo.RunningTasks.length; i < length; i++) {
|
||||
for (var i = 0, length = tasks.length; i < length; i++) {
|
||||
|
||||
|
||||
var task = dashboardInfo.RunningTasks[i];
|
||||
var task = tasks[i];
|
||||
|
||||
html += '<p>';
|
||||
|
||||
@ -395,43 +465,6 @@
|
||||
$('#divRunningTasks', page).html(html).trigger('create');
|
||||
},
|
||||
|
||||
renderSystemInfo: function (page, dashboardInfo) {
|
||||
|
||||
Dashboard.updateSystemInfo(dashboardInfo.SystemInfo);
|
||||
|
||||
$('#appVersionNumber', page).html(dashboardInfo.SystemInfo.Version);
|
||||
|
||||
var port = dashboardInfo.SystemInfo.HttpServerPortNumber;
|
||||
|
||||
if (port == dashboardInfo.SystemInfo.WebSocketPortNumber) {
|
||||
$('#ports', page).html('Running on port <b>' + port + '</b>');
|
||||
} else {
|
||||
$('#ports', page).html('Running on ports <b>' + port + '</b> and <b>' + dashboardInfo.SystemInfo.WebSocketPortNumber + '</b>');
|
||||
}
|
||||
|
||||
if (dashboardInfo.RunningTasks.filter(function (task) {
|
||||
|
||||
return task.Id == dashboardInfo.ApplicationUpdateTaskId;
|
||||
|
||||
}).length) {
|
||||
|
||||
$('#btnUpdateApplication', page).buttonEnabled(false);
|
||||
} else {
|
||||
$('#btnUpdateApplication', page).buttonEnabled(true);
|
||||
}
|
||||
|
||||
if (dashboardInfo.SystemInfo.CanSelfRestart) {
|
||||
$('.btnRestartContainer', page).removeClass('hide');
|
||||
} else {
|
||||
$('.btnRestartContainer', page).addClass('hide');
|
||||
}
|
||||
|
||||
DashboardPage.renderUrls(page, dashboardInfo.SystemInfo);
|
||||
DashboardPage.renderApplicationUpdateInfo(page, dashboardInfo);
|
||||
DashboardPage.renderPluginUpdateInfo(page, dashboardInfo);
|
||||
DashboardPage.renderPendingInstallations(page, dashboardInfo.SystemInfo);
|
||||
},
|
||||
|
||||
renderUrls: function (page, systemInfo) {
|
||||
|
||||
var url = ApiClient.serverAddress() + "/mediabrowser";
|
||||
@ -448,14 +481,14 @@
|
||||
}
|
||||
},
|
||||
|
||||
renderApplicationUpdateInfo: function (page, dashboardInfo) {
|
||||
renderHasPendingRestart: function (page, hasPendingRestart) {
|
||||
|
||||
$('#updateFail', page).hide();
|
||||
|
||||
if (!dashboardInfo.SystemInfo.HasPendingRestart) {
|
||||
if (!hasPendingRestart) {
|
||||
|
||||
// Only check once every 10 mins
|
||||
if (DashboardPage.lastAppUpdateCheck && (new Date().getTime() - DashboardPage.lastAppUpdateCheck) < 600000) {
|
||||
// Only check once every 30 mins
|
||||
if (DashboardPage.lastAppUpdateCheck && (new Date().getTime() - DashboardPage.lastAppUpdateCheck) < 1800000) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -473,14 +506,6 @@
|
||||
|
||||
$('#pUpdateNow', page).show();
|
||||
|
||||
if (dashboardInfo.SystemInfo.CanSelfUpdate) {
|
||||
$('#btnUpdateApplicationContainer', page).show();
|
||||
$('#btnManualUpdateContainer', page).hide();
|
||||
} else {
|
||||
$('#btnUpdateApplicationContainer', page).hide();
|
||||
$('#btnManualUpdateContainer', page).show();
|
||||
}
|
||||
|
||||
$('#newVersionNumber', page).html("Version " + version.versionStr + " is now available for download.");
|
||||
}
|
||||
|
||||
@ -492,11 +517,7 @@
|
||||
|
||||
} else {
|
||||
|
||||
if (dashboardInfo.SystemInfo.HasPendingRestart) {
|
||||
$('#pUpToDate', page).hide();
|
||||
} else {
|
||||
$('#pUpToDate', page).show();
|
||||
}
|
||||
|
||||
$('#pUpdateNow', page).hide();
|
||||
}
|
||||
@ -526,10 +547,10 @@
|
||||
$('#pendingInstallations', page).html(html);
|
||||
},
|
||||
|
||||
renderPluginUpdateInfo: function (page, dashboardInfo) {
|
||||
renderPluginUpdateInfo: function (page) {
|
||||
|
||||
// Only check once every 10 mins
|
||||
if (DashboardPage.lastPluginUpdateCheck && (new Date().getTime() - DashboardPage.lastPluginUpdateCheck) < 600000) {
|
||||
// Only check once every 30 mins
|
||||
if (DashboardPage.lastPluginUpdateCheck && (new Date().getTime() - DashboardPage.lastPluginUpdateCheck) < 1800000) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -592,12 +613,20 @@
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.startScheduledTask(DashboardPage.lastDashboardInfo.ApplicationUpdateTaskId).done(function () {
|
||||
ApiClient.getScheduledTasks().done(function (tasks) {
|
||||
|
||||
var task = tasks.filter(function (t) {
|
||||
|
||||
return t.Name == DashboardPage.systemUpdateTaskName;
|
||||
});
|
||||
|
||||
ApiClient.startScheduledTask(task.Id).done(function () {
|
||||
|
||||
DashboardPage.pollForInfo(page);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
stopTask: function (id) {
|
||||
|
@ -278,18 +278,24 @@
|
||||
removeItemsFromCollection(page);
|
||||
});
|
||||
|
||||
|
||||
}).on('pagebeforeshow', "#editCollectionTitlesPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
reload(page);
|
||||
|
||||
$("body").on("popupafteropen.collections", ".popupIdentify", function (e) {
|
||||
$("#txtLookupName").focus().select();
|
||||
});
|
||||
|
||||
}).on('pagehide', "#editCollectionTitlesPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
currentItem = null;
|
||||
|
||||
$("body").off("popupafteropen.collections");
|
||||
});
|
||||
|
||||
window.EditCollectionItemsPage = {
|
||||
|
@ -63,19 +63,6 @@
|
||||
|
||||
$('#refreshLoading', page).hide();
|
||||
|
||||
if (item.Type != "TvChannel" &&
|
||||
item.Type != "Genre" &&
|
||||
item.Type != "Studio" &&
|
||||
item.Type != "MusicGenre" &&
|
||||
item.Type != "GameGenre" &&
|
||||
item.Type != "Person" &&
|
||||
item.Type != "MusicArtist" &&
|
||||
item.Type != "CollectionFolder") {
|
||||
$('#fldDelete', page).show();
|
||||
} else {
|
||||
$('#fldDelete', page).hide();
|
||||
}
|
||||
|
||||
LibraryBrowser.renderName(item, $('.itemName', page), true);
|
||||
|
||||
updateTabs(page, item);
|
||||
@ -95,8 +82,26 @@
|
||||
$('#btnEditCollectionTitles', page).hide();
|
||||
}
|
||||
|
||||
Dashboard.getCurrentUser().done(function(user) {
|
||||
|
||||
if (user.Configuration.EnableContentDeletion &&
|
||||
item.Type != "TvChannel" &&
|
||||
item.Type != "Genre" &&
|
||||
item.Type != "Studio" &&
|
||||
item.Type != "MusicGenre" &&
|
||||
item.Type != "GameGenre" &&
|
||||
item.Type != "Person" &&
|
||||
item.Type != "MusicArtist" &&
|
||||
item.Type != "CollectionFolder") {
|
||||
$('#fldDelete', page).show();
|
||||
} else {
|
||||
$('#fldDelete', page).hide();
|
||||
}
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function onExternalIdChange() {
|
||||
|
@ -10,60 +10,12 @@
|
||||
|
||||
}).checkboxradio('refresh');
|
||||
|
||||
$('#txtTranscodingTempPath', page).val(config.TranscodingTempPath || '');
|
||||
|
||||
var transcodingTempPath = config.TranscodingTempPath ? true : false;
|
||||
$('#chkEnableCustomTranscodingTempPath', page).checked(transcodingTempPath).checkboxradio("refresh");
|
||||
|
||||
if (transcodingTempPath) {
|
||||
$('#fldEnterTranscodingTempPath', page).show();
|
||||
$('#txtTranscodingTempPath', page).attr("required", "required");
|
||||
} else {
|
||||
$('#fldEnterTranscodingTempPath', page).hide();
|
||||
$('#txtTranscodingTempPath', page).removeAttr("required");
|
||||
}
|
||||
|
||||
$('#chkAllowUpscaling', page).checked(config.AllowVideoUpscaling).checkboxradio("refresh");
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#encodingSettingsPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#btnSelectTranscodingTempPath', page).on("click.selectDirectory", function () {
|
||||
|
||||
var picker = new DirectoryBrowser(page);
|
||||
|
||||
picker.show({
|
||||
|
||||
callback: function (path) {
|
||||
|
||||
if (path) {
|
||||
$('#txtTranscodingTempPath', page).val(path);
|
||||
}
|
||||
picker.close();
|
||||
},
|
||||
|
||||
header: "Select Transcoding Temporary Path",
|
||||
|
||||
instruction: "Browse or enter the path to use for transcoding temporary files. The folder must be writeable."
|
||||
});
|
||||
});
|
||||
|
||||
$('#chkEnableCustomTranscodingTempPath', page).on("change.showTranscodingTempPathText", function () {
|
||||
|
||||
if (this.checked) {
|
||||
$('#fldEnterTranscodingTempPath', page).show();
|
||||
$('#txtTranscodingTempPath', page).attr("required", "required");
|
||||
} else {
|
||||
$('#fldEnterTranscodingTempPath', page).hide();
|
||||
$('#txtTranscodingTempPath', page).removeAttr("required");
|
||||
}
|
||||
|
||||
});
|
||||
}).on('pageshow', "#encodingSettingsPage", function () {
|
||||
$(document).on('pageshow', "#encodingSettingsPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
@ -86,12 +38,6 @@
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
if ($('#chkEnableCustomTranscodingTempPath', form).checked()) {
|
||||
config.TranscodingTempPath = $('#txtTranscodingTempPath', form).val();
|
||||
} else {
|
||||
config.TranscodingTempPath = '';
|
||||
}
|
||||
|
||||
config.AllowVideoUpscaling = $('#chkAllowUpscaling', form).checked();
|
||||
config.EnableDebugEncodingLogging = $('#chkEnableDebugEncodingLogging', form).checked();
|
||||
config.MediaEncodingQuality = $('.radioEncodingQuality:checked', form).val();
|
||||
|
@ -2,19 +2,6 @@
|
||||
|
||||
function loadPage(page, config) {
|
||||
|
||||
$('#txtItemsByNamePath', page).val(config.ItemsByNamePath || '');
|
||||
|
||||
var customIbn = config.ItemsByNamePath ? true : false;
|
||||
$('#chkEnableCustomIBNPath', page).checked(customIbn).checkboxradio("refresh");
|
||||
|
||||
if (customIbn) {
|
||||
$('#fieldEnterIBNPath', page).show();
|
||||
$('#txtItemsByNamePath', page).attr("required", "required");
|
||||
} else {
|
||||
$('#fieldEnterIBNPath', page).hide();
|
||||
$('#txtItemsByNamePath', page).removeAttr("required");
|
||||
}
|
||||
|
||||
$('#txtSeasonZeroName', page).val(config.SeasonZeroDisplayName);
|
||||
|
||||
$('#chkEnableRealtimeMonitor', page).checked(config.EnableRealtimeMonitor).checkboxradio("refresh");
|
||||
@ -28,50 +15,12 @@
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#btnSelectIBNPath', page).on("click.selectDirectory", function () {
|
||||
|
||||
var picker = new DirectoryBrowser(page);
|
||||
|
||||
picker.show({
|
||||
|
||||
callback: function (path) {
|
||||
|
||||
if (path) {
|
||||
$('#txtItemsByNamePath', page).val(path);
|
||||
}
|
||||
picker.close();
|
||||
},
|
||||
|
||||
header: "Select Images By Name Path",
|
||||
|
||||
instruction: "Browse or enter the path to your items by name folder. The folder must be writeable."
|
||||
});
|
||||
});
|
||||
|
||||
$('#chkEnableCustomIBNPath', page).on("change.showIBNText", function () {
|
||||
|
||||
if (this.checked) {
|
||||
$('#fieldEnterIBNPath', page).show();
|
||||
$('#txtItemsByNamePath', page).attr("required", "required");
|
||||
} else {
|
||||
$('#fieldEnterIBNPath', page).hide();
|
||||
$('#txtItemsByNamePath', page).removeAttr("required");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
loadPage(page, config);
|
||||
|
||||
});
|
||||
|
||||
}).on('pagehide', "#librarySettingsPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#chkEnableCustomIBNPath', page).off("change.showIBNText");
|
||||
$('#btnSelectIBNPath', page).off("click.selectDirectory");
|
||||
});
|
||||
|
||||
function librarySettingsPage() {
|
||||
@ -85,12 +34,6 @@
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
if ($('#chkEnableCustomIBNPath', form).checked()) {
|
||||
config.ItemsByNamePath = $('#txtItemsByNamePath', form).val();
|
||||
} else {
|
||||
config.ItemsByNamePath = '';
|
||||
}
|
||||
|
||||
config.SeasonZeroDisplayName = $('#txtSeasonZeroName', form).val();
|
||||
|
||||
config.EnableRealtimeMonitor = $('#chkEnableRealtimeMonitor', form).checked();
|
||||
|
@ -728,10 +728,6 @@ var Dashboard = {
|
||||
name: "Metadata",
|
||||
href: "metadata.html",
|
||||
selected: pageElem.id == "metadataConfigurationPage" || pageElem.id == "advancedMetadataConfigurationPage" || pageElem.id == "metadataImagesConfigurationPage"
|
||||
}, {
|
||||
name: "Plugins",
|
||||
href: "plugins.html",
|
||||
selected: page.hasClass("pluginConfigurationPage")
|
||||
}, {
|
||||
name: "Auto-Organize",
|
||||
href: "autoorganizelog.html",
|
||||
@ -744,6 +740,10 @@ var Dashboard = {
|
||||
name: "Live TV",
|
||||
href: "livetvstatus.html",
|
||||
selected: page.hasClass("liveTvSettingsPage")
|
||||
}, {
|
||||
name: "Plugins",
|
||||
href: "plugins.html",
|
||||
selected: page.hasClass("pluginConfigurationPage")
|
||||
}, {
|
||||
name: "Users",
|
||||
divider: true,
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
$('#chkManageLiveTv', page).checked(user.Configuration.EnableLiveTvManagement || false).checkboxradio("refresh");
|
||||
$('#chkEnableLiveTvAccess', page).checked(user.Configuration.EnableLiveTvAccess || false).checkboxradio("refresh");
|
||||
$('#chkEnableContentDeletion', page).checked(user.Configuration.EnableContentDeletion || false).checkboxradio("refresh");
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
@ -59,6 +60,7 @@
|
||||
user.Configuration.EnableLiveTvManagement = $('#chkManageLiveTv', page).checked();
|
||||
user.Configuration.EnableMediaPlayback = $('#chkEnableMediaPlayback', page).checked();
|
||||
user.Configuration.EnableLiveTvAccess = $('#chkEnableLiveTvAccess', page).checked();
|
||||
user.Configuration.EnableContentDeletion = $('#chkEnableContentDeletion', page).checked();
|
||||
|
||||
var userId = getParameterByName("userId");
|
||||
|
||||
|
@ -38,7 +38,11 @@
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="chkManageLiveTv" name="chkManageLiveTv" data-mini="true" />
|
||||
<label for="chkManageLiveTv">Allow scheduling of tv recordings</label>
|
||||
<label for="chkManageLiveTv">Allow management of live tv recordings</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="chkEnableContentDeletion" name="chkEnableContentDeletion" data-mini="true" />
|
||||
<label for="chkEnableContentDeletion">Allow this user to delete library content</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="chkEnableRemoteControlOtherUsers" name="chkEnableRemoteControlOtherUsers" data-mini="true" />
|
||||
|
Loading…
Reference in New Issue
Block a user