mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
move metadata language to per library
This commit is contained in:
parent
60f00b55e9
commit
befa669bc5
@ -1,6 +1,44 @@
|
||||
define(['globalize', 'emby-checkbox'], function (globalize) {
|
||||
define(['globalize', 'emby-checkbox', 'emby-select'], function (globalize) {
|
||||
'use strict';
|
||||
|
||||
function populateLanguages(select) {
|
||||
|
||||
return ApiClient.getCultures().then(function (languages) {
|
||||
|
||||
var html = "";
|
||||
|
||||
html += "<option value=''></option>";
|
||||
|
||||
for (var i = 0, length = languages.length; i < length; i++) {
|
||||
|
||||
var culture = languages[i];
|
||||
|
||||
html += "<option value='" + culture.TwoLetterISOLanguageName + "'>" + culture.DisplayName + "</option>";
|
||||
}
|
||||
|
||||
select.innerHTML = html;
|
||||
});
|
||||
}
|
||||
|
||||
function populateCountries(select) {
|
||||
|
||||
return ApiClient.getCountries().then(function (allCountries) {
|
||||
|
||||
var html = "";
|
||||
|
||||
html += "<option value=''></option>";
|
||||
|
||||
for (var i = 0, length = allCountries.length; i < length; i++) {
|
||||
|
||||
var culture = allCountries[i];
|
||||
|
||||
html += "<option value='" + culture.TwoLetterISORegionName + "'>" + culture.DisplayName + "</option>";
|
||||
}
|
||||
|
||||
select.innerHTML = html;
|
||||
});
|
||||
}
|
||||
|
||||
function embed(parent, contentType, libraryOptions) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
@ -13,13 +51,21 @@
|
||||
var template = this.response;
|
||||
parent.innerHTML = globalize.translateDocument(template);
|
||||
|
||||
setContentType(parent, contentType);
|
||||
var promises = [
|
||||
populateLanguages(parent.querySelector('#selectLanguage')),
|
||||
populateCountries(parent.querySelector('#selectCountry'))
|
||||
];
|
||||
|
||||
if (libraryOptions) {
|
||||
setLibraryOptions(parent, libraryOptions);
|
||||
}
|
||||
Promise.all(promises).then(function () {
|
||||
|
||||
resolve();
|
||||
setContentType(parent, contentType);
|
||||
|
||||
if (libraryOptions) {
|
||||
setLibraryOptions(parent, libraryOptions);
|
||||
}
|
||||
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
xhr.send();
|
||||
@ -28,20 +74,18 @@
|
||||
|
||||
function setContentType(parent, contentType) {
|
||||
|
||||
if (contentType == 'music' || contentType == 'tvshows' || contentType == 'movies' || contentType == 'homevideos' || contentType == 'musicvideos' || contentType == 'mixed' || !contentType) {
|
||||
parent.querySelector('.chkArhiveAsMediaContainer').classList.add('hide');
|
||||
} else {
|
||||
parent.querySelector('.chkArhiveAsMediaContainer').classList.add('hide');
|
||||
}
|
||||
|
||||
if (contentType == 'homevideos' || contentType == 'photos') {
|
||||
parent.querySelector('.chkEnablePhotosContainer').classList.remove('hide');
|
||||
parent.querySelector('.chkDownloadImagesInAdvanceContainer').classList.add('hide');
|
||||
parent.querySelector('.chkEnableInternetProvidersContainer').classList.add('hide');
|
||||
parent.querySelector('.fldMetadataLanguage').classList.add('hide');
|
||||
parent.querySelector('.fldMetadataCountry').classList.add('hide');
|
||||
} else {
|
||||
parent.querySelector('.chkEnablePhotosContainer').classList.add('hide');
|
||||
parent.querySelector('.chkDownloadImagesInAdvanceContainer').classList.remove('hide');
|
||||
parent.querySelector('.chkEnableInternetProvidersContainer').classList.remove('hide');
|
||||
parent.querySelector('.fldMetadataLanguage').classList.remove('hide');
|
||||
parent.querySelector('.fldMetadataCountry').classList.remove('hide');
|
||||
}
|
||||
|
||||
if (contentType == 'photos') {
|
||||
@ -51,11 +95,9 @@
|
||||
}
|
||||
|
||||
if (contentType == 'tvshows' || contentType == 'movies' || contentType == 'homevideos' || contentType == 'musicvideos' || contentType == 'mixed' || !contentType) {
|
||||
parent.querySelector('.fldExtractChaptersDuringLibraryScan').classList.remove('hide');
|
||||
parent.querySelector('.fldExtractChapterImages').classList.remove('hide');
|
||||
parent.querySelector('.chapterSettingsSection').classList.remove('hide');
|
||||
} else {
|
||||
parent.querySelector('.fldExtractChaptersDuringLibraryScan').classList.add('hide');
|
||||
parent.querySelector('.fldExtractChapterImages').classList.add('hide');
|
||||
parent.querySelector('.chapterSettingsSection').classList.add('hide');
|
||||
}
|
||||
|
||||
if (contentType == 'tvshows') {
|
||||
@ -70,7 +112,7 @@
|
||||
function getLibraryOptions(parent) {
|
||||
|
||||
var options = {
|
||||
EnableArchiveMediaFiles: parent.querySelector('.chkArhiveAsMedia').checked,
|
||||
EnableArchiveMediaFiles: false,
|
||||
EnablePhotos: parent.querySelector('.chkEnablePhotos').checked,
|
||||
EnableRealtimeMonitor: parent.querySelector('.chkEnableRealtimeMonitor').checked,
|
||||
ExtractChapterImagesDuringLibraryScan: parent.querySelector('.chkExtractChaptersDuringLibraryScan').checked,
|
||||
@ -79,7 +121,9 @@
|
||||
EnableInternetProviders: parent.querySelector('#chkEnableInternetProviders').checked,
|
||||
ImportMissingEpisodes: parent.querySelector('#chkImportMissingEpisodes').checked,
|
||||
SaveLocalMetadata: parent.querySelector('#chkSaveLocal').checked,
|
||||
EnableAutomaticSeriesGrouping: parent.querySelector('.chkAutomaticallyGroupSeries').checked
|
||||
EnableAutomaticSeriesGrouping: parent.querySelector('.chkAutomaticallyGroupSeries').checked,
|
||||
PreferredMetadataLanguage: parent.querySelector('#selectLanguage').value,
|
||||
MetadataCountryCode: parent.querySelector('#selectCountry').value
|
||||
};
|
||||
|
||||
return options;
|
||||
@ -87,7 +131,9 @@
|
||||
|
||||
function setLibraryOptions(parent, options) {
|
||||
|
||||
parent.querySelector('.chkArhiveAsMedia').checked = options.EnableArchiveMediaFiles;
|
||||
parent.querySelector('#selectLanguage').value = options.PreferredMetadataLanguage || '';
|
||||
parent.querySelector('#selectCountry').value = options.MetadataCountryCode || '';
|
||||
|
||||
parent.querySelector('.chkEnablePhotos').checked = options.EnablePhotos;
|
||||
parent.querySelector('.chkEnableRealtimeMonitor').checked = options.EnableRealtimeMonitor;
|
||||
parent.querySelector('.chkExtractChaptersDuringLibraryScan').checked = options.ExtractChapterImagesDuringLibraryScan;
|
||||
|
@ -1,4 +1,4 @@
|
||||
<h1>${HeaderSettings}</h1>
|
||||
<h1>${HeaderLibrarySettings}</h1>
|
||||
<div class="checkboxContainer checkboxContainer-withDescription chkEnableInternetProvidersContainer hide">
|
||||
<label>
|
||||
<input is="emby-checkbox" type="checkbox" id="chkEnableInternetProviders" checked />
|
||||
@ -6,6 +6,12 @@
|
||||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">${LabelDownloadInternetMetadataHelp}</div>
|
||||
</div>
|
||||
<div class="selectContainer fldMetadataLanguage hide" style="margin-top:3em;">
|
||||
<select is="emby-select" id="selectLanguage" label="${LabelMetadataDownloadLanguage}" required="required"></select>
|
||||
</div>
|
||||
<div class="selectContainer fldMetadataCountry hide">
|
||||
<select is="emby-select" id="selectCountry" label="${LabelCountry}" required="required"></select>
|
||||
</div>
|
||||
<div class="checkboxContainer checkboxContainer-withDescription chkSaveLocalContainer hide">
|
||||
<label>
|
||||
<input is="emby-checkbox" type="checkbox" id="chkSaveLocal" />
|
||||
@ -23,7 +29,7 @@
|
||||
|
||||
<div class="checkboxContainer checkboxContainer-withDescription hide chkDownloadImagesInAdvanceContainer">
|
||||
<label>
|
||||
<input is="emby-checkbox" type="checkbox" id="chkDownloadImagesInAdvance"/>
|
||||
<input is="emby-checkbox" type="checkbox" id="chkDownloadImagesInAdvance" />
|
||||
<span>${OptionDownloadImagesInAdvance}</span>
|
||||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">${OptionDownloadImagesInAdvanceHelp}</div>
|
||||
@ -45,30 +51,6 @@
|
||||
<div class="fieldDescription checkboxFieldDescription">${ImportMissingEpisodesHelp}</div>
|
||||
</div>
|
||||
|
||||
<div class="checkboxContainer checkboxContainer-withDescription fldExtractChapterImages hide">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" class="chkExtractChapterImages" />
|
||||
<span>${OptionExtractChapterImage}</span>
|
||||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">${ExtractChapterImagesHelp}</div>
|
||||
</div>
|
||||
|
||||
<div class="checkboxContainer checkboxContainer-withDescription fldExtractChaptersDuringLibraryScan hide">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" class="chkExtractChaptersDuringLibraryScan" />
|
||||
<span>${LabelExtractChaptersDuringLibraryScan}</span>
|
||||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">${LabelExtractChaptersDuringLibraryScanHelp}</div>
|
||||
</div>
|
||||
|
||||
<div class="checkboxContainer checkboxContainer-withDescription chkArhiveAsMediaContainer hide">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" class="chkArhiveAsMedia" />
|
||||
<span>${OptionDetectArchiveFilesAsMedia}</span>
|
||||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">${OptionDetectArchiveFilesAsMediaHelp}</div>
|
||||
</div>
|
||||
|
||||
<div class="checkboxContainer checkboxContainer-withDescription chkAutomaticallyGroupSeriesContainer hide">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" class="chkAutomaticallyGroupSeries" />
|
||||
@ -76,3 +58,22 @@
|
||||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">${OptionAutomaticallyGroupSeriesHelp}</div>
|
||||
</div>
|
||||
|
||||
<div class="chapterSettingsSection hide">
|
||||
<h1>${HeaderChapterSettings}</h1>
|
||||
<div class="checkboxContainer checkboxContainer-withDescription fldExtractChapterImages">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" class="chkExtractChapterImages" />
|
||||
<span>${OptionExtractChapterImage}</span>
|
||||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">${ExtractChapterImagesHelp}</div>
|
||||
</div>
|
||||
|
||||
<div class="checkboxContainer checkboxContainer-withDescription fldExtractChaptersDuringLibraryScan">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" class="chkExtractChaptersDuringLibraryScan" />
|
||||
<span>${LabelExtractChaptersDuringLibraryScan}</span>
|
||||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">${LabelExtractChaptersDuringLibraryScanHelp}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -5,15 +5,23 @@
|
||||
return [
|
||||
{
|
||||
href: 'library.html',
|
||||
name: globalize.translate('HeaderLibraries')
|
||||
name: Globalize.translate('HeaderLibraries')
|
||||
},
|
||||
{
|
||||
href: 'librarydisplay.html',
|
||||
name: globalize.translate('TabDisplay')
|
||||
name: Globalize.translate('TabDisplay')
|
||||
},
|
||||
{
|
||||
href: 'metadataimages.html',
|
||||
name: Globalize.translate('TabMetadata')
|
||||
},
|
||||
{
|
||||
href: 'metadatanfo.html',
|
||||
name: Globalize.translate('TabNfoSettings')
|
||||
},
|
||||
{
|
||||
href: 'librarysettings.html',
|
||||
name: globalize.translate('TabAdvanced')
|
||||
name: Globalize.translate('TabAdvanced')
|
||||
}];
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,14 @@
|
||||
href: 'librarydisplay.html',
|
||||
name: Globalize.translate('TabDisplay')
|
||||
},
|
||||
{
|
||||
href: 'metadataimages.html',
|
||||
name: Globalize.translate('TabMetadata')
|
||||
},
|
||||
{
|
||||
href: 'metadatanfo.html',
|
||||
name: Globalize.translate('TabNfoSettings')
|
||||
},
|
||||
{
|
||||
href: 'librarysettings.html',
|
||||
name: Globalize.translate('TabAdvanced')
|
||||
@ -128,7 +136,7 @@
|
||||
$('.librarySettingsForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
|
||||
view.addEventListener('viewshow', function () {
|
||||
LibraryMenu.setTabs('librarysetup', 3, getTabs);
|
||||
LibraryMenu.setTabs('librarysetup', 4, getTabs);
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
@ -1,23 +0,0 @@
|
||||
<div id="metadataConfigurationPage" data-role="page" class="page type-interior metadataConfigurationPage withTabs" data-require="scripts/metadataconfigurationpage,emby-checkbox,emby-button,emby-select">
|
||||
|
||||
<div data-role="content">
|
||||
|
||||
<div class="content-primary">
|
||||
|
||||
<form class="metadataConfigurationForm">
|
||||
|
||||
<div class="selectContainer">
|
||||
<select is="emby-select" id="selectLanguage" label="${LabelMetadataDownloadLanguage}" required="required"></select>
|
||||
</div>
|
||||
<div class="selectContainer">
|
||||
<select is="emby-select" id="selectCountry" label="${LabelCountry}" required="required"></select>
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<button is="emby-button" type="submit" class="raised button-submit block"><span>${ButtonSave}</span></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
@ -6,6 +6,18 @@
|
||||
|
||||
<div class="tabContent">
|
||||
<form class="metadataImagesConfigurationForm">
|
||||
<h1 style="margin-top:0;">${HeaderPreferredMetadataLanguage}</h1>
|
||||
|
||||
<p style="margin:1.5em 0;">${DefaultMetadataLangaugeDescription}</p>
|
||||
|
||||
<div class="selectContainer">
|
||||
<select is="emby-select" id="selectLanguage" required="required" label="${LabelLanguage}"></select>
|
||||
</div>
|
||||
|
||||
<div class="selectContainer">
|
||||
<select is="emby-select" id="selectCountry" required="required" label="${LabelCountry}"></select>
|
||||
</div>
|
||||
|
||||
<div class="selectContainer">
|
||||
<select is="emby-select" id="selectItemType" data-mini="true" label="${LabelCustomizeOptionsPerMediaType}"></select>
|
||||
</div>
|
||||
@ -23,20 +35,20 @@
|
||||
<div class="collapseContent">
|
||||
<div class="backdropFields" style="margin-bottom: 2em; display: none;">
|
||||
<div class="inputContainer">
|
||||
<input is="emby-input" type="number" id="txtMaxBackdrops" pattern="[0-9]*" required="required" min="0" label="${LabelMaxBackdropsPerItem}"/>
|
||||
<input is="emby-input" type="number" id="txtMaxBackdrops" pattern="[0-9]*" required="required" min="0" label="${LabelMaxBackdropsPerItem}" />
|
||||
</div>
|
||||
<div class="inputContainer">
|
||||
<input is="emby-input" type="number" id="txtMinBackdropDownloadWidth" pattern="[0-9]*" required="required" min="0" label="${LabelMinBackdropDownloadWidth}"/>
|
||||
<input is="emby-input" type="number" id="txtMinBackdropDownloadWidth" pattern="[0-9]*" required="required" min="0" label="${LabelMinBackdropDownloadWidth}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="screenshotFields" style="margin-bottom: 2em; display: none;">
|
||||
<div class="inputContainer">
|
||||
<input is="emby-input" type="number" id="txtMaxScreenshots" pattern="[0-9]*" required="required" min="0" label="${LabelMaxScreenshotsPerItem}"/>
|
||||
<input is="emby-input" type="number" id="txtMaxScreenshots" pattern="[0-9]*" required="required" min="0" label="${LabelMaxScreenshotsPerItem}" />
|
||||
</div>
|
||||
|
||||
<div class="inputContainer">
|
||||
<input is="emby-input" type="number" id="txtMinScreenshotDownloadWidth" pattern="[0-9]*" required="required" min="0" label="${LabelMinScreenshotDownloadWidth}"/>
|
||||
<input is="emby-input" type="number" id="txtMinScreenshotDownloadWidth" pattern="[0-9]*" required="required" min="0" label="${LabelMinScreenshotDownloadWidth}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -1,52 +1,38 @@
|
||||
define(['historyManager', 'jQuery'], function (historyManager, $) {
|
||||
define(['loading'], function (loading) {
|
||||
'use strict';
|
||||
|
||||
var currentItemId;
|
||||
function reload(context, itemId) {
|
||||
|
||||
function reload(page) {
|
||||
|
||||
page = $(page)[0];
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var itemId = MetadataEditor.getCurrentItemId();
|
||||
currentItemId = itemId;
|
||||
loading.show();
|
||||
|
||||
if (itemId) {
|
||||
require(['metadataEditor'], function (metadataEditor) {
|
||||
|
||||
metadataEditor.embed(page.querySelector('.editPageInnerContent'), itemId, ApiClient.serverInfo().Id);
|
||||
metadataEditor.embed(context.querySelector('.editPageInnerContent'), itemId, ApiClient.serverInfo().Id);
|
||||
});
|
||||
} else {
|
||||
page.querySelector('.editPageInnerContent').innerHTML = '';
|
||||
Dashboard.hideLoadingMsg();
|
||||
context.querySelector('.editPageInnerContent').innerHTML = '';
|
||||
loading.hide();
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#editItemMetadataPage", function () {
|
||||
return function (view, params) {
|
||||
|
||||
var page = this;
|
||||
view.addEventListener('viewshow', function () {
|
||||
reload(this, MetadataEditor.getCurrentItemId());
|
||||
});
|
||||
|
||||
MetadataEditor.setCurrentItemId(null);
|
||||
|
||||
$('.libraryTree', page).on('itemclicked', function (event, data) {
|
||||
view.querySelector('.libraryTree').addEventListener('itemclicked', function (event) {
|
||||
|
||||
if (data.id != currentItemId) {
|
||||
var data = event.detail;
|
||||
|
||||
if (data.id != MetadataEditor.getCurrentItemId()) {
|
||||
|
||||
MetadataEditor.setCurrentItemId(data.id);
|
||||
reload(page);
|
||||
reload(view, data.id);
|
||||
}
|
||||
});
|
||||
|
||||
}).on('pageshow', "#editItemMetadataPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
reload(page);
|
||||
|
||||
}).on('pagebeforehide', "#editItemMetadataPage", function () {
|
||||
|
||||
var page = this;
|
||||
});
|
||||
|
||||
};
|
||||
});
|
||||
|
@ -14,7 +14,10 @@
|
||||
selected: selected
|
||||
},
|
||||
|
||||
li_attr: {}
|
||||
li_attr: {
|
||||
serveritemtype: item.Type,
|
||||
collectiontype: item.CollectionType
|
||||
}
|
||||
};
|
||||
|
||||
if (item.IsFolder) {
|
||||
@ -272,11 +275,18 @@
|
||||
|
||||
var eventData = {
|
||||
id: node.id,
|
||||
itemType: node.li_attr.itemtype
|
||||
itemType: node.li_attr.itemtype,
|
||||
serverItemType: node.li_attr.serveritemtype,
|
||||
collectionType: node.li_attr.collectiontype
|
||||
};
|
||||
|
||||
if (eventData.itemType != 'livetv' && eventData.itemType != 'mediafolders') {
|
||||
$(this).trigger('itemclicked', [eventData]);
|
||||
if (eventData.itemType != 'livetv' && eventData.itemType != 'mediafolders' && eventData.serverItemType != 'UserView' && eventData.serverItemType != 'CollectionFolder' && !eventData.collectionType) {
|
||||
|
||||
this.dispatchEvent(new CustomEvent('itemclicked', {
|
||||
detail: eventData,
|
||||
bubbles: true,
|
||||
cancelable: false
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -443,6 +443,14 @@
|
||||
href: 'librarydisplay.html',
|
||||
name: Globalize.translate('TabDisplay')
|
||||
},
|
||||
{
|
||||
href: 'metadataimages.html',
|
||||
name: Globalize.translate('TabMetadata')
|
||||
},
|
||||
{
|
||||
href: 'metadatanfo.html',
|
||||
name: Globalize.translate('TabNfoSettings')
|
||||
},
|
||||
{
|
||||
href: 'librarysettings.html',
|
||||
name: Globalize.translate('TabAdvanced')
|
||||
|
@ -1,145 +0,0 @@
|
||||
define(['jQuery', 'fnchecked'], function ($) {
|
||||
'use strict';
|
||||
|
||||
function load(page, config, allCultures, allCountries) {
|
||||
if (!config || !allCultures || !allCountries) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('#selectLanguage', page).val(config.PreferredMetadataLanguage);
|
||||
$('#selectCountry', page).val(config.MetadataCountryCode);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
var form = this;
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
config.PreferredMetadataLanguage = $('#selectLanguage', form).val();
|
||||
config.MetadataCountryCode = $('#selectCountry', form).val();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).then(function() {
|
||||
Dashboard.processServerConfigurationUpdateResult();
|
||||
|
||||
showConfirmMessage(config);
|
||||
});
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
|
||||
function showConfirmMessage(config) {
|
||||
|
||||
var msg = [];
|
||||
|
||||
msg.push(Globalize.translate('MetadataSettingChangeHelp'));
|
||||
|
||||
if (config.DownloadImagesInAdvance) {
|
||||
msg.push(Globalize.translate('DownloadImagesInAdvanceWarning'));
|
||||
}
|
||||
|
||||
if (!msg.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
require(['alert'], function (alert) {
|
||||
alert({
|
||||
text: msg.join('<br/><br/>')
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function getTabs() {
|
||||
return [
|
||||
{
|
||||
href: 'metadata.html',
|
||||
name: Globalize.translate('TabSettings')
|
||||
},
|
||||
{
|
||||
href: 'metadataimages.html',
|
||||
name: Globalize.translate('TabServices')
|
||||
},
|
||||
{
|
||||
href: 'metadatanfo.html',
|
||||
name: Globalize.translate('TabNfoSettings')
|
||||
}];
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#metadataConfigurationPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
$('.metadataConfigurationForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
|
||||
}).on('pageshow', "#metadataConfigurationPage", function () {
|
||||
|
||||
LibraryMenu.setTabs('metadata', 0, getTabs);
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
var config;
|
||||
var allCultures;
|
||||
var allCountries;
|
||||
|
||||
ApiClient.getServerConfiguration().then(function (result) {
|
||||
|
||||
config = result;
|
||||
load(page, config, allCultures, allCountries);
|
||||
});
|
||||
|
||||
function populateLanguages(select, languages) {
|
||||
|
||||
var html = "";
|
||||
|
||||
html += "<option value=''></option>";
|
||||
|
||||
for (var i = 0, length = languages.length; i < length; i++) {
|
||||
|
||||
var culture = languages[i];
|
||||
|
||||
html += "<option value='" + culture.TwoLetterISOLanguageName + "'>" + culture.DisplayName + "</option>";
|
||||
}
|
||||
|
||||
select.innerHTML = html;
|
||||
}
|
||||
|
||||
function populateCountries(select, allCountries) {
|
||||
|
||||
var html = "";
|
||||
|
||||
html += "<option value=''></option>";
|
||||
|
||||
for (var i = 0, length = allCountries.length; i < length; i++) {
|
||||
|
||||
var culture = allCountries[i];
|
||||
|
||||
html += "<option value='" + culture.TwoLetterISORegionName + "'>" + culture.DisplayName + "</option>";
|
||||
}
|
||||
|
||||
select.innerHTML = html;
|
||||
}
|
||||
|
||||
ApiClient.getCultures().then(function (result) {
|
||||
|
||||
populateLanguages(page.querySelector('#selectLanguage'), result);
|
||||
|
||||
allCultures = result;
|
||||
load(page, config, allCultures, allCountries);
|
||||
});
|
||||
|
||||
ApiClient.getCountries().then(function (result) {
|
||||
|
||||
populateCountries(page.querySelector('#selectCountry'), result);
|
||||
|
||||
allCountries = result;
|
||||
load(page, config, allCultures, allCountries);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
@ -3,6 +3,44 @@
|
||||
|
||||
var currentType;
|
||||
|
||||
function populateLanguages(select) {
|
||||
|
||||
return ApiClient.getCultures().then(function (languages) {
|
||||
|
||||
var html = "";
|
||||
|
||||
html += "<option value=''></option>";
|
||||
|
||||
for (var i = 0, length = languages.length; i < length; i++) {
|
||||
|
||||
var culture = languages[i];
|
||||
|
||||
html += "<option value='" + culture.TwoLetterISOLanguageName + "'>" + culture.DisplayName + "</option>";
|
||||
}
|
||||
|
||||
select.innerHTML = html;
|
||||
});
|
||||
}
|
||||
|
||||
function populateCountries(select) {
|
||||
|
||||
return ApiClient.getCountries().then(function (allCountries) {
|
||||
|
||||
var html = "";
|
||||
|
||||
html += "<option value=''></option>";
|
||||
|
||||
for (var i = 0, length = allCountries.length; i < length; i++) {
|
||||
|
||||
var culture = allCountries[i];
|
||||
|
||||
html += "<option value='" + culture.TwoLetterISORegionName + "'>" + culture.DisplayName + "</option>";
|
||||
}
|
||||
|
||||
select.innerHTML = html;
|
||||
});
|
||||
}
|
||||
|
||||
function loadTabs(page, tabs) {
|
||||
|
||||
var html = '';
|
||||
@ -363,6 +401,19 @@
|
||||
|
||||
function loadPage(page) {
|
||||
|
||||
var promises = [
|
||||
ApiClient.getServerConfiguration(),
|
||||
populateLanguages(page.querySelector('#selectLanguage')),
|
||||
populateCountries(page.querySelector('#selectCountry'))
|
||||
];
|
||||
|
||||
Promise.all(promises).then(function (responses) {
|
||||
|
||||
var config = responses[0];
|
||||
page.querySelector('#selectLanguage').value = config.PreferredMetadataLanguage || '';
|
||||
page.querySelector('#selectCountry').value = config.MetadataCountryCode || '';
|
||||
});
|
||||
|
||||
loadTabs(page, [
|
||||
|
||||
{ name: 'OptionMovies', type: 'Movie' },
|
||||
@ -473,6 +524,9 @@
|
||||
|
||||
if (metadataOptions) {
|
||||
|
||||
config.PreferredMetadataLanguage = form.querySelector('#selectLanguage').value;
|
||||
config.MetadataCountryCode = form.querySelector('#selectCountry').value;
|
||||
|
||||
saveSettingsIntoConfig(form, metadataOptions);
|
||||
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||
|
||||
@ -496,16 +550,24 @@
|
||||
function getTabs() {
|
||||
return [
|
||||
{
|
||||
href: 'metadata.html',
|
||||
name: Globalize.translate('TabSettings')
|
||||
href: 'library.html',
|
||||
name: Globalize.translate('HeaderLibraries')
|
||||
},
|
||||
{
|
||||
href: 'librarydisplay.html',
|
||||
name: Globalize.translate('TabDisplay')
|
||||
},
|
||||
{
|
||||
href: 'metadataimages.html',
|
||||
name: Globalize.translate('TabServices')
|
||||
name: Globalize.translate('TabMetadata')
|
||||
},
|
||||
{
|
||||
href: 'metadatanfo.html',
|
||||
name: Globalize.translate('TabNfoSettings')
|
||||
},
|
||||
{
|
||||
href: 'librarysettings.html',
|
||||
name: Globalize.translate('TabAdvanced')
|
||||
}];
|
||||
}
|
||||
|
||||
@ -551,7 +613,7 @@
|
||||
|
||||
}).on('pageshow', "#metadataImagesConfigurationPage", function () {
|
||||
|
||||
LibraryMenu.setTabs('metadata', 1, getTabs);
|
||||
LibraryMenu.setTabs('metadata', 2, getTabs);
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
@ -62,16 +62,24 @@
|
||||
function getTabs() {
|
||||
return [
|
||||
{
|
||||
href: 'metadata.html',
|
||||
name: Globalize.translate('TabSettings')
|
||||
href: 'library.html',
|
||||
name: Globalize.translate('HeaderLibraries')
|
||||
},
|
||||
{
|
||||
href: 'librarydisplay.html',
|
||||
name: Globalize.translate('TabDisplay')
|
||||
},
|
||||
{
|
||||
href: 'metadataimages.html',
|
||||
name: Globalize.translate('TabServices')
|
||||
name: Globalize.translate('TabMetadata')
|
||||
},
|
||||
{
|
||||
href: 'metadatanfo.html',
|
||||
name: Globalize.translate('TabNfoSettings')
|
||||
},
|
||||
{
|
||||
href: 'librarysettings.html',
|
||||
name: Globalize.translate('TabAdvanced')
|
||||
}];
|
||||
}
|
||||
|
||||
@ -81,7 +89,7 @@
|
||||
|
||||
}).on('pageshow', "#metadataNfoPage", function () {
|
||||
|
||||
LibraryMenu.setTabs('metadata', 2, getTabs);
|
||||
LibraryMenu.setTabs('metadata', 3, getTabs);
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
@ -466,15 +466,9 @@ var Dashboard = {
|
||||
divider: true,
|
||||
name: Globalize.translate('TabLibrary'),
|
||||
href: "library.html",
|
||||
pageIds: ['mediaLibraryPage', 'librarySettingsPage', 'libraryDisplayPage'],
|
||||
pageIds: ['mediaLibraryPage', 'librarySettingsPage', 'libraryDisplayPage', 'metadataImagesConfigurationPage', 'metadataNfoPage'],
|
||||
icon: 'folder',
|
||||
color: '#38c'
|
||||
}, {
|
||||
name: Globalize.translate('TabMetadata'),
|
||||
href: "metadata.html",
|
||||
pageIds: ['metadataConfigurationPage', 'metadataImagesConfigurationPage', 'metadataNfoPage'],
|
||||
icon: 'insert_drive_file',
|
||||
color: '#FF9800'
|
||||
}, {
|
||||
name: Globalize.translate('TabSubtitles'),
|
||||
href: "metadatasubtitles.html",
|
||||
@ -1704,6 +1698,7 @@ var AppInfo = {};
|
||||
defineRoute({
|
||||
path: '/edititemmetadata.html',
|
||||
dependencies: [],
|
||||
controller: 'scripts/edititemmetadata',
|
||||
autoFocus: false
|
||||
});
|
||||
|
||||
@ -1909,13 +1904,6 @@ var AppInfo = {};
|
||||
controller: 'scripts/loginpage'
|
||||
});
|
||||
|
||||
defineRoute({
|
||||
path: '/metadata.html',
|
||||
dependencies: [],
|
||||
autoFocus: false,
|
||||
roles: 'admin'
|
||||
});
|
||||
|
||||
defineRoute({
|
||||
path: '/metadataadvanced.html',
|
||||
dependencies: [],
|
||||
|
@ -296,6 +296,7 @@
|
||||
"LabelRunServerAtStartupHelp": "This will start the tray icon on windows startup. To start the windows service, uncheck this and run the service from the windows control panel. Please note that you cannot run both at the same time, so you will need to exit the tray icon before starting the service.",
|
||||
"ButtonSelectDirectory": "Select Directory",
|
||||
"LabelCachePath": "Cache path:",
|
||||
"DefaultMetadataLangaugeDescription": "These are your defaults and can be customized on a per-library basis.",
|
||||
"LabelCachePathHelp": "Specify a custom location for server cache files, such as images. Leave blank to use the server default.",
|
||||
"LabelRecordingPath": "Default recording path:",
|
||||
"LabelMovieRecordingPath": "Movie recording path (optional):",
|
||||
@ -316,7 +317,7 @@
|
||||
"LabelFanartApiKey": "Personal api key:",
|
||||
"LabelFanartApiKeyHelp": "Requests to fanart without a personal API key return images that were approved over 7 days ago. With a personal API key that drops to 48 hours and if you are also a fanart VIP member that will further drop to around 10 minutes.",
|
||||
"ExtractChapterImagesHelp": "Extracting chapter images will allow Emby apps to display graphical scene selection menus. The process can be slow, cpu-intensive and may require several gigabytes of space. It runs when videos are discovered, and also as a nightly scheduled task. The schedule is configurable in the scheduled tasks area. It is not recommended to run this task during peak usage hours.",
|
||||
"LabelMetadataDownloadLanguage": "Preferred download language:",
|
||||
"LabelMetadataDownloadLanguage": "Preferred metadata download language:",
|
||||
"ButtonSignIn": "Sign In",
|
||||
"TitleSignIn": "Sign In",
|
||||
"HeaderPleaseSignIn": "Please sign in",
|
||||
@ -1026,6 +1027,8 @@
|
||||
"TitleDevices": "Devices",
|
||||
"TabCameraUpload": "Camera Upload",
|
||||
"TabDevices": "Devices",
|
||||
"HeaderLibrarySettings": "Library Settings",
|
||||
"HeaderChapterSettings": "Chapter Settings",
|
||||
"HeaderCameraUploadHelp": "Automatically upload photos and videos taken from your mobile devices into Emby.",
|
||||
"MessageNoDevicesSupportCameraUpload": "You currently don't have any devices that support camera upload.",
|
||||
"LabelCameraUploadPath": "Camera upload path:",
|
||||
|
@ -6,6 +6,8 @@
|
||||
<form class="wizardSettingsForm">
|
||||
<h1>${HeaderPreferredMetadataLanguage}</h1>
|
||||
|
||||
<p style="margin:1.5em 0;">${DefaultMetadataLangaugeDescription}</p>
|
||||
|
||||
<div class="selectContainer">
|
||||
<select is="emby-select" id="selectLanguage" required="required" label="${LabelLanguage}"></select>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user